Option 1: //Fixed Section Output
If it can be done by counting the lines, if we know that the report will print 20 lines we could just add the dataitem counts together divide by 20 and round up.
Option 2: //Dynamics or Conditional Output
If the report does not take a long time to run, what you could do is store the number of pages with a loop twice!
Not tested just an Idea to work from!
CAL Globals
PageCount = Integer
FirstRun = Boolean
Add a new top level dataitem PageCounter - type - integer with no sections
PageCounter - OnPreDataItem()
FirstRun := NOT ISSERVICETIER;
IF FirstRun THEN
SETRANGE(Number,1,2)
ELSE
SETRANGE(Number,1);
PageCounter - OnAfterGetRecord()
IF Number = 2 THEN
FirstRun := FALSE;
Then in all Report Sections the last lines would read
IF CurrReport.SHOWOUTPUT THEN
CurrReport.SHOWOUTPUT(NOT FirstRun);
In a new Report Footer Section get the last page number
IF CurrReport.SHOWOUTPUT THEN
PageCount := CurrReport.PAGENO;
CurrReport.SHOWOUTPUT(FALSE);
Option 3:
Just tell the Customer that Dynamics NAV does not record the last page number, even in RTC if the report loops more than once!
issue is my report have group heading/footer (totals) in between pages.
so do you think it is possible?
I tried few things, those are working only for the reports which have printing FIXED NUMBER OF LINES (ex.20 lines per page).
but in my case I cant predict/give the number of lines per page, it is very.
I tried few things, those are working only for the reports which have printing FIXED NUMBER OF LINES (ex.20 lines per page).
but in my case I cant predict/give the number of lines per page, it is very.
I hate to be the spoiler here, but is page x/y that important to your employer?
This has been discussed many times, and this case is usually not worth the effort for the "problem".
The most original solution I've come for this is printing to a word document and using word to determine the page x/y.
|Pressing F1 is so much faster than opening your browser| |To-Increase|
Comments
http://www.mibuso.com/dlinfo.asp?FileID=752
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
my report is bit complex, with 6 data items & printing body on 3rd data item.
wonder how to place the coding.
try few ways, but not working.
anyway thanks
ERP Consultant - MS Dynamics NAV
https://lk.linkedin.com/pub/lakshan-vindana-kulawansa/37/2a2/592
If it can be done by counting the lines, if we know that the report will print 20 lines we could just add the dataitem counts together divide by 20 and round up.
CAL Globals
PageCount = Integer
Option 2: //Dynamics or Conditional Output
If the report does not take a long time to run, what you could do is store the number of pages with a loop twice!
Not tested just an Idea to work from!
CAL Globals
PageCount = Integer
FirstRun = Boolean
Add a new top level dataitem PageCounter - type - integer with no sections
Then in all Report Sections the last lines would read
In a new Report Footer Section get the last page number
Option 3:
Just tell the Customer that Dynamics NAV does not record the last page number, even in RTC if the report loops more than once!
HTH
David
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
issue is my report have group heading/footer (totals) in between pages.
so do you think it is possible?
I tried few things, those are working only for the reports which have printing FIXED NUMBER OF LINES (ex.20 lines per page).
but in my case I cant predict/give the number of lines per page, it is very.
ERP Consultant - MS Dynamics NAV
https://lk.linkedin.com/pub/lakshan-vindana-kulawansa/37/2a2/592
I hate to be the spoiler here, but is page x/y that important to your employer?
This has been discussed many times, and this case is usually not worth the effort for the "problem".
The most original solution I've come for this is printing to a word document and using word to determine the page x/y.
|To-Increase|
Thank you.
ERP Consultant - MS Dynamics NAV
https://lk.linkedin.com/pub/lakshan-vindana-kulawansa/37/2a2/592