Hi
I have a new requirement where i need to show more than one group in a page and when both groups have same headers i should suppress the group header. if they are different i need to show them. Both the group header and details are a CrossTab reports.
Is there any kind of formula i should use or any section/group/header settings change? :?
You’ll need to create a formula that will compare the fields you display in the group header with the ones in the previous group. Suppress if they’re all the same. The trick is, you’ll also need to check for “PreviousIsNull” or you’ll end up with errors on the first record. The formula looks something like this:
Not PreviousIsNull({table.field1})
and Not InRepeatedGroupHeader
and {table.field1} = Previous({table.field1})
and {table.field2} = Previous({table.field2})
and
Note that you do NOT need an “If…Then” here - the statement will evaluate to True or False without it. The line for “InRepeatedGroupHeader” needs to be there if you have your group header set to repeat on every page.
Go to the Section Expert, click on the formula button to the right of “Suppress” (do NOT check Suppress!) and enter the formula there. It will evaluate to True when everything is the same, thus suppressing the section.
The challenge with this is that this will happen for every group header, not just the second one on a page. This should only a problem if the group starts at the top of a page.
You could try creating a formula that includes one of the text fields that in your group header and ToText(PageNumber). You then compare that formula instead of the field value in your suppression formula (I’m not absolutely certain whether Crystal will let you use PageNumber there…). If the group is on a new page, it should appear.
I tried the formula you mentioned. It is not working. I have only one field in crosstab group header. I want Group Header crosstab to be suppressed if they are repeating in the same Page. If they are different it should display.
I am attaching the screenshot of design and report.