PageFooter & TotalPages#

edoardoredoardor Italy
edited August 2010 in FastReport 4.0
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

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 4:00AM
    try using page and totalpages the system variables with # are for batch reports.
  • edoardoredoardor Italy
    edited 4:00AM
    i have try but the result is always the same , i use version 4.9.104
  • Anu de DeusAnu de Deus Hampshire, UK
    edited August 2010
    Your code is fine, but you used the wrong event.
    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.
  • gordkgordk St.Catherines On. Canada.
    edited 4:00AM
    not so
    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.
  • edited December 2010
    gordk wrote: »
    not so
    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]
  • gordkgordk St.Catherines On. Canada.
    edited 4:00AM
    i remind you again
    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>.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.