Symptom
How to conditionally suppress or display the subreport in crystal Reports Designer?
Environment
Crystal Reports 2008
Resolution
- Insert the Subreport on the report on any section based on your requirement.
- Create a static parameter, where place two strings fields as 'Yes' and 'No' and for the parameter name should be such that it
should ask the user to provide either of the value(Yes/No). - Select the Subreport> right click to format Subreport>do not check the Suppress option> select the formula button next to the
suppress option. - Type the following formula in the formula Editor
If {?Report1} = 'No' then TRUE;
There is no need to type the FALSE part of the statement.
In the above formula {?Report1} represents the parameter. - Save and close it. Now on refresh it will ask the user whether they want to preview the subreport or not and based on the user inputs the subreport will be displayed or hide in the preview mode.
Keywords
subreport, suppress, hide, CR. , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To
Product
Crystal Reports 2008 V1