PageFooter & TotalPages#
edoardor
Italy
i have invoice report and need to prent total only in the last page.
i have set :
frxReport1.EngineOptions.DoublePass := true;
and
procedure PageFooter1OnBeforePrint(Sender: TfrxComponent);
begin
PageFooter1.Visible := <Page#> = <TotalPages#>;
end;
the PageFooter is always NOT visible and <TotalPages#> is always = 0
hai can i do to rtesolve my problems ?
Thanks
i have set :
frxReport1.EngineOptions.DoublePass := true;
and
procedure PageFooter1OnBeforePrint(Sender: TfrxComponent);
begin
PageFooter1.Visible := <Page#> = <TotalPages#>;
end;
the PageFooter is always NOT visible and <TotalPages#> is always = 0
hai can i do to rtesolve my problems ?
Thanks
Comments
Try on Page1OnBeforePrint instead.
You see, after you make the pagefooter INVISIBLE, it will not call OnBeforePrint event again, will it? After all, an INVISIBLE element doesn't print, hence no OnBeforePrint event!
Put a showmessage inside the event to help you understand if you need.
try this code in the main demo basic list. band 3 is the page footer
procedure Band3OnBeforePrint(Sender: TfrxComponent);
begin
band3.visible := (<Page> = <TotalPages>);
end;
works fine.
do you checked Report->DoublePass?
when i add Showmessage(<TotalPages#>) in procedure Band3OnBeforePrint always return 0. But on band [TotalPages#] return correct value ([TotalPages] return 0]
You can use the ?«Page,?» ?«Page#,?» ?«TotalPages,?» and ?«TotalPages#?» system variables for displaying a page number or a total number of pages. In composite reports, these variables work in the following way:
Page ??? page number in the current report
Page# - page number in the batch
TotalPages ??? total number of pages in the current report (a report must be a two-pass one)
TotalPages# - total number of pages in a batch.
pay attention to which event you use when checking the value of a variable.
Showmessage(<TotalPages#>)
should be Showmessage(inttostr(<TotalPages#>))
unless you are running a batch report you should use <totalpages>.