numbering report pages
leugim
Member Posts: 93
hi all
does somebody know how to print page numbers in navision showing the total number of pages?? i.e. Page 1 of 5, 2 of 2, ... Page 5 of 5
something like: STRSUBSTNO('Page %1 of %2',PAGENO,intTotalPages); where intTotalPages is an integer variable...
we try to do this counting lines and then divide by total number of lines per page (this number is a constant inside PreDataItem) but when changing the printer, this code is not valid 'cause total number of lines could not be the same... :shock:
some ideas??
is there any way to calculate total number of lines per page for any kind of printer dinamically?
does somebody know how to print page numbers in navision showing the total number of pages?? i.e. Page 1 of 5, 2 of 2, ... Page 5 of 5
something like: STRSUBSTNO('Page %1 of %2',PAGENO,intTotalPages); where intTotalPages is an integer variable...
we try to do this counting lines and then divide by total number of lines per page (this number is a constant inside PreDataItem) but when changing the printer, this code is not valid 'cause total number of lines could not be the same... :shock:
some ideas??
is there any way to calculate total number of lines per page for any kind of printer dinamically?
_______________
so far, so good
so far, so good
0
Comments
-
It should be somewhere on the forum, you can first print to a HTML file, count the pages and use that.0
-
Hi,
There is a solution about the total number of pages that is recommended by MS in the partnersource I haven't tried it but it might work for any printer:
https://mbs.microsoft.com/partnersource ... page=false
There is also a solution by Avdhesh Yadav in the downloads:
http://www.mibuso.com/dlinfo.asp?FileID=7520 -
hello amigo,
1.Declare PNo(Variable:integer) source of the "Y" Textbox on the Page Footer(ASSUMING U WANT TO PRINT "x OF Y" on the page footer)of a Report with ID "50099"
2. Declare TestReport(Variable:Report,REPORT ID:50099)
Create 2 functions on this report "50099"
ReturnTotalpages():Integer
{
EXIT(CurrReport.PAGENO);
}
DefTotalPages(PageNo:Integer)
{
PNO:=PageNo;
}
3.Create a code Unit(#50000) and create a function in it called
FUNCTION()
{
TestReport.SAVEASHTML('c:\test.html');
PageCount := TestReport.ReturnTotalPages;
CLEAR(TestReport);
TestReport.DefTotalPages(PageCount);
TestReport.RUN;
}
4.Create a new form. Declare GD(variable:Codeunit).On the form create a button labelled "Run Report 50099(DESCRIPTION)" .
ONPUSH() trigger of " button write this code.
{
GD.FUNTCION();
}
5.These steps are for reports which are using "Grouping and Indentation"but for simple reports u can use the "Total number of records divided by the Total records on a page" principle.
thanks,
gdRegards,
GD0 -
0
-
I was writing on our db the code of post of gulamdastagir
I understand something but I don't understand why I have to create a new form on step 4
I have to use this functionality when I am printing a document from some document as invoice, order ecc...
I would not like to open a new form.
How can I solve it?
Thank you
Andy0 -
gulamdastagir wrote:hello amigo,
4.Create a new form. Declare GD(variable:Codeunit).On the form create a button labelled "Run Report 50099(DESCRIPTION)" .
ONPUSH() trigger of " button write this code.
{
GD.FUNTCION();
}
so in your case you dont have to create a new form just use whatver form you want to run this X of Y Report Functionality.Regards,
GD0 -
If I use:
TestReport.SAVEASHTML( 'C:\test.html');
with TestReport that is a variable of my report I cannot pass the record as parameter, for example SalesInvoice Header to print 1 invoice
I need to use:
Report.SAVEASHTML(Number, FileName [,SystemPrinter] [, Rec])
with Rec that is my record of SalesInvoice Header filtered but after this I cannot call the function
TotalPageNumber:= TestReport.ReturnTotalPages();
Do you understand my problem?
How can I solve it?
Thank you0 -
Ok you have to modify your FUNCTION() to FUNCTION(Rec)
FUNCTION(REC)
{
TestReport.SAVEASHTML( 'C:\test.html',REC);
.......
}Regards,
GD0 -
It is not possible to pass the second parameter REC, only the file name if I use a report variable.0
-
andy76 wrote:If I use:
TestReport.SAVEASHTML( 'C:\test.html');
with TestReport that is a variable of my report I cannot pass the record as parameter, for example SalesInvoice Header to print 1 invoice
I need to use:
Report.SAVEASHTML(Number, FileName [,SystemPrinter] [, Rec])
with Rec that is my record of SalesInvoice Header filtered but after this I cannot call the function
TotalPageNumber:= TestReport.ReturnTotalPages();
Do you understand my problem?
How can I solve it?
Thank you
CLEAR(Report)
Record.SETRECFILTER()
Report.XXX; // any user-defined function
Report.SETTABLEVIEW(Rec)
Report.SAVEASHTML('C:\test.html');//not testedRegards,
GD0 -
hiii all
I need some help with my report which i created i want to display the no of pages in this formate Page No:1(100) i have written the code for this to print in the footer and i used this same code to in sert page no in the header also and i was successful from the second page only can any one when i used this in the header give some advice
The problem i face is that in my body part, i have written some code which finds the No of records which is entered in to the report. If the body size increases then the total page no also increases and, since this code is in the body the total page is calculated after executing the body so cant get total pages in the header for the first page
i am entering my code below
codeunit :
IF PageNo = 1 THEN
BEGIN
BodyCnt1:=Bodycnt;
Pagecnt := RecCount DIV (BodyCnt1-1);
Pagecnt+=1;
Pagecnt1:= Pagecnt;
BodyCnt1:=0;
END
ELSE
Pagecnt := Pagecnt1;
IF Pagecnt < RecCount DIV(Bodycnt-1) THEN
Pagecnt:=PageNo;
header part
IF cnt=0 THEN
BEGIN
pagecnt:=Cod50100.PageCunter(COUNT,cnt,CurrReport.PAGENO);
Txt001:='Page No. ' + FORMAT(CurrReport.PAGENO) + ' of ' + FORMAT(pagecnt-1);
END;
body
IF CurrReport.PAGENO=1 THEN
cnt+=1;
footer
pagecnt:=Cod50100.PageCunter(COUNT,cnt,CurrReport.PAGENO);
Txt001:='Page No. ' + FORMAT(CurrReport.PAGENO) + ' of ' + FORMAT(pagecnt-1);
thanx in advance
can anyone help me ?0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

