Link to home
Start Free TrialLog in
Avatar of GusK
GusK

asked on

Subreports - Page Headers and Footers

Hi There,

I am trying to resolve an issue that I currently have on a report.  

I am trying to print an invoice.   The first page being a cover page with
        a) Page Header:    (Shown on the first page only, this is okay)
        b) Detail : Summary of Report
        c) Page Footer:  (with Subtotal, Taxes etc )   (Shown on the first page only, this is okay)
        d) Report Footer: Subreport to the invoice detail (THIS IS THE PROBLEM!!!)

THE PROBLEM OUTLINED
====================
Then I have a subreport linked to this cover page (in the Report Footer Section) showing the invoice detail.  

I currently have the detail coming up, but can't seem to show the Sub Report page headers or Sub Report Footers, only the detail.   Can anyone help me display the headers and footers of the subreport?

Cheers
GusK
Avatar of Markus Fischer
Markus Fischer
Flag of Switzerland image

Hello GusK

The subreports report header and report footer print normally. If they don't, you must have done something  to prevent them from being printed.

The subreports page header and page footer is never printed. Nor is the page setup information used in any way, except for columns definitions. There is no way to activate the page headers of the subreport.

However, you can fake it. Create a top-level group on the expression =True for example (one group for the entire report), activate the group header, and set the property Repeat Section: Yes.

The new home-made page header will print even when used on a subreport.

Cheers!
(°v°)
Avatar of GusK
GusK

ASKER

Thanks for this.... I have managed to get the headers and footers

HOWEVER......

Can't get the page numbering to work as that only seems to show up in the page header and footer.

Also can't get the count of the number of pages to appear on the cover sheet (but can't think of how I could possibly link this to the subreports number of pages.

Any ideas on the page numbering as this is crucial on the invoice.

cheers
GusK
GusK

I'm afraid you will have to forget about page numbers. It might be possible using tons of subtle VB code, but I'm not up to it right now, and I don't see the point. The subreport does not count pages, obviously, but it can display the parent's page number. However, it will be the number of the page where the subreport started, not the actual page number. No luck there.

If you need page numbers on your main report, use the main report's page header or page footer. You mentioned that they appear only on the first page, and you also seem to use the page footer in a strange way.

Would you care to explain why you need to simulate the main report's page header or footer in the subreport?

(°v°)
Avatar of GusK

ASKER

Just to clarify a few things....

The front page - page footer has the subtotals (which are derrived via query) due to the fact that I need them appearing at the bottom of the page rather than straight after the detail.  (this detail is a variable length for each invoice as you can imagine).... using it in the page footer guarantees placement on the page.   (Is there an alternative?)

On the last point, I don't need the main reports page header and footer in the subreport, just need page numbers in the subreport, or a full count of pages for the entire report.  

IE Main Page reads:    Pages 1 of 30   (where 1 is the main report and 29 pages are in the subreport)
    Subreport Reads:    Counter in the footer from 2 of 30  --->  30 of 30

Hope that illustrates better.  
Cheers
GusK
It does.

You need the page footer on page one for layout purpuses (and it's true there is no easy solution to force any other section to the bottom of the pabe), and you later need the footer to display page numbers. hmm...

There is no trick to simulate a second page footer (which is a total shame in respect to alternating page footers, for example).

I'll have to come up with something... How do you turn the page footer off for all but the first page, by the way?

(°v°)
Hello GusK

I made some tests, and I didn't find a good solution. Some possible hacks:

 • Print the subreport as a main report, adding one to the page numbers (2-30). Record the last page number in a global variable, and then print the first page. The global variable is used instead of [Pages].

 • Manipulate the page footer so that all controls but the page number become invisible starting with page two. This is rather easy, I think.

 • Use Me.Print to print the page number on any predefined position on the page. This might however conflict with the subreport, because you cannot print outside of the margins.

 • Of course the page header is still available. But that is not an option, riight?

Tell me what you think.

(°v°)
Avatar of GusK

ASKER

Not fantastic at coding but they sound promising.

The page header can contain the page numbers..... not phased about that one....

If the page numbers can appear anywhere I will be happy.

Thanks again
GusK
ASKER CERTIFIED SOLUTION
Avatar of Markus Fischer
Markus Fischer
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GusK

ASKER

Hey Mate,

Couldn't get it to work..... will give you the points anyway for the effort that you put into the solution..... thanks again for all of your patience and feedback

GusK
GusK,

Sorry this did not work out. If you feel like playing a bit more with the idea, here is my test report (containing the code above). Sometimes a working sample makes the difference.

https://filedb.experts-exchange.com/incoming/ee-stuff/261-Q_21873690.zip

Thanks for points and grade, and success with your project!
(°v°)