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
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
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.
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?
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.