cancel
Showing results for 
Search instead for 
Did you mean: 

Main Report with Sub Report Header and Footer

0 Kudos

I have a Main report with Reporter Header, Details, Groups, Report Footer and Page Footer. On my main report (Customer Order which contains detailed lines, the number of lines and pages could vary), this report is formatted perfectly with Page Header and Report Footer showing on each page. I'm trying to add a Sub Report that essentially has it's own Report Header and Footer as well as detail where I want the Sub Report to print after the Main Report has printed. My main report doesn't have anything in the 'Report Footer' when it prints without issue so I added my Sub Report to the Report Footer, linked it without issue. However now when I print my Main Report the Sub Report prints but so does the Page Header and Page Footer from the Main Report. I don't want the Page Header or Page Footer to print when the Sub Report is printing, hence why I've added my sub report to the Report Footer. I tried suppressing the Page Header and Footer of the main report when the Page <> Total Nbr of Pages thinking that my Sub Report is the last page and I want those Header and Footers on every page except the last one where my sub report is. Nothing seems to work and the Page Header and Footer print on the sub report regardless of the settings/suppression I've chosen.

Suggestions? Ideas?

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor

Hi Wallace,

Here's what you need to do:

1. Go to the Section Expert > highlight the Page Header section > click the formula button beside 'Suppress' and use this code:

OnLastRecord

This should suppress the header on pages where the subreport prints.

2. Create a formula with this code and place it on the Page Header:

shared numbervar x;
if not OnLastRecord then
    x := 0
Else
    x := 1;
'';

3. Go to the Section Expert > Highlight Page Footer > Add the following suppression formula:

shared numbervar x;
x = 1;

This should suppress Page Footer on all pages the subreport prints on.

-Abhilash