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

Supress page as per subreport output 1

Status
Not open for further replies.

2good2btru

Programmer
May 1, 2001
17
AE
Hi,
I am using Crystal Report 8.5
I have one group in the main report and in the detail section i have a subreport. I will have only one record for the group and am printing the subreport based on that record. Further I am printing each detail record in the main report in a new page.
Am also able to supress the subreport when there is no data(ref ), but am not able to supress the group header or the page which displays this blank record.

so when i have no record for the subreport, I have a blank page with just the group header appearing for the page. What can be done in this regards.
 
Here are two solutions:

1) Creat a sub-report that is placed in the report header that opens the table(s) in your sub-report and creates an array with one element per group containing the count of records in each group. Pass this array back to the main report as a shared variable. Note that arrays cannot have more than 1000 elements.

In the main report, conditionally suppress the group header and the detail sections if the proper element in the array is zero. Note that you will have to group your repor the same way as in the first part and create a group counter.

While this way is hard, it will work as long as you have fewer than 1001 groups.

2) Create another sub-section in the group header. In that sub-section create a linked sub-report that counts the records in the tables. Use that number in a shared variable to suppress the real group header. You can make the new sub report small, and use the "underlay following section" attribute to make it invisiable.

Howard Hammerman,
Crystal Training and Crystal Material
On-site and public classes
Low-cost telephone/email support
FREE independent Crystal newsletter
howard@hammerman.com
800-783-2269
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top