Hiding Sub report in SSRS based on parameter (and not executing stored procedure)

I have a problem when I want to hide / show a sub-report based on the parameter that is passed to the main report.

I can set the hidden property using an expression that will hide / show the sub-report, but what I found with SQL Profiler is that the stored sub-report procedure is still running, even if the hidden report is hidden.

Does anyone know how to avoid this other than modifying the stored procedure itself. If not, does anyone know the reason the stored procedure is being performed, even believes that the hidden report is hidden?

+3
source share
3 answers

SSRS - , .

, , - - - :

=iif(Parameters!RunMyDataset.Value="Y","sp_MyDataSet","sp_Dummy")

- sp_Dummy - , (, SELECT NULL).

+7

. . , 4 page1 page4. "Investor_ID" 4 . 4 , 4 , .

, expression =iif(Parameters!Page1.Value = true, false, true) true page1 1 , .

" " .

Investor_ID, , =IIF(Parameters!Page1.Value = true, Fields!Investor_ID.Value, nothing). , 1, 1. Page1 ": ", Investor_ID null. . , 1 .

, .

+1
  • Right-click the sub-report object in the main report and select "Subreport Format ...". This will open the format editor.

  • Select the "Subreport" tab in the format editor.

  • check the box "Suppress blank submission".

0
source

All Articles