Passing multi value parameter from Main report to sub report

  • I am having problems correctly showing my results using Main report and sub report.

    In my Main report I am passing a multi-value parameter. When I run it, it displays properly.

    In the main report, I add a sub report to accept the multi value parameter for each parameter but I am having problems that it repeats the multi parameter in my sub report.

    e.g.

    Drop down box (multi value parameter) @intPrmID

    ID, Description

    1, Test 1

    2, Test 2

    3, Test 3

    4, Test 4

    User selects from Drop down box Value 1,2,4

    My dataset from sub report looks like this which filters a multi value parameter @acceptPrmId

    ID, SubTopic

    1, Sub Topic A

    1, Sub Topic B

    1, Sub Topic C

    2, Sub Topic A

    2, Sub Topic B

    3, Sub Topic A

    3, Sub Topic B

    4, Sub Topic A

    4, Sub Topic B

    4, Sub Topic C

    4, Sub Topic D

    My Result should look like This

    [Main Report]

    Test 1

    [Sub Report]

    1, Sub Topic A

    1, Sub Topic B

    1, Sub Topic C

    [Main Report]

    Test 2

    [Sub Report]

    2, Sub Topic A

    2, Sub Topic B

    [Main Report]

    Test 4

    [Sub Report]

    4, Sub Topic A

    4, Sub Topic B

    4, Sub Topic C

    4, Sub Topic D

    But for some reason my results look like this:

    [Main Report]

    Test 1

    [Sub Report]

    1, Sub Topic A

    1, Sub Topic B

    1, Sub Topic C

    2, Sub Topic A

    2, Sub Topic B

    4, Sub Topic A

    4, Sub Topic B

    4, Sub Topic C

    4, Sub Topic D

    [Main Report]

    Test 2

    [Sub Report]

    1, Sub Topic A

    1, Sub Topic B

    1, Sub Topic C

    2, Sub Topic A

    2, Sub Topic B

    4, Sub Topic A

    4, Sub Topic B

    4, Sub Topic C

    4, Sub Topic D

    [Main Report]

    Test 4

    [Sub Report]

    1, Sub Topic A

    1, Sub Topic B

    1, Sub Topic C

    2, Sub Topic A

    2, Sub Topic B

    4, Sub Topic A

    4, Sub Topic B

    4, Sub Topic C

    4, Sub Topic D

    I have set up the parameters from each report as multi value and to filter by passing the parameter with the IN syntax.

    Thoughts?

  • cbernardes (8/31/2014)


    I am having problems correctly showing my results using Main report and sub report.

    In my Main report I am passing a multi-value parameter. When I run it, it displays properly.

    In the main report, I add a sub report to accept the multi value parameter for each parameter but I am having problems that it repeats the multi parameter in my sub report.

    e.g.

    Drop down box (multi value parameter) @intPrmID

    ID, Description

    1, Test 1

    2, Test 2

    3, Test 3

    4, Test 4

    User selects from Drop down box Value 1,2,4

    My dataset from sub report looks like this which filters a multi value parameter @acceptPrmId

    ID, SubTopic

    1, Sub Topic A

    1, Sub Topic B

    1, Sub Topic C

    2, Sub Topic A

    2, Sub Topic B

    3, Sub Topic A

    3, Sub Topic B

    4, Sub Topic A

    4, Sub Topic B

    4, Sub Topic C

    4, Sub Topic D

    My Result should look like This

    [Main Report]

    Test 1

    [Sub Report]

    1, Sub Topic A

    1, Sub Topic B

    1, Sub Topic C

    [Main Report]

    Test 2

    [Sub Report]

    2, Sub Topic A

    2, Sub Topic B

    [Main Report]

    Test 4

    [Sub Report]

    4, Sub Topic A

    4, Sub Topic B

    4, Sub Topic C

    4, Sub Topic D

    But for some reason my results look like this:

    [Main Report]

    Test 1

    [Sub Report]

    1, Sub Topic A

    1, Sub Topic B

    1, Sub Topic C

    2, Sub Topic A

    2, Sub Topic B

    4, Sub Topic A

    4, Sub Topic B

    4, Sub Topic C

    4, Sub Topic D

    [Main Report]

    Test 2

    [Sub Report]

    1, Sub Topic A

    1, Sub Topic B

    1, Sub Topic C

    2, Sub Topic A

    2, Sub Topic B

    4, Sub Topic A

    4, Sub Topic B

    4, Sub Topic C

    4, Sub Topic D

    [Main Report]

    Test 4

    [Sub Report]

    1, Sub Topic A

    1, Sub Topic B

    1, Sub Topic C

    2, Sub Topic A

    2, Sub Topic B

    4, Sub Topic A

    4, Sub Topic B

    4, Sub Topic C

    4, Sub Topic D

    I have set up the parameters from each report as multi value and to filter by passing the parameter with the IN syntax.

    Thoughts?

    I think that you will need to use a value from the main reports dataset as the parameter value you are passing to the sub report.

    By use the main reports parameter, each time you call the sub report, you are telling it to produce the details for the 3 IDs. Instead what you want to do is tell the sub report that you want to

    - produce the report for ID 1 when you are processing the main report record for "Test 1"

    - produce the report for ID 2 when you are processing the main report record for "Test 2"

    - produce the report for ID 4 when you are processing the main report record for "Test 4"

    So instead of using something Parameters!Prm.Value as the value being passed to the sub report, you will need to use something like Fields!SomeFieldName.Value (where this has the values you want). If the value is not in the dataset, you should add it in. Alternatively, you could use a string function to get the value from the enter of the column that is already showing on the report as, for example "Test 1". Maybe use "=RIGHT (Fields.AnotherFieldName.Value, 1)" as the expression that is used as the parameter to the sub report.

  • I think that you will need to use a value from the main reports dataset as the parameter value you are passing to the sub report.

    By use the main reports parameter, each time you call the sub report, you are telling it to produce the details for the 3 IDs. Instead what you want to do is tell the sub report that you want to

    - produce the report for ID 1 when you are processing the main report record for "Test 1"

    - produce the report for ID 2 when you are processing the main report record for "Test 2"

    - produce the report for ID 4 when you are processing the main report record for "Test 4"

    So instead of using something Parameters!Prm.Value as the value being passed to the sub report, you will need to use something like Fields!SomeFieldName.Value (where this has the values you want). If the value is not in the dataset, you should add it in. Alternatively, you could use a string function to get the value from the enter of the column that is already showing on the report as, for example "Test 1". Maybe use "=RIGHT (Fields.AnotherFieldName.Value, 1)" as the expression that is used as the parameter to the sub report.

    Thanks for your reply. I ended up using the Fields!SomeFieldName.Value from my dataset from the Main Report. That worked perfectly! Thanks so much.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply