Hai,
I have two Subreport in my Crystal report.want to hide Subrreports according to some condition..How is this possible
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ajay SutarPosted Apr 23, 2015, 2:30 AM
1) In the Design tab, locate the section containing the sub-reports.
2) Right click on the section in the gray margin (section) area.
3) Select Insert Section Below. A second section will appear below the original with a letter "b" after it. Example: You inserted a new section below Details. The original section becomes Details a; the new section is named Details b.
To apply conditional formatting to a section:
1) Right click on the section you want to format (in the gray right margin).
2) Select Format Section (you can also do this from the Format menu).
3) The Selection Expert appears. Make sure the correct section is highlighted (Detail a or Detail b).
4) To the right of the Selection Expert, you will see a list of options on the Common tab. One of these options is Suppress. DO NOT check this option. Checking Suppress will suppress the section all the time, even if a condition is applied to it.
5) To apply the condition, go to the right of the Suppress option's label and click on the blue X+2 button (it has a pencil below it). This will take you to the Format Formula Editor.
6) Type the logic to display or suppress your sub-report based on your parameter. For the below example, I've named your parameter Report1. In Crystal syntax the statement will look like this:
If {?Report1} = 'N' then TRUE;
There is no need to type the FALSE part of the statement.
7) Save and Close the Format Formula Editor.
8) Now, the X+2 button is red. This means a condition has been applied to the format indicated to the left.
You will find these buttons on objects when formatting them as well.