PAGE x OF y on a report

EAGLE
Member Posts: 2
Hi everyone...
This simple article might be usefull.
1. Create a singleinstances codeunit (named it PAGExOFy) with 2 functions on it :
SetLastPage(LastPage : Integer)
OurLastPage := LastPage;
GetLastPage() : Integer
Exit(OurLastPage);
2. Design a report and put a code on a OnPostReport trigger :
OnPostReport()
PAGExOFy.SetLastPage(CurrReport.PAGENO);
3. Put 2 TextBox on a report, the first one, or the x one (as we all know) is simply put CurrReport.PAGENO on its SourceExpr property.
The second one, or the y one, put PAGExOFy.GetLastPage on its SourceExpr property.
4. Unfortunately with this method, which is the only simple method i know, i have to preview the report twice, to make the y number on PAGE x OF y, to be displayed correctly.
I hope this method might help for anyone who need it...until we (specially me, considering im a new user at this forum) can get a better method.
Thanks
This simple article might be usefull.
1. Create a singleinstances codeunit (named it PAGExOFy) with 2 functions on it :
SetLastPage(LastPage : Integer)
OurLastPage := LastPage;
GetLastPage() : Integer
Exit(OurLastPage);
2. Design a report and put a code on a OnPostReport trigger :
OnPostReport()
PAGExOFy.SetLastPage(CurrReport.PAGENO);
3. Put 2 TextBox on a report, the first one, or the x one (as we all know) is simply put CurrReport.PAGENO on its SourceExpr property.
The second one, or the y one, put PAGExOFy.GetLastPage on its SourceExpr property.
4. Unfortunately with this method, which is the only simple method i know, i have to preview the report twice, to make the y number on PAGE x OF y, to be displayed correctly.
I hope this method might help for anyone who need it...until we (specially me, considering im a new user at this forum) can get a better method.
Thanks
0
Comments
-
Hej EAGLE of rookie-land
Fly high and check out the site, e.g.
http://www.mibuso.com/forum/viewtopic.p ... light=html
which I find as a good alternative to preview (although you still has to run the report twice)
Don't feel shy, just check before talking O:)With Kind Regards
Thoms Hviid Thorn0 -
For a simple report, create the report run it and count the detail lines per page.
Item - OnPreDataItem()
LinesPerPage = 20;
PageCount := ROUND(Item.Count /LinesPerPage,1,'>');
then you have a simple total pages!Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions