How to suppress a group header based on running-count results

crystal-reports

I'm trying to suppress a group header when there are no detailed results in another following group. I have added a manual running count total which is showing correct numbers (such as 0 when no records show on the report). I've taken this approach since I have various items suppressed within the detailed section and don't want them as part of the count.

I'm trying to say in the header not to shown the header if there are no corresponding records showing in the detailed section. But, it's not working. When I say suppress if the display count is 0, it suppresses all of the headers instead of just the ones that need to be displayed. HOW CAN I FIX THIS?

EDIT

I figured it out on my own…
I needed to create a subreport of the main report. I then added a shared variable, which will only work if the main report has the subreport in the section above the group header that needs the value passed to that group. The trick is not to suppress the section with the subreport and to make sure that the subreport is in the same group header (just a separate section of the same field being grouped).

Crystal is very tempermental when it comes to placement and Crystal version 10 will not pass a shared variable if the subreport is suppressed.

Best Answer

Try this, Go to the section expert and select the section you want to suppress. Go to the formula section "Supress (No Drill-Down)" and input the following formula.

Count({LIB_MARC_DETAILS.MARC_DATA}, {LIB_BIBLIO.RSN})<2

The first field is the field to count. The second field is the field used for grouping. Lastly the condition to suppress by (In this case it will suppress that section for any group containing less than 2 records)

Related Topic