Regarding Pages

edited 7:40PM in FastReport 4.0
Hi,

What is the different between [Page] and [Page#]? The same for [TotalPages] and [TotalPages#]?

I try to manually set the page at the bottom the page to print the number of page and pages in the report
but this do not work properly:

procedure PageFooter1OnBeforePrint(Sender: TfrxComponent);
begin
MemoPages.Text := 'Page: ' + IntToStr(<Page>) + ' of ' + IntToStr(<TotalPages>);
or I try this:
MemoPages.Text := 'Page: ' + IntToStr(<Page#>) + ' of ' + IntToStr(<TotalPages#>);
end;

But non of the above works as the TotalPages dosen't shows correct value, it always show 0
thu I have not tested it with a lot of pages, I have only one pages the TotalPages in my testing
database and it always shows zero...

Thanks in advance!

//Marco.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited May 2012
    the memo should contain the variabloe in square braces[ ].
    MemoPages.Text := 'Page: ' + '[Page]' + ' of ' + '[TotalPages]';
    Then the rteport will process them to get a value

    not clear as to why you are doing this in code as the memo only needs to contain
    Page: [Page] of [TotalPages]

    Page# and TotalPages# are for use with batch reports.
  • edited May 2012
    Thanks for a quick response!

    I haved tried that, but it dosen't work when I test my reports...
    Therefore I did try it in code, and it still dosen't work.

    All I've getting is Page: 1 of 0...

    Is there any setting that I have to set somewhere?

    Becouse I've also tryed to copy the same memo from one of the Fast REport demos
    where it works, even when I do a recompile, but when I copy it to my own report
    the totalpages always shows 0, thu I only have one page to prewview in my report
    this far.
  • gpigpi
    edited 7:40PM
    wrote:
    All I've getting is Page: 1 of 0...

    Is there any setting that I have to set somewhere?
    You should use two-pass report
  • edited 7:40PM
    I'm sorry, but what do you mean with two-pass report?
  • gordkgordk St.Catherines On. Canada.
    edited 7:40PM
    set report engine options twopass to true.
    I respectfully suggest that you read both the programmers manual and the user manual and look at the demo reports.
  • edited 7:40PM
    Well isn't that why you guys are here? To help out? I have read the pdf documenation, but it's a very large
    documentation to read and it's easy to miss escpecially when the TwoPass options have changes name to DoublePass,
    not strange that I missed that one [img]style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> So when I did set the DoublePass option to true it worked just fine. Thanks for the help![/img]
  • edited 7:40PM
    Well isn't that why you guys are here? [img]style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> I have read the pdf documenation, but it's a very large documentation to read and it's easy to miss escpecially when the TwoPass options have changed name to DoublePass, not strange that I missed that one[/img]> So when I did set the DoublePass option to true it worked just fine[img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Well, I did also look in the demo examples prior to asking here, but I couldn't find any solutions, but now it works[/img][img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Thanks again for the help![/img]

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.