Conditional Page or Group Header (1 Viewer)

doulostheou

Registered User.
Local time
Yesterday, 23:33
Joined
Feb 8, 2002
Messages
314
Reports have never been my strong suit, so I would really appreciate any advise on how to approach this issue. I need to print one report that actually consists of several reports that belong to separate companies meeting a specific criteria.

The general format is that it shows company info and records for a specfiic audit. The group footer consists of totals followed by a page break. The next page (still in the footer) is a subreport listing a description of codes found in the report and a new page is forced after the section. Then the next company's report follows.

Everything looks and functions fine until a single company's records span more than one page. I am currently using a group header instead of a page header, as I cannot have the header information printed on the last page of each company's report (the one containing the sub report). However, my client has made it very clear that they need the header information to span multiple pages for a single company. It is apparently not as rare for a single company to have many different records as I thought.

The only solution that makes sense to me is to move the group header info into a page header and to use VBA to test certain conditions and then hide/show the page header accordingly. However, I have never quite gotten a grasp on how reports load and what information would even be available for me to test. How could I know when I am on the page that contains the subreport? At this point I am inside the group footer, but is this a property I can test with VBA?

I hope this question was clear, and I would appreciate any suggestions. If I am approaching this whole scenario entirely wrong, I would obviously appreciate knowing that too. Thanks in advance!
 
Last edited:

khawar

AWF VIP
Local time
Today, 08:33
Joined
Oct 28, 2006
Messages
870
On the group header right click and select properties
In the properties find repeat section and set it to yes
header will automatically be repeated on each page for that specific company
 

doulostheou

Registered User.
Local time
Yesterday, 23:33
Joined
Feb 8, 2002
Messages
314
Than k you for your response, but I'm afraid my explanation of the issue must have been a bit vague. The report does currently show the header for each company, but I need it to display on multiple pages for each company but not all pages. For instance, if a company has 4 pages dedicated to them, the header should be at the top of pages 1-3 and not on page 4. If a comapny has 2 pages (minimum) then the header needs to appear on page 1 and not on page 2. That is why I am thinking VBA may be necessary. I found sample code to hide/show the page header on format, but I do not know what criteria I can test to see if it is the first or last page for the group.
 

doulostheou

Registered User.
Local time
Yesterday, 23:33
Joined
Feb 8, 2002
Messages
314
I finally figured it all out and I was overcomplicating things. I just needed to create two levels of grouping (even though the groups are the same). The last "page" of the group would be the footer section of the top level of grouping/sorter. The second level then has a header that repeats. A new page is forced after the second level footer.
 

jturner

New member
Local time
Yesterday, 23:33
Joined
Jul 1, 2021
Messages
1
I finally figured it all out and I was overcomplicating things. I just needed to create two levels of grouping (even though the groups are the same). The last "page" of the group would be the footer section of the top level of grouping/sorter. The second level then has a header that repeats. A new page is forced after the second level footer.
I think I have the same quest, I want a different page header by group. If so I'm not quite understanding your solution. Add a group twice, put the header of the first type in the first header section, and then the second header in the 1st header section?
 

Gasman

Enthusiastic Amateur
Local time
Today, 05:33
Joined
Sep 21, 2011
Messages
14,576
This is almost a 13 year old post?

Post your query in a new thread with an explanation of your problem for a better response.
 

Users who are viewing this thread

Top Bottom