mibuso.com

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

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Page of Pages - Solution
PostPosted: Tue Sep 28, 2004 5:30 pm 
Offline

Joined: Fri Jul 16, 2004 4:00 pm
Posts: 58
Location: Oehringen
Country: Germany (de)
Hi,

I just had a conversation with the MBS-Support, according to the problem to have something like "page# of totalpages" on a report.

The person I was talking had a good idea, and for me this works.

Here's the Code-Sample:

// BEGIN of Sample

CLEAR(TestReport);
TestReport.SAVEASHTML('c:\test.html');

// Call a function in the report that returns
// "CURRREPORT.PAGENO" after the SAVEASHTML has finished
PageCount := TestReport.ReturnTotalPages;
CLEAR(TestReport);

// Call a function in the report an use the PageCount
// as Parameter
TestReport.DefTotalPages(PageCount);
TestReport.RUN;

// END of Sample

"TestReport" is a Variable of type Report.
"PageCount" is a Variable of type Integer


Hope this helps.

Bye,
Rolf


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 6:55 pm 
Offline

Joined: Sun May 02, 2004 2:29 pm
Posts: 466
Location: Ljubljana, Slovenia, EU
Good idea, although it costs double running time.
And you should delete the file in the end to clean up.

_________________
           ®obi           
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯


Top
 Profile E-mail WWW  
 
 Post subject:
PostPosted: Wed Sep 29, 2004 7:43 am 
Offline

Joined: Mon Jan 12, 2004 4:52 pm
Posts: 32
Location: Greven, NRW
Country: Germany (de)
i also thought about a solution like this ... but i was scarred by the long runtime (twice as 'normal' ;) )

but if you do so you also should save the file in the temp-directory of the pc (for this use ENVIRON('TEMP'); )


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 29, 2004 8:33 am 
Offline

Joined: Fri Jul 16, 2004 4:00 pm
Posts: 58
Location: Oehringen
Country: Germany (de)
I know it will take the double running time.
The Code should only be a sample, it is not "clean" code.

But this solution is the only way, to get the exact total number of pages (official statement of Navision-Support).

To count the records that will be printed an than calculate the number of pages that will be used, only work for simple list-style reports.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 29, 2004 5:36 pm 
Offline

Joined: Sun May 02, 2004 2:29 pm
Posts: 466
Location: Ljubljana, Slovenia, EU
This topic could be part of Tips and Tricks

_________________
           ®obi           
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯


Top
 Profile E-mail WWW  
 
 Post subject: Delete the file?
PostPosted: Thu Sep 30, 2004 11:06 pm 
Offline

Joined: Sun May 09, 2004 4:11 pm
Posts: 148
Location: Barcelona
It's an stunning idea for an old issue. But, is it possible to delete repotely the same file? Above all you don't want your company's reports to be left on the local net.

And about the time: does it cost the same to print in Navision rather than to html? We use hand-made reports for inventory because in some branches of my company the Inventory Valuation takes more than a work-time day.

_________________
Navision Developer


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Sun Oct 03, 2004 8:05 pm 
Offline

Joined: Sun May 02, 2004 2:29 pm
Posts: 466
Location: Ljubljana, Slovenia, EU
well the second run can be even faster, because some data can remain in buffers...

_________________
           ®obi           
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯


Top
 Profile E-mail WWW  
 
 Post subject:
PostPosted: Tue Nov 02, 2004 9:46 am 
Offline

Joined: Mon Nov 01, 2004 3:50 pm
Posts: 18
Location: @Work
Country: Netherlands (nl)
It is an idea but it does not take the printer characteristics into acount. The same report may apear different on two different printers.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 10, 2005 11:55 am 
Offline

Joined: Thu Mar 10, 2005 11:50 am
Posts: 28
Location: Bern
Country: Switzerland (ch)
thanks a lot for the solution. It works!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 10, 2006 10:18 am 
Offline

Joined: Wed May 25, 2005 2:49 pm
Posts: 43
Location: Greece
Country: Greece (gr)
This implementation has issues in counting the pages properly. Report might be one page and it counts two, or the other way around...

Anyone can figure out why?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 15, 2006 8:47 am 
Offline

Joined: Mon Feb 27, 2006 6:20 am
Posts: 2
Location: Ho Chi Minh
Country: Vietnam (vn)
could you explain me what functions DefTotalPages(PageCount) does?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 25, 2006 12:54 pm 
Offline

Joined: Mon Sep 25, 2006 12:49 pm
Posts: 1
Location: xiamen
Country: China (cn)
But where to write these code
"TestReport.SaveAsHtml....."


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 25, 2006 1:49 pm 
Offline

Joined: Wed Feb 12, 2003 10:57 am
Posts: 154
Location: Würzburg
Country: Germany (de)
Have a look at this: http://www.mibuso.com/dlinfo.asp?FileID=752

_________________
br
Josef Metz


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 26, 2006 2:43 pm 
Offline

Joined: Tue Sep 26, 2006 2:05 pm
Posts: 4
Location: xiamen
Country: China (cn)
dear all,
I can run the solution and saveashtml in Form object. But how can i use saveashtml in report. For example, when i run Purchase Order report, i cant use currReport.saveashtml. The common demand show the total page when preview the report and we need to put the saveashtml function in report trigger. Can anyone give a example.
I tried on the triggers of a report, but cant work ](*,)
Thanks a lot


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 14, 2006 12:11 pm 
Offline

Joined: Mon Jun 12, 2006 10:18 am
Posts: 170
Location: Istanbul
SaveAsHtml command can only be used with a report variable or as a method of the REPORT. So you cannot use it inside the report itself.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users 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