[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]] ==== Total # of pages (OpenInsight 16-Bit Specific) ==== === At 28 NOV 2007 09:14:33AM Waheed Rehman wrote: === {{tag>"OpenInsight 16-Bit Specific"}} How can we get total # of pages so that we can be able to print "Page x/y" on every page. We have tried out STARTOVERLAY / ENDOVERLAY before TERM message, but this is not giving a proper solution because footer text is dynamic. Is there any alternate? We are using 8.0.0 evaluation verison. ---- === At 28 NOV 2007 10:24AM ftomeo@srpcs.com's Frank Tomeo wrote: === Waheed, It has been in my experience that when I need to accomplish something like this in OIPI, that I normally will pre-calculate the number of pages that are going to print. For example, if this is a list report, then it is pretty easy to know the number of rows that will fit on a page before you need a page break after a couple of test runs. After that, it becomes a simple matter of division to determine the total number of pages. It is also partly determined on how your data is laid down on the page. If you using AddTable to dump the entire contents of your data at once, it will be difficult to determine the page count. If you manage your printing in sections or row-by-row, you can better determine what the end page number will be, either by row count or physical inches. ftomeo@srpcs.com [url=http://www.srpcs.com]SRP Computer Solutions, Inc.[/url] [img]http://www.srpcs.com/images/ftr_tree_slogan.gif[/img] ---- === At 30 NOV 2007 05:01AM Waheed Rehman wrote: === Here is the solution found yesterday. It will allow to you print whatever text in the footing, also Font and footing at left, center, or right side of the page according keeping page margin in mind. * * ------ * TOT_PAGES =GET_PRINTER( 'PAGE' ) ;* Get Page# of this last page before terminating the print session X =Set_Printer( 'TERM', 1 ) ;* Finish this printing session NEW_MARGIN =PAGE_MARGIN CURRENT_PAGE_ONLY= '0' FOOTER_FONT =Arial': @FM: '7': @FM: 'L' * FOR I= 1 TO TOT_PAGES X= SET_PRINTER( 'STARTOVERLAY', I ) X= SET_PRINTER( 'FONT', FOOTER_FONT ) * FOOTER_TEXT= 'Page No: ': I: ' of ': TOT_PAGES * * Get the size of Footer Text * TEXT_SIZE =SET_PRINTER( 'CALCTEXT', FOOTER_TEXT ) TEXT_SIZE =GET_PRINTER( 'CALCTEXT') * * Calculate the postion for Right Justified * NEW_POS =( PRINT_AREA_WIDTH - TEXT_SIZE ) NEW_POS =( PAGE_SIZE - TEXT_SIZE ) NEW_MARGIN= ( PAGE_MARGIN - TEXT_SIZE ) - 0.05 * X= SET_PRINTER( 'MARGIN', NEW_MARGIN ) X= SET_PRINTER( 'TEXTXY', FOOTER_TEXT, NEW_POS, '', CURRENT_PAGE_ONLY ) X= SET_PRINTER( 'ENDOVERLAY', I ) NEXT I * ************** ---- === At 01 DEC 2007 01:18PM ftomeo@srpcs.com's Frank Tomeo wrote: === Waheed, Although that may accomplish what you need, you may run into problems if page 1 isn't always the first page to come out (like a cover letter for a multi-page invoice). Also, you are letting OIPI dictate where you are printing, rather than dictating your position on the page. If you knew where you were on the page, you could accomplish all that code in three lines or less. Less Set/Get Printer commands would make for faster printing... ftomeo@srpcs.com [url=http://www.srpcs.com]SRP Computer Solutions, Inc.[/url] [img]http://www.srpcs.com/images/ftr_tree_slogan.gif[/img] [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=0A9281BC41EEB82F852573A1004E3CA3|View this thread on the forum...]]