Question

Here is an example of what my tablix/matrix looks like and some examples of what should happen. I have the parameters in the second report setup to accept values and in the main report I have just selected the field it should pass. Since it’s a matrix and grouped, I would think if you clicked a sub total row it would know what values relate to that row.

enter image description here

Following examples,which define what should happen:

1.When i click on cell B3(USA) it will pass Locations name i.e USA and Customer name i.e ABC as a parameter to sub report.

2).When i click on cell B5 i.e Sub total, it will send both locations i.e. USA,Dubai and customer name i.e.abc as a parameter to Sub Report.

3).When i click on cell B10 i.e Grand Total, it will send all Customer names with there respective locations as a parameters to the sub report.

Thank You

Was it helpful?

Solution

This is how I would do it. For the Subtotal link, pass "ALL" for the Location Parameter and =Fields!.Customer.Value for the Customer Parameter. For the Grand Total link, pass "ALL" for both Parameters. Then update your Sub-Report Query Where clause:

Where
    (Customer = @Customer or @Customer = 'ALL')
    and (Location = @Location or @Location = 'ALL')

This will return all Customer/Location records when the respective Parameters are set to 'ALL'.

Let me know if you need any more detail.

OTHER TIPS

I don't think you can achieve exactly what you want for your examples 2 and 3 using SSRS alone.

I would derive new columns in the Dataset to hold the concatenated parameter strings you want to pass. For your example 2, this column might be called Customer_Locations and hold a value of "USA|Dubai". I would pass that value to a multi-valued parameter in the sub report, using the SSRS Split function in the Subreport Parameter definition. Its important that the chosen delimiter doesn't appear in the possible Location values.

The same value would repeat in each row of the Dataset, for all the rows for that Customer.

For example 3, I would add 2 further columns e.g. Customer_Locations_Grand_Total = "USA|Dubai" and Customers_Grand_Total = "ABC|CDE". These same values would repeat for all rows.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top