Calling a sub-report when user clicks on detail row cell of a Tablix control is straight forward. You can right click on the detail cell, select textbox properties. Select Action and then select ‘Go to report’ option. Select the report you want to call as a sub-report, add the parameters and you are done.
I got a requirement to call sub-report based on a tablix row group. You can achieve the required behavior with the help of expressions. Following is a screen shot of the report structure.
There are two Row groups Transaction Type and Classification Type. Right click on the highlighted detail cell, click on report properties and select Actions.
The requirement was to display sub-report based on first group, Transaction Type, so instead of selecting a sub-report, I clicked on the expression box and typed expression as mentioned below.
=IIF(Fields!TRANSACTION_TYPE.Value=”Sales Order” ,”SO_Details.rdl”,
IIF(Fields!TRANSACTION_TYPE.Value=”Purchase Order” ,”PO_Details.rdl”,”WIP_Details.rdl”))
For first two parameters, the value for Omit expression will be false. The last parameter ‘Type’ is only required for PO_Details.rdl report. To skip third parameter for other two reports, we use the following expression.
=IIF(Fields!TRANSACTION_TYPE.Value=”Purchase Order”,False,True)
Expressions are frequently used in report and are an important aspect of report development. Expressions make our life easier by helping us in controlling the behavior and content of report.
Apply