The Stealth Subreport

Wednesday 25 October 2006 @ 2:35 pm

Often subreports are used in Crystal Reports to retrieve an unrelated value from a different table or data source. In many of these cases you do not want to see the subreport at all. You just want to retrieve your value and use it. You soon realize, however, that if you suppress the subreport object, or if you suppress the section that contains the subreport, the subreport will simply not run.

To make a subreport run but be completely invisible you follow three steps:

1) Suppress all of the sections inside the subreport. This makes the subreport completely invisible, but still allows it to run. Do NOT hide or suppress the section in the main report that contains the subreport.

2) In the main report go into the menu using (Format > Subreport > Subreport Tab) and tick the property “Suppress blank subreport”.

3) In the main report go into the Section Expert and find the section that contains the subreport.  Tick the property “Suppress Blank Section”.

This combination will make the section invisible, but the subreport will still run.

If you are using a really old version of Crystal you might not have some of these properties.  There are some workarounds for these in the Crystal Reports “Expert Techniques” guides in my library.

2 Responses to 'The Stealth Subreport'

  1. JESii7 - November 19th, 2006 at 2:14 pm

    I prefer to use the “Suppress if blank…” options, rather than underlay — it seems more straightforward to me.

    Simply check “Suppress Blank Subreport” in the Format Subreport/Subreport tab and check “Suppress Blank Section” in the Section Expert. The section & subreport never appears and you don’t have to worry about future maintenance gotcha’s. FYI… I tend to put one subreport in a section for granularity of control.

  2. Ken Hamady - November 19th, 2006 at 4:44 pm

    Thanks, that method would work just as well if you are in versions 9 or later. The Underlay method works in older versions as well as the newer versions.

Leave a Reply

Recrystallize Pro