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!

Repeat Group header on each page 2

Status
Not open for further replies.

jpdmdc

Programmer
Mar 10, 2005
115
Hi,

I'm using CR 0 and Oracle 9i. I want the group header to repeat on each page but it is not doing so. It shows up only if the detail continues on next page.Other wise it won't. Please help!!

Thank you.
 
If the group has ended before the beginning of the new page, the group header will not appear. Please give an example of what you are trying to do. I assume that you have gone to report->group expert->options and checked "Repeat group header on each page."

-LB
 
Hi Lbass,

first of all thank you for responding to my posting. I have a subreport and I'm trying to repeat the group header in the subreport. As you said, the grops which are ending in the same page, their heading appears only once. But, my problem is, if the detail ends in the present page and group footer starts in the next page, it is not showing the group header in the next page. I want the group header to show up if group footer alone or some of the detail and group footer together are in next page.
Please help!!

Thank you!!
 
I forgot to mention that yes, I did whatever you were assuming. As I said, group header is repeating only if the detail is extending to the next page. If it is only the group footer hich is going to the next page then it is not showing up .

Thank you!!
 
I see what your issue is, and it is odd behavior. I tried adding a count to each visible section of the report, with a reset in the page header. My idea was to use a separate group footer section for the group header fields which would then be conditionally suppressed if it wasn't the first line count on the page. But the minute it was conditionally suppressed the line count no longer reset.

It does work if you use field suppression instead of section suppression, as long as you don't also check "suppress blank section" for GH_a. So insert another group footer section_a, place the group header fields there and then conditionally suppress the fields with:

{@linecnt} <> 1

...where {@linecnt} is the following and is placed in all displayed report sections (except the page header):

whileprintingrecords;
numbervar linecnt := linecnt + 1;

In the page header, you have to place this formula:
whileprintingrecords;
numbervar linecnt := 0;

The higher order Group Footer should be formatted to "keep together" (the line above GH_a in the section expert).

-LB
 
Hi LB,

Thank you so much for your reply. Actually, I don't see page header in my subreport at all. So, I don't understand where I should reset linecnt.

Please help!

Thank you!
 
Create a fake page header by creating a formula that includes all records, as in:

whilereadingrecords;
1

Insert a group on this, format it to repeat group header on each page, and use it as your page header. Not sure how this affects the solution. Please let me know.

-LB
 
Hi LB,

I did excatly as you said but it is not working!

First I created a fake group which is my first group now,acting as my page header. I placed my reset formula in it.

Then I created Group footer for my second group which is my actual group and placed the group header fields in it.
I Conditionally suppressed my group footer with the following code -
{@linecnt} <> 1.

Then I placed {@linecnt} in each section of my report except in the group headers and footers.

Please let me know if I have missed anything.

Thank you!!

 
Please note that I said to use field suppression, not section expression. Select the group header fields that you have placed in the group footer->right click->format field->suppress->x+2 and place the formula there.

-LB
 
Hi LB,

I corrected my mistake but it still not working!

 
I just tested this again, and it worked perfectly. When you added the field suppression to the group footer fields, did you remember to remove the section suppression for that section?

-LB
 
Yes LB! I have removed that and it still not working! I have multiple group footers! Do you think this could be the reason for failure?

 
Could be, since this solution depends upon the group footer being the first section on the page.

-LB
 
Hello,

I am having this exact problem (I am using CR 9). Is there a solution when the group footer in questions ISN'T the first section on the page? I just want to group header to print on the page that the group footer appears? Doesn't seem like a lot to ask?

Thanks for your help!
 
If you go to the group expert->options->check "repeat group header on each page", the group header will appear if there are any details on the page, so the only instance where it should be a problem is when the group footer is the only section on the page (and therefore the first).

Please describe your report structure (groups), and provide more information about the problem you are experiencing.

-LB
 
Thanks for responding!

My problem is exactly as you describe - there are no details on the page in question - just the group footer information (without the header).

My problem resides in a sub report. The sub report displays detail restaurant information, grouped by district, region and company. The main report is the same - it shows different information about the restaurant and works fine because the "group" header information is actually in the page header. In the sub report, I moved the "page" header information to the region group header - that is where I have the problem. The sub report is supposed to look like a continuation of the main report with a different title in the header and the page numbers continuing.

I tried to do what you detailed above, but it puts the header and footer information on a new page every time - even when there is plenty of room for the footer on the page with the detail.

I hope that is enough information.

Thank you!
 
It doesn't sound like the same problem. The original problem was that the group header did not print when the group footer was the only section on the page. It sounds like your problem is that the group header and footer are keeping together and moving to another page. Try two things: First uncheck "keep together" on the section containing the subreport. Then also select the subreport ->format subreport->common->uncheck "Keep object together". This will allow the subreport info to flow from page to page. I'm unclear whether there is still a header issue.

-LB
 
Below is a rough outline of how my report is organized. My issue is in the sub report. If the group 2 footer will not fit on the page with the details and group 1 footer information, it gets bumped to a new page but the group 2 header does not print - the only thing on the page is the group 2 footer information. After I tried some of your suggestions, I got the group footer to ALWAYS print on a new page with the group header. That is not quite what I need.

What I need is for the group 2 footer to print on the same page as the details if there is room and if there is not, to print on the next page with a group 2 header. I hope this better explains my problem. Thanks for your time.

Page 1

Page Header

Labor Analysis
Total Waste
Region 1 (Group 2 Name)

Store Name Waste

District 1 (Group 3 Header)

123 Main Street 1.3%
456 Oakville 4.7%
789 Kirkland .56%

District 1 Totals (Group 3 Footer)

District 2 (Group 3 Header)

321 Arrowhead 7.2%
654 Downtown 1.7%
987 Smallville 1.8%

District 2 Totals (Group 3 Footer)

Region 1 Totals (Group 2 Footer)

Company Totals (Group 1 Footer)

Page 2 (this is a sub report)

Group 2 Header

Labor Analysis
Total Short Staff
Region 1 (Group 2 Name)

Store Name Waste

District 1 (Group 3 Header)

123 Main Street -.35%
456 Oakville -2.7%
789 Kirkland -3.76%

District 1 Totals (Group 3 Footer)

District 2 (Group 3 Header)

321 Arrowhead -4.6%
654 Downtown - .9%
987 Smallville - 2.6%

District 2 Totals (Group 3 Footer)

Region 1 Totals (Group 2 Footer)

Company Totals (Group 1 Footer)
 
You should be using a formula as noted earlier that contains all records in the subreport for grouping in order to create the fake group header, NOT using the Group #2 header. Try copying the fields in the group #2 header into the header for {@all} and then also try unchecking "keep together" in the two places mentioned in my last post.

-LB
 
Sorry, I think there is one other thing I did not mention that might be part of my problem. I suppress the company totals (group 1 footer) if there is only 1 region for the company. I need the group 2 name in the header so if I move the group 2 header information to the dummy group, the headers get "out of wack" - I think because the company footer is suppressed in most cases and the dummy header doesn't know that we've moved on to another region yet? If I leave the group 2 header information in the group 2 header, it all works fine - except that the header won't print if there is no detail information on the page - only the footer prints.

I tried not suppressing the company footer and all the header and footer information match up - I just get the company footer that I don't need (since the information is identical to the region footer information).

I guess I don't understand why the group header doesn't print on the page containing the group footer? Do people normally not want the header displayed with the footer?

Thanks again for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top