I have a link now:
http://dynamicsuser.net/media/p/8.aspx
From there you can download the original fob and see the construction.
Many thanks for the quick response from David Singleton and via a gentle hint from Mohana.
Thanks guys
original query below...
I need to be able to print the Page number and the total number of pages for each page.
The client does not want to use the preview option.
Is there a way of getting the total pages?
I have some notes from 2006 that did not make a lot of sense to me as they were not explained in sufficient detail for me to get it working.
Can anyone fill in the gaps or suggest a better solution?
What I need help with about the solution below is:
1. Is TestReport a Global Var?
2. Is PageCount a Global Var?
3. The Function ReturnTotalPages has just one line?
CURRREPORT.PAGENO
4. Where do you put the following lines?
e.g. Report - OnPreReport()?
CLEAR(Testreport);
TestReport.SAVEASHTML('c:\test.html');
//Call a function in the report that returns
/"CURRREPORT.PAGENO" after the SAVEASHTML has finished
PageCount := TestReport.ReturnTotalPages;
THE ABOVE LINE GIVES AN ERROR "The type conversion is not possible because one of the operators contains an invalid type" "Integer := VOID"
CLEAR(TestReport);
5. Where do you call a function from?
6. In Function DefTotalPages, what is the Local Parameter called
//Call a funtion in the report and use the PageCount
//as Parameter
TestReport.DefTotalPages(PageCount);
TestReport(RUN);
//END of sample
"TestReport" is a Variable of type Report
"PageCount" is a variable of type Integer
Comments
Try to search the forum for these solutions.
Make the assumption that the report will always be printed on the same printer (or at least paper size) and that it runs with the same filters. I think these are fair assumptions for Posted Documents.
Lets work with Sales Invoice. Add a new field to 112 "No Of Printed Pages"::Integer. Modify Codeunit 315 and add a new function to update the new field with no of pages.
Now in the Invoice report at the very end, when the last page is printed call the new function to update with CURRPAGENO.
Now you run the report once with no page numbers but the second time you will have the no of pages. This is probably a simpler solution and as long as you don't change paper size it should be reliable.