Daniel Retief Fourie
Daniel Retief Fourie

Reputation: 626

Crystal Reports - Suppressing a header in main report when sub-report is present

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.

Upvotes: 4

Views: 24573

Answers (4)

Man Blueice
Man Blueice

Reputation: 101

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...:)

Upvotes: 10

Raj Patel
Raj Patel

Reputation: 124

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

Upvotes: 0

user359040
user359040

Reputation:

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}

Upvotes: 0

Lee Tickett
Lee Tickett

Reputation: 6047

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?

Upvotes: 9

Related Questions