Bug in the variable [TotalPages #]

Bug in the variable [TotalPages #]

I'm trying to know the total number of pages with not more
if I try the following code

<TotalPages#> Me returns 0

if I put a TfrxMemoView with content equal to [# TotalPages] also can not

I tried the following code no longer works


ReportTitle1OnAfterPrint procedure (Sender: TfrxComponent);
begin
showmessage (Memo1.Value);

Showmessage (<TOTALPAGES#>);

the two showmessages does not have the correct value
end;

How can I do to know the total number of pages in my report via code

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 4:20AM
    NOT a bug, improper uise.
    from the programmer's manual
    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.

  • edited 4:20AM
    More then how do I use these variables within an event

    Tell me how to code like this

    procedure FooterPage1OnAfterPrint(Sender: TfrxComponent);
    begin
    If <Page#> = <TotalPages#> Then
    Sum_Memo.Visible: = True else
    Sum_Memo.Visible: = False;

    end;

    The code above does not work as I do it?
  • gordkgordk St.Catherines On. Canada.
    edited 4:20AM
    first have you made the report 2 pass?
    where is the memo you are trying to show located, you are working in the oap event of the footerband,
    so you have finished with the footer
    usually in a 2 pass report code to modify props etc. is usually written in an if engine.finalpass then
    block of code.

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.