JustJack
JustJack

Reputation: 3

Fastreport VCL Setting header visibility on odd pages

In fastreport VCL 4 is there a way to set headers visibility only on odd pages of report? Found no answer on google, neither on fastreport's site, documentation & forum.

Upvotes: 0

Views: 1379

Answers (1)

jrodenhi
jrodenhi

Reputation: 2237

You do it in code. In your page object's OnBeforePrint event, you put some code sort of like this:

procedure PageHeader1OnBeforePrint(Sender: TfrxComponent);
begin
  PageHeader1.Visible := (Frac(<Page#> / 2) > 0.01)                                                                                                                                   
end;

Maybe there is an easier way to figure out whether you are on an odd page or not, but I resorted to the Frac function because they don't have a Mod function. In practice, I would probably add that function within my own code and make it accessible within the report.

Upvotes: 2

Related Questions