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

Follow Up Help - change the page header name depending on subreport? 2

Status
Not open for further replies.

acentler

Technical User
Joined
Oct 25, 2006
Messages
16
Location
US
I posted a message looking for help on creating pageheaders in the subreport to show up in the main report. I got the following response which worked great if the subreport was only 1 page long.
---------------------------------------------------
The simplest solution would be to format your main report page header to conditionally suppress based on a formula:

onlastrecord

Then in each subreport, create a fake page header by creating a formula that includes all records:

whilereadingrecords;
1

Insert a group on this formula and check "repeat group header on each page" and then delete the groupname and add your page header text to the group header. Repeat for each subreport.

There is a way to use the main report page headers, but the above solution is probably simpler.
----------------------------------------------------
What I have is subreports that only have charts/tables in the report footer section. For example RFa and RFb. When I do the above the group header only shows up for RFa. Is there a way to get it to show up on every page in the subreport?

I am inserting the subreports into a main report RF.

CRXI

Thank You
 
I guess you'd have to use the main report page headers after all. If you are using the same page header for all subreport pages, you could create a formula or add a text box into a page_header_b section and then format the section to suppress with the conditional formula:

not onlastrecord

Page header_a would be formated with: onlastrecord

If you are using different page headers per subreport, you'd use a different approach.

-LB
 
Yea i got something like that just doing it on page counts. Just some of the subreports will change page counts on me. So what was just a 1 page subreport is now 3 pages knocking all the page header names off.

Anything you can think of is much appreciated master yoda :-)
 
What I suggested has nothing to do with page counts, so I'm not sure what you're saying.

-LB
 
OK I guess then I didnt understand what you suggested .. sorry ;-)
 
So I tried what you suggested a couple of ways and couldn't get it to work. I am more then likely doing it totally wrong.

I am using just 1 page header for the whole report. I am just using the page formula above to title the headers.
 
What page formula? Please spend some time clarifying what you are trying to do. Are you trying to create three separate titles, one for the main report, and one for each subreport? How are you currently trying to do this?

-LB
 
OK.... Have one main report I am putting all my subreports in. I am putting them all in the main reports Report Footer. I am trying to change the main report page header to reflect what the subreport is showing. I have been able to accomplish this by putting a simple formula in the main report.

if PageNumber = 2
then 'Table of Contents'
else if PageNumber >= 3 and pagenumber <= 7
then 'I like Cheese' //RFa subreport1
else if PageNumber >= 8 and pagenumber <= 12
then 'lbass rocks' //RFb subreport2
else if PageNumber = 13
then 'Bean couting charts'//RFc subreport3

This works ok if I wanted to constantly be changing this formula because sometimes subreport1 can be 8 pages instead of 4, and subreport2 will be 2 pages.. etc.

So I am hunting a way to change the main report page header automatically as the pages in the subreports change.

Page counts will vary from week to week so there is no logic to that. I want the page header to be on every page in the main report. Your 1st suggestion to do the group header only gives me 1 header per subreport.

 
Okay, that's better. I can help you, but not until late afternoon. Sorry.

-LB
 
Not a problem at all... Been an issue with me since January.. I can wait.. Thank YOU!
 
First insert two more page headers. In the first one (PH_a) have your main report page headers. In PH_b, place the page header text for the first subreport in a text box (Or you could add this as a text string in a formula). Add the page header text for the second subreport in PH_c.

Create four formulas and place them as noted below:
//{@false1} to be placed in the report header AND in the report footer_b section:
whileprintingrecords;
booleanvar flag1 := false;

//{@false2} to be placed in the report header:
whileprintingrecords;
booleanvar flag2 := false;

//{@true1} to be placed in the report footer_a:
whileprintingrecords;
booleanvar flag1 := true;

//{@true2} to be placed in the report footer_b:
whileprintingrecords;
booleanvar flag2 := true;

Then go to the section expert and check "New Page Before" for each of RH_a and RH_b. Then select PH_a->suppress->x+2 and enter:

onlastrecord

Then select PH_b->suppress->x+2 and enter:
whileprintingrecords;
booleanvar flag1;
flag1 <> true //Note no colon

Then select PH_c->suppress->x+2 and enter:
whileprintingrecords;
booleanvar flag2;
flag2 <> true //Note no colon

-LB
 
Thank You... I will give it a try this afternoon and let you know how it went. Thanks Again.
 
Works like a champ. Thanks LB you've saved me tons of time. Out of curiosity how does this work with putting the False formula in the page header?
 
I don't really know what you mean--you wouldn't want to do that.

-LB
 
Sorry meant to say report header. But don't worry about it. I will just file it under Magic.

Thank Again!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top