Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress data in main report based on subreport

Status
Not open for further replies.

pl1101

Programmer
Dec 5, 2009
46
I am using version XI and I have a report that contains a subreport. I need to suppress the data in the main report when the subreport is not null. Can this be done in Crystal. In other words can I show the data in the main report when the subreport is blank or null? I have tried using a variable, but can't get that to work. Any ideas would be greatly appreciated!

Thank you in advance.
 
You would need to provide more info about the report design. In what section is the sub located? Is it linked to the main report? On what fields? How is the main report grouped? What data do you want supressed?

-LB
 
The main report list part numbers and quantity to order, grouped by part number. They are displayed in the GH1 and the subreport list the location of the part. The main report is linked to the subreport on part number. The subreport is also positioned next to the quantity in GH1. I need the main report to display the part number and the quantity to order if the subreport is null.
 
Add two more GH sections. In GH_a, place a formula like this:

whileprintingrecords;
shared stringvar partno;
if not inrepeatedgroupheader then
partno := "";

Place the subreport in GH_b. In the subreport report footer, place a formula like this:

whileprintingrecords;
shared stringvar partno := maximum({table.partno});

Then in the main report GH_c, place the main report group header fields. Go into the section expert->GH_c->suppress->x+2 and enter:

whileprintingrecords;
shared stringvar partno;
partno <> ""

You can suppress GH_a, and you can make GH_b disappear by removing the borders from the sub, suppressing all sections WITHIN the sub, formatting the subreport->subreport tab->check "suppress blank subreport", and then going into the section expert->GH_b->check "suppress blank section".

This will result in only GH_c displaying when the sub is null.

-LB
 
You did it again!!! You saved me lots of time and frustration. It worked beautifully...
I love this forum!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top