Not that easy Marco
Navision generates the page numbers as it prints it does no pre proccesing.
If you know the number of lines in the body section for the first page and then the second page you could use the record COUNT.
IE: if there are 15 Body Lines and 50 records, with the same Sections on all Pages.
OnPreDateItem()
LinesPerPage:=15;
NoOfPages:=ROUND(Rec.Count/LinesPerPage,1,'>');
Footer,Header or Transaction Section Page Field
SourceExpression=STRSUBSTNO('Page %1 of %2',PAGENO,NoOfPages)
If you are not printing the Header on Each Page then
OnPreDateItem()
LinesFirstPage:=15
LinesPerPage:=20;
// 15 or less records
If LinesFirstPage <= Rec.Count then
NoOfPages:=1
else
NoOfPages:=ROUND((Rec.Count-LinesFirstPage) / LinesPerPage,1,'>')+1;
If you have Group Totals or Condotional section you will have to Calculate the NoOfLines in Code using record variables.
Mr David Cox
MindSource (UK) Limited
Navision Solutions Partner
Email: david@mindsource.co.uk
Web: www.mindsource.co.uk
Edited by - David Cox on 8/17/00 12:06:53 PM
mailto: David.Cox@adeptris.com
http://www.adeptris.com Find Free Development Tutorials to Download