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!

How to change title in Page Header when Report Footer prints? 1

Status
Not open for further replies.

cburns70

IS-IT--Management
Sep 12, 2006
19
US
I have a subreport in the report footer. When the subreport prints, I would like to change a text field in the Page Header, which would be the title of the Subreport. I have other information in the Page header not related to the Subreport, so I dont want to use the report header in the subreport.

In the Section Details for Report Footer, I have "New Page before" checked. Any suggestions? Thanks
 
Put the text you want for the page header for the subreport in a separate page header section and then format the section to suppress with:

not onlastrecord

Also format the usual page header section to suppress with:

onlastrecord

-LB

 
Thanks Lb, But its not working. My page header is the main report. I have a subreport in the Group Header, and then another subreport in the Report Footer. By the way this is Crystal 10 on SQL server.
 
I have no idea what you tried. I understand that you are talking about your main report page header. If you have new page before set on the report footer, then you can insert a page header_b section relating to the report footer sub and conditionally suppress it with "not onlastrecord", and do the reverse with the page header that should show when the other main report sections are displayed.

You only mentioned your other subreport in the group header in your second post. How is this relevant?

-LB
 
When I try your suggestion, page header a, which I want to show for the main report, is suppressed for the whole report. Page header b shows on all pages.

I'm not sure if the sub report in the group header is relevent or not, just though I would mention it. Thanks for your help.
 
You'll have to tell me exactly what you are doing, as I can't otherwise troubleshoot. My suggestion should work. Page_header a (main report header) should have a conditional suppression formula of: onlastrecord. The one you want for the report footer sub, should be conditionally suppressed using: not onlastrecord.

-LB
 
Ok, I'll try and explain better.

The report is for a laboratory and has one parameter which is sample number.

The report as two page headers,two group headers (Group Header 1a and b), details section and group footers are supressed, and a report footer. Group Header 1a is also supressed. Group header 1b contains the 1st sub report. The report footer contains the 2nd sub report.

Page header a contains the company letter head. Page header b contains customer information (name,address, etc...) and a text field for the report title. This information is grouped by the sample number parameter. Only one customer per sample.

The frist sub report is the results of the sample, the report title should be "Analytical Report" while that report is printing. When the report footer starts I want to change to the title to "QC Report".

I need the customer info on all pages and the report title changed only when the report footer starts. Thanks again
 
So please explain how you implemented my suggestion.

-LB
 
I did exactly as you suggested. I added another page header, so now I have page header a, b, and c. Page Header C is for all pages, Page Header B is for the Report Footer Sub Report only, and Page Header A is for the frist Sub Report.

I conditonally supressed Page Header A, with "onlastrecord", and conditonally supressed Page Header B with "not onlastrecord". I still get the same result. Page header A is supressed on the whole report, and Page Header B, prints on all pages.
 
Okay, I have a thought--does your main report HAVE any records of its own, or is it just a container report? Because then the 'onlastrecord' wouldn't work.

Instead, do the following, which I didn't suggest because it's a tiny bit more complicated. Create two formulas:

//{@true} to be placed in the report footer:
whileprintingrecords;
booleanvar flag := true;

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

Then go to the section expert->page header_b->suppress->x+ 2 and enter:

whileprintingrecords;
booleanvar flag;
flag = false //note no colon

Then select page header_a->suppress->x+2 and enter:
whileprintingrecords;
booleanvar flag;
flag = true //note no colon

-LB
 
That got it, Thanks!

The main report does have records but only in Page Header C.

I really appreciate all your help, its working prefectly now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top