0
votes

I've been asked to modify a Crystal Report that has a regulatory statement. When the report is rendered, regardless of the page where the statement is rendered, the given page footer contents must be suppressed. Is there a way to hide the page footer when the regulatory statement is displayed? The statement is an OLE object in Group Footer 3 of the report.

I've created a formula as follows:

WhilePrintingRecords;
booleanVar SuppressFooter := false;

I've placed the formula in the report header, mainly to initialize the variable.

I created a similar formula and placed it in group footer 3 and set the variable to true. I then reference the group footer 3 formula in the Suppress formula of the page footer section expert. Unfortunately, this suppresses the page footer for all pages associated with a given record.

Is there an operand that can be used that states - When group footer 3 is printed, set SuppressFooter:= true? Ideally, I would insert this logic in the Suppress formula of the page footer section expert.

How would I achieve the intended functionality?

Update It was suggested to move @SuppressFooter to the Group Header 3. It's defined as

WhilePrintingRecords;
BooleanVar SuppressFooter := false;

I also added @SetSuppressFooter to the Group Footer 3. It's defined as:

WhilePrintingRecords;
BooleanVar SuppressFooter := true;

The formula used to suppress Page Footer is defined as:

WhilePrintingRecords;
{@SetSuppressFooter} = true;

Snippets of the report structure are also included: Snippet 1 Snippet 2

The above logic is still not suppressing the page footer when Group Footer 3 is rendered.

1
Hm, placing another formula with same content, but SuppressFooter := true of course, into the bespoke group footer 3 should set the variable exactly when this footer is rendered.mweber
Thanks! Unfortunately, the footer is suppressed on all 5 pages of the given record. I only want to suppress the footer on the page that contains group footer 3. Note that group footer 3 could render on page 2 of one record, page 5 of another record.SidC
Well, the variable should be set to false again after the first group footer 3 occurred and after it's been evaluated as required, i.e. helped suppressing the right section. You might want to move your initial formula field from report header to page header – then it will set the variable to false on every new page.mweber
My bad, the formula is evaluated even when group footer section is suppressed and not rendered. Will try to summarize findings from a test in an answer...mweber

1 Answers

1
votes

First, the formula used to suppress Page Footer should be defined as:

WhilePrintingRecords;
BooleanVar SetSuppressFooter;

Then, if your formula @SetSuppressFooter is placed in group footer, it is evaluated even when the group footer is suppressed by condition. I.e. in order to set the variable conditionally (= when the footer is printed) it's not sufficient to place the field within the section, but one must include the logic here:

WhilePrintingRecords;
BooleanVar SuppressFooter;
If {Befehl.showgroup} = 1 Then SuppressFooter := true Else SuppressFooter := false;

You have to replace {Befehl.showgroup} = 1 with your own condition of course, i.e. the one that controls group footer's section visibility.

That leads to one last point: Depending on where the page breaks are located in your report, it could be easier to use the opposite logic for page footer visibility as for group footer visibility. In this case there's no need for "WhilePrintingRecords" formulas.