We help IT Professionals succeed at work.

Any option to change the Page Headers based on the parameters in Crystal Reports

Hello,

  i have two sub reports in crystal . Based on the Parameters it will select the either sub report 1 or Sub Report 2. But here problem is both sub reports column headers are different. Now headers are displaying only for the Report Headers. where as if the user goes to second page of data , user will not be able to find the what data it is? because no headers are displaying .

Is there any way we can  change the column headers based on the parameters?

Maruthi
Comment
Watch Question

Professor Emeritus of MIS at Penn State Erie and Owner, Millet Software
Commented:
Create a dummy grouping in the subreport based on a formula that returns a constant value (for example, " ").
Move the column headers to GH1, and turn on the option to repeat GH1 on each Page.
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
I believe that will resolve the issue.  If not please explain a bit more on the issue.

mlmcc
It may depend on what else is in your main report page header section, but another option may be to put the subreport column headings in the main report, with the headings for each subreport in a separate page header section.  Then you'd use the parameters to suppress one section or the other.

 It seems like that would work, although keeping the column headings in the subreports (as in Ido's suggestion) may be a bit simpler.

 James
Ido MilletProfessor Emeritus of MIS at Penn State Erie and Owner, Millet Software

Commented:
The advantage of using the dummy Group Heading technique within the subreport is that you can easily repeat the headers on subsequent pages.
Well, the main report page headers will also be repeated, of course, but I just realized that I was assuming that the subreport would run the length of the main report.  There was another recent question where someone (possibly the OP) seemed to be using subreports like that, so I just had that scenario in my head.  But if the main report is longer than the subreport, that could be a problem.

 So, yeah, your suggestion is looking better and better.  :-)

 James
Excellent Sir. Its working Nicely.