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!

Different page header for each subreport 2

Status
Not open for further replies.

aks12

Technical User
Nov 10, 2005
60
US
Hi, I have Crystal 10 using Oracle DB.

I looked at thread767-1345144 for the solution to this, but my setup is a little different.

In my main report and subreports, all the data is in crosstabs in the RFs. I want to put 5 subreports in the main report (one each in RFb, RFc, RFd, RFe, RFf) and have each subreport start on a new page with its own title/PH at the top. I tried the method mentioned in the thread above, but because my data is in the RF, the titles/PH don't show on every page.

Any guidance here is greatly appreciated.
 
Why not create the pageheaders within each subreport? In each, create a formula like this:

whilereadingrecords;
1

Insert a group on this formula and set it to "repeat group header on each page". Remove the groupname and use this group header for your page header fields.

-LB
 
Hi lbass,

I wish the solution were that easy. That method would work fine if each of my crosstabs were contained on one page. They span multiple pages however and your proposed solution only shows the page header on the first page of the main report and each subreport. I think I'm further limited by the fact that my crosstabs have to be in report footers rather than in a group footer.

Any other ideas?
 
I recently did something similar. I put a formula field in the page header, with the following:
Code:
if {@CountIs} = 0
then "North"
else
if {@CountIs} = 1
then "South"
else
if {@CountIs} = 2
then "East"
else
if {@CountIs} = 3
then "West"
else "-"
I then created a formula field that updated the count, placed it in a report footer section below each subreport, a section I was already using for an 'end of report' message.

This worked fine in Crystal. When I exported it to Text, which does its own pages, it inexplicably used the "West2 heading in all pages for the subreport pages. This is probably due to a known bug that has been fixed in an upgrade we don't have. Still, if you are not planning to export to Text with pages, it should be OK. It did work for exports to Word, Excel and PDF.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks Madawc. Your post got me on the right track to the solution. Instead of referring to a @CounterIs formula in my page header formula, I checked the value of a shared variable which I set to 1, 2, or 3, etc. in formulas which I placed in between the subreports in their own report footer sections and suppressed them.

My report looks like this now:

PH:
//@title
shared numbervar counter;
if counter = 0 then "Title1"
else if counter = 1 then "Title2"
else if counter = 2 then "Title3"

report footer a: main report

report footer b:
//@counter1
shared numbervar counter:=1;

report footer c: subreport_1

report footer d:
//@counter2
shared numbervar counter:=2;

report footer e: subreport_2

etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top