SQL Server Developer Center > SQL Server Forums > SQL Server Reporting Services > InScope() - Passing Parameters to Drill through report from Matrix
Ask a questionAsk a question
 

AnswerInScope() - Passing Parameters to Drill through report from Matrix

  • Monday, November 02, 2009 10:42 AMMerlinJnr Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    I am looking for urgent help:
    I have a matrix report with 3 expandable rowgroups and 1 column group. There are subtotals assignes to both row and column groups.

    My issue is that whichever way I write the Inscope functions, I just can't seem to get the parameters to pass correctly for the totals.

    Can any one help me with the syntax on this please:

    RowGroup1 (Item)      - ColumnGroup1 (YearCycle)
    RowGroup1 (Team)
    RowGroup1 (Territory)

    Many thanks in Advance :)

Answers

  • Thursday, November 12, 2009 2:13 PMRaymond-LeeMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Thus when I click on a cell I need it to determine whether to call the User selectable parameter (Parameter!whatever) or take the field value from the RowGroup/Column Group.
    So, which cell the user clicked? Detail cell? I mean you set action on which area?

    Anyway, I would pass all user-selected paramter of the current report to the target report. But for some value, for example YearCycle, if YearCycle is not the parameter of the current report, why not just pass expression:
    =fieds!YearCycle.value to the target report?

    - Raymond 

All Replies

  • Monday, November 02, 2009 10:57 AMMerlinJnr Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Sorry Should read:

    RowGroup1 (Item)      - ColumnGroup1 (YearCycle)
    RowGroup2 (Team)
    RowGroup3 (Territory)
    MerlinJnr
  • Wednesday, November 04, 2009 2:00 AMRaymond-LeeMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi MerlinJnr,

     

    Here is another thread you can refer to:

    http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/0bde66d7-b0e4-40da-9a0c-838663e66119

    Although it’s related to creating subtotal, but you can use the same syntax for drill through parameters.

     

    Hope this helps.

    Raymond

  • Wednesday, November 04, 2009 2:10 PMMerlinJnr Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Thanks for the link, but am still have issues with my syntax.

    below is a link to a screenshot of my matrix (+Plus parameter select)

    <a href="http://www.flickr.com/photos/merlinjnr/4074461065/" title="Matrix by MerlinJnr, on Flickr"><img src="http://farm3.static.flickr.com/2690/4074461065_9558ce18ae_o.jpg" width="941" height="588" alt="Matrix" /></a>
    
    http://www.flickr.com/photos/merlinjnr/4074461065/sizes/o/

    My Rowgroups are called:

    "matrix1_ItemDescription"
    "Team_RowGroup"
    "Terr_RowGroup"

    My Column Group is:
    "YearCycle_ColumnGroup"

    And my dataset is called "Data"

    I know I have multiple parameters to pass, most of which are not related to the rowgroups, and thus require no inscopes, but if you could help me syntax the Team Parameter, I can then adjyst the rest accordingly.

    Your help would be greatly appriciated.

    Thanks


    MerlinJnr
  • Monday, November 09, 2009 10:44 AMMerlinJnr Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Seriously, any help would be welcome.....
    MerlinJnr
  • Wednesday, November 11, 2009 3:27 PMMerlinJnr Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I came up with this based on your example:

    =

     

    switch(

     

     

    (inscope("matrix1_ItemDescription") and inscope("YearCycle_ColumnGroup")), Parameters!Terr.Value

     

    , (InScope("Team_RowGroup")and InScope("YearCycle_ColumnGroup")), Parameters!Terr.Value

     

    , (InScope("Terr_RowGroup")and InScope("YearCycle_ColumnGroup")), Fields!TerrDesc.Value

     

    , (InScope("Data")and InScope("YearCycle_ColumnGroup")),Parameters!Terr.Value

     

    , (InScope("matrix1_ItemDescription")and InScope("Data")),Parameters!Terr.Value

     

    , (InScope("Team_RowGroup")and InScope("Data")),Parameters!Terr.Value

     

    , (InScope("Terr_RowGroup")and InScope("Data")),Fields!TerrDesc.Value

     

    , InScope("Data"),Parameters!Terr.Value

     

    )

    But it does not work, I just passes Parameter values for all permutations... Though I'd let you know


    MerlinJnr
  • Wednesday, November 11, 2009 4:24 PMRaymond-LeeMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    MerlinJnr, actually, I'm still not sure your requirment.

    It seems you are using jump to report option. And you want to pass correct value to the target report. So, which cell you set the jump to Report? I mean jump to target report from which area? Detail cell?

    What are the parameters of the target report? From the picture you posted, it seems the issue is the parameter @team, right? So, when you click the detail cell, you want to pass the current cell's team to the target report?

    Could you please explain more on that? Or, if you feel hard to explain, could you please create a demo project base on the sample database AdventureWorks and then upload the demo? I will try to look into the issue.

    Thanks
    Raymond
  • Thursday, November 12, 2009 12:08 PMMerlinJnr Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You are on the right track.
    Yep, I am jumping to a 'detail' level report (which has matching parameters to the primary report)

    There are several Report parameters, but most of there can be overlooked for Inscope, as they are not part of the Row/column groups. Thus can be passed as Parameter!Whatever.

    The Parameters that form part of the row/column groups appear in the report parameters (selectable by user) as well. Thus when I click on a cell I need it to determine whether to call the User selectable parameter (Parameter!whatever) or take the field value from the RowGroup/Column Group.

    Does this make sense?

    I had used team as an example,

    I was going to use the response and apply to the other levels, Territory, ItemDescription and YearCycle

    Hope I have been a little more cohearent this time.

    Thanks again for your patiance.

    Ta
    MerlinJnr
  • Thursday, November 12, 2009 2:13 PMRaymond-LeeMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Thus when I click on a cell I need it to determine whether to call the User selectable parameter (Parameter!whatever) or take the field value from the RowGroup/Column Group.
    So, which cell the user clicked? Detail cell? I mean you set action on which area?

    Anyway, I would pass all user-selected paramter of the current report to the target report. But for some value, for example YearCycle, if YearCycle is not the parameter of the current report, why not just pass expression:
    =fieds!YearCycle.value to the target report?

    - Raymond