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?
_______________
so far, so good
0
Comments
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=752
Arhontis
https://forum.mibuso.com/search
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,
gd
GD
http://www.mibuso.com/forum/viewtopic.php?t=3769
http://www.BiloBeauty.com
http://www.autismspeaks.org
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
Andy
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.
GD
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
FUNCTION(REC)
{
TestReport.SAVEASHTML( 'C:\test.html',REC);
.......
}
GD
CLEAR(Report)
Record.SETRECFILTER()
Report.XXX; // any user-defined function
Report.SETTABLEVIEW(Rec)
Report.SAVEASHTML('C:\test.html');//not tested
GD
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 ?