Page number when printing multiple copies
Hi,
I need to print multiple copies of same report and the report should have text in 'Page [PageNo] of [TotalPages]' format.
Printing multiple copies is not an issue (which can be done by below code
I am struggling with getting text 'Page X of Y'. I have tried variables like Page#, TotalPages#, PageNofM but all those values are always 1. I have also tried incrementing a variable in 'BeforePrint' event, but to no avail.
Is there any way to get text in desired format?
Thanks,
Yash
I need to print multiple copies of same report and the report should have text in 'Page [PageNo] of [TotalPages]' format.
Printing multiple copies is not an issue (which can be done by below code
report.PrintSettings.Copies = 2;
).I am struggling with getting text 'Page X of Y'. I have tried variables like Page#, TotalPages#, PageNofM but all those values are always 1. I have also tried incrementing a variable in 'BeforePrint' event, but to no avail.
Is there any way to get text in desired format?
Thanks,
Yash
This discussion has been closed.
Comments
I theory is the first pass can count the totals and the second pass can render.
HTH - Mike
Thanks Mike.
Do you mean setting 'Double Pass'? If so, this did not help either.
I did mean "Double Pass" but now as I re-read your question I think you want CopyName#
see
http://www.fast-report.com/en/forum/?p=/discussion/9656
HTH
Mike
Hello!
System variable names: In FastReport .NET, you need to use [Page#] and [TotalPages#] (including the # symbol and with report.DoublePass set to true;)
PrintSettings.Copies = 2 duplicates the already prepared page at the printer driver level (therefore, Page#/TotalPages# on both copies of a 1-page report will be “Page 1 of 1”). To display the copy number (Copy 1, Copy 2), use the system variable [CopyName#] or prepare copies in a loop using Prepare(append: i > 0) by passing the copy number as a parameter.