3
votes

Good day everyone.

I'm running Crystal Reports 9.

I have a report listing a bunch of records, and then a sub report containing only a graph. I would like to suppress the page header of the main report, for the page where the sub-report (graph) is shown.

I can't seem to be able to think up a formula to test for the presence of the graph / sub-report to suppress the page header in the main report with.

Any advice is appreciated.

4
Can you clarify your question? Either your report has a subreport or it doesn't - why would you need to test for the existence of one? (Unless the subreport is being displayed conditionally, in which case you simply need to use the opposite condition to display the page header.)user359040
My sub report is being ALWAYS being displayed. (The graph is contained in the sub report). The page number on which it is displayed is variable though and on that page only I want the main reports page header suppressed. I hope this clarifies the question enoughDaniel Retief Fourie

4 Answers

8
votes

Hopefully the subreport/graph is in it's own section?

  • Insert a new formula in the first section of the report (report header a): global booleanvar no_header := false;
  • Insert a new section right above the subreport section with effectively 0 height.
  • Insert a new formula in this section: global booleanvar no_header := true;
  • Insert a new formula in the subreport section: global booleanvar no_header := false;
  • In your page header conditional suppression formula enter formula: global booleanvar no_header;

You may have to prefix all of those formulas with whileprintingrecords;

And you may have to tweak my suggestion a little but hopefully you get the idea?

8
votes

In the Section Expert, put this as a formula for "Suppress (No Drill-Down)" under the page header that you want to hide:

whileprintingrecords;
global booleanvar no_header;

Then on the footer section where your subreport was embedded, put this formula for "Underlay Following Sections":

whileprintingrecords;
global booleanvar no_header:= true

That way, it will hide the page header that you don't want to appear when the sub report start.

I hope this will help...:)

0
votes

I suggest:

  • setting up a formula (called something like ChartPage) to determine which page the subreport will be displayed on.
  • conditionally suppressing the PageHeader section with a formula like: PageNumber={@ChartPage}
0
votes

Step 1:

Create formula fPh (just to identify "formula Page Heading") but you can give any name.

next({Command.PolicyID}) //which is any existing field from Main report

Save and Exit.

Step 2:

Go to Report, then Section Expert and select Page Header.

Click on formula button X-2 against Suppress under Common tab and type below

PageNumber > 1 and isnull({@fPh})

Save it and you are DONE... Enjoy