dcsimg
Results 1 to 4 of 4

Thread: second(Fields! ?????

  1. #1
    Join Date
    Oct 2008
    Posts
    17

    second(Fields! ?????

    I can use First(Fields!Total.Value,"dsTotals") and Last(Fields!Total.Value,"dsTotals")
    but how can I access anything in-between?

  2. #2
    Join Date
    Jun 2004
    Location
    Atlanta and Manhattan
    Posts
    607

    Can You Give an Example?

    Can you give an example of a possible use for this - asking for a specific member of a data column, for example? I can think of lots of reasons with members that might be set up in a cube (quarters, years, etc.), or even dim and other tables in the RDBMS, and you have MDX or SQL, respectively, to make that possible - calculations both at the datasource level (which might be pulled into an SSRS report dataset) or possibly at the report level (via calculations / calculated fields).

    You might also look at the ReportItems collection, as an approach, but that would mean doing other things with perhaps other motives. I have found ReportItems a great "workaraound" to support many things I have wanted to do ...

    If you can provide a specific example, perhaps we can offer more specific advice ...

    Bill

  3. #3
    Join Date
    Oct 2008
    Posts
    17
    Bill,
    Thanks for reply - I found a work-around.

    this was to access the items selected in a multi-selected drop-down, and to get an associated value in same dataset returned by stored procedure.

    My work around was as you suggested to use ReportItems to read the textbox where the selected value was displayed. I then created 4 stored procedures in 4 datasets which gave a single output - so I could use the First() to read the associated value. The value of textbox determined which proc to use.
    Here's an example in case any-one else has similar issue:

    =IIF(ReportItems!textbox24.Value="a",First(Fields! Total.Value,"dsTotalA"),IIF(ReportItems!textbox24. Value="b",First(Fields!Total.Value,"dsTotalB"),IIF (ReportItems!textbox24.Value="c",First(Fields!Tota l.Value,"dsTotalC"),IIF(ReportItems!textbox24.Valu e="All",First(Fields!Total.Value,"dsTotalAll"),"") )))

  4. #4
    Join Date
    Jun 2004
    Location
    Atlanta and Manhattan
    Posts
    607

    Thanks for Sharing ...

    Pretty elegant solution! Thanks for posting us with the details! Input like this is useful to searchers in the weeks and months to come ...

    Hats off,

    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •