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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

suppress row if subreport is empty

Status
Not open for further replies.

retygh45

IS-IT--Management
May 23, 2006
166
US
Using CR11, I have a report, with a subreport in the same section, GH1b. This works well, and is needed, because the subreport is pulling in data from another db, but it's in the same section so when the report is produced, it looks like the data is all together on the same row.

The main report and subreport are linked by userID, and grouped by userID, however, sometimes the subreport is blank for a user. In these cases, I would like to just supress this user's entire row.

In my selection criteria, I would like to somehow say: Not IsNull(subreport.field) but I don't know if this would work or how to reference a specific field in my subreport.

Any help is appreciated, thanks!
 
You would have to have the sub in a section above the one you want suppressed, e.g., in GH1a. You can format GH1a to "underlay following sections" so that it aligns with the fields in GH1b (if you already have something in GH1a that you don't want underlaid, then insert another group section for the sub or use a shared variable to display the results in GH1b). Have a reset formula for a shared variable placed in a section above the one containing the sub (or in the report header and in GF1), something like:

whileprintingrecords;
shared stringvar ID := 0;

In the sub, set the shared variable to a recurring field and place it in the sub report footer:
whileprintingrecords;
shared stringvar ID := maximum({table.field});

Then in the main report->section expert->GH1b->suppress->x+2 enter:

whileprintingrecords;
shared stringvar ID;
ID = ""

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top