mibuso.com

Microsoft Business Solutions online community
It is currently Sun Aug 01, 2010 4:42 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: numbering report pages
PostPosted: Fri Oct 20, 2006 12:26 pm 
Offline

Joined: Wed Jun 02, 2004 6:54 pm
Posts: 61
Location: valencia
Country: Spain (es)
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?


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Fri Oct 20, 2006 12:28 pm 
Offline
MVP Microsoft Dynamics NAV
mibuso.conference Attendee

Joined: Tue Jul 19, 2005 4:49 pm
Posts: 3346
Location: Apeldoorn
Country: Netherlands (nl)
It should be somewhere on the forum, you can first print to a HTML file, count the pages and use that.

_________________
Mark Brummel | Freelance Navision Consultant
Author of the book : Microsoft Dynamics NAV 2009 Application Design

MY BLOG : http://www.brummelds.com


Top
 Profile E-mail WWW  
 
 Post subject:
PostPosted: Fri Oct 20, 2006 12:33 pm 
Offline

Joined: Wed Jan 14, 2004 11:20 am
Posts: 624
Location: Athens
Country: Greece (gr)
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=752

_________________
Regards,
Arhontis

http://www.mibuso.com/forum/search.php


Top
 Profile E-mail  
 
 Post subject: X of Y
PostPosted: Fri Oct 20, 2006 9:46 pm 
Offline

Joined: Thu Jul 27, 2006 6:08 pm
Posts: 312
Location: Sydney
Country: Australia (au)
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,
gd


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 20, 2006 9:58 pm 
Offline
MVP Microsoft Dynamics NAV
Site Supporter

Joined: Fri Jun 06, 2003 9:01 pm
Posts: 5750
Location: L.I., New York
Country: United States (us)
might as well add one last one

http://www.mibuso.com/forum/viewtopic.php?t=3769

_________________
Harry Ruiz
http://www.cosmeticsolutions.com
http://www.autismspeaks.org


Top
 Profile E-mail WWW  
 
 Post subject:
PostPosted: Mon Oct 01, 2007 5:25 pm 
Offline

Joined: Thu Sep 07, 2006 11:58 am
Posts: 328
Location: Mendrisio
Country: Switzerland (ch)
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

Andy


Top
 Profile  
 
 Post subject: Re: X of Y
PostPosted: Tue Oct 02, 2007 11:37 am 
Offline

Joined: Thu Jul 27, 2006 6:08 pm
Posts: 312
Location: Sydney
Country: Australia (au)
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,

GD


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 02, 2007 3:32 pm 
Offline

Joined: Thu Sep 07, 2006 11:58 am
Posts: 328
Location: Mendrisio
Country: Switzerland (ch)
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 2:12 am 
Offline

Joined: Thu Jul 27, 2006 6:08 pm
Posts: 312
Location: Sydney
Country: Australia (au)
Ok you have to modify your FUNCTION() to FUNCTION(Rec)

FUNCTION(REC)
{

TestReport.SAVEASHTML( 'C:\test.html',REC);

.......

}

_________________
Regards,

GD


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 9:44 am 
Offline

Joined: Thu Sep 07, 2006 11:58 am
Posts: 328
Location: Mendrisio
Country: Switzerland (ch)
It is not possible to pass the second parameter REC, only the file name if I use a report variable.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 10:05 am 
Offline

Joined: Thu Jul 27, 2006 6:08 pm
Posts: 312
Location: Sydney
Country: Australia (au)
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 tested

_________________
Regards,

GD


Top
 Profile  
 
 Post subject: Re: numbering report pages
PostPosted: Mon Oct 20, 2008 8:41 am 
Offline

Joined: Mon Sep 29, 2008 7:02 am
Posts: 26
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 ?


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group