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

Suppress Header in Main Report Based on Value in Subreport 1

Status
Not open for further replies.

southbean

Technical User
Jun 3, 2005
147
US
Hello All,

I have a report with four groups and three subreports. It is a hierarchical report where Group 4 is subordinate to Group 3. Group 3 is subordinate to Group 2. Group 2 is subordinate to Group1.
Like:

1. Colonel
2. Major
3. Captain
4. Lieutenant

The subreports display the details of changes/modifications to each group. For example, if a Captain was reassigned, the subreport will display the reassignment details.

I want to suppress the headers in each group above if there is no data/detail in the subreport.

For example, if a Lieutenant was reassigned, I want the Captain, Major and Colonel headers to be displayed. If a Captain was reassigned, I only want the Major and Colonel headers to be displayed.

I’ve created a formula and placed it in each subreport.
Code:
whileprintingrecords;
shared numbervar lieutenant_id := count({table.lieutenant_id });

In the main report, I’m using the following code in the Section Export to suppress the each header.
Code:
whileprintingrecords;
shared numbervar lieutenant_id = 0;

This works, but only for the one group. I need to Boolean multiple shared numbervars in order for this to work.

Is this possible, or am I going about this completely wrong?

Any/all suggestions would be greatly appreciated!!!

Thanks,

- tl
 
The issue is that you are trying to suppress the section that the subreport is in based on a value coming from that subreport--can't be done. You must add each subreport again (save the final version of each subreport under another name and then import it), in a section above the one containing the group header. A copy of the subreport should be in GH_a, the groupname should be in GH_b, and the subreport to display in GH_c. The copy in GH_a can have all sections within the subreport suppressed, and it can be formatted to "suppress blank subreport", and the GH_a section formatted to "suppress blank section".

You will also need a reset formula in the main report like:

whileprintingrecords;
shared numbervar lieutenant_id := 999999;

Place this in the report header and in the group footer that corresponds to the group in which the subreport is placed.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top