Dynamics User Group
Since 1995 - The Microsoft Dynamics Online User Community

Page X of Y

rated by 0 users
This post has 3 Replies | 0 Followers

Not Ranked
Posts 1
Points 35
Marco Bakker Posted: 08-17-2000 10:20
Can somebody please help how to print the Total Number of Pages on a report.
  • | Post Points: 35
Top 50 Contributor
Male
Posts 425
Points 3,380
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
  • | Post Points: 20
Another option is to use an ecxternal reporting package, like Crystal Reports.
  • | Post Points: 5
Top 50 Contributor
Male
Posts 393
Points 7,645

unfortunetly, sometimes we have different total lines

there is an item with 1 line (without description 2)

and there is an item with 2 lines (with description)

is there any default function from navision to get total pages?

because i'm using transfooter , so it would be generate automatically to go to the next page 

The True Test Of Man's Character Is What He Does When No One Is Watching....
  • | Post Points: 5
Page 1 of 1 (4 items) | RSS


Copyright Dynamics User Group, 1995-2008, all rights reserved. The Dynamics User Group is not affiliated with Microsoft Corporation.