OIPI and PAGE (OpenInsight 32-Bit)
At 11 JAN 2006 07:30:04AM Bob Silverstein wrote:
I am using OIPI to generate a report with multiple sections, each of which has its own column, header and page header layout. (OI, 7.1.1) I am using GET_PRINTER('PAGE') to return the current page number. However, the page number does not change as the report on the screen or printed page changes. In fact, the following code prints 1 on all lines on the first page and 1 on the first line of the second page. The page number then changes on line 2 of the second page. Is this a bug or is PAGE supposed to work this way? Any other ways of getting the correct page number?
FUNCTION TEST
DECLARE SUBROUTINE SET_PRINTER
DECLARE FUNCTION GET_PRINTER
PARAM1=@FM : @FM : 6
PARAM5=3
PARAM5=0
PARAM5=0
PARAM5=0
PARAM5=0
PARAM5=7
PARAM5=-1
SET_PRINTER('INIT', PARAM1,
,
, '', PARAM5)FOR I=1 TO 100
PAGE=GET_PRINTER('PAGE')SET_PRINTER('TEXT', PAGE)NEXT
SET_PRINTER('TERM')
RETURN 0
This is what the help has.
PAGE Get_Printer Message
Description
The current page number is returned by Get_Printer when the PAGE message is specified.
Parameters
Message
Fields
Description
PAGE
Current page number
At 11 JAN 2006 08:17AM Bob Orsini wrote:
Bob, your statements are out of sequence. The decision to eject to a new page is made at the time it is printing a line. You are getting the page number prior to this decision so it ejects the page and then prints the last page number because you did a get page before the print.
At 11 JAN 2006 08:21AM Bob Orsini wrote:
Bob, your statements are out of sequence. The decision to eject to a new page is made at the time it is printing a line. You are getting the page number prior to this decision so it ejects the page and then prints the last page number because you did a get page before the print.
At 11 JAN 2006 02:03PM Karen Oland wrote:
Try using CalcText and Pos before the TEXT stmt to see if the page will break (and force a pagebreak yourself first). That resets the page before you send the page number using TEXT.
At 12 JAN 2006 12:27AM Bob Silverstein wrote:
Bob, I switched the text and page statements and get the same result. The first line of the second page still reports page 1. The second line then reports page 2. I have tried a number of other things and still get the same result. Could this be an issue with the margins?
At 12 JAN 2006 08:10AM Bob Orsini wrote:
Bob
Keep in mind you are printing the page as of the last print. It will allways print the last page as the first line using this code. I am not sure what you are trying to accomplish here. Since under these conditions you do not know when it is ejecting you can not print the correct page unless you use the set_printer(header). A second method would be to use the overlay command for each page.
At 13 JAN 2006 07:22AM Bob Silverstein wrote:
Your suggestion on using "header" solved most of my problem. That led me to "control" that also helped.
One problem remains. I am trying to print column headers on subsequent pages. However, a row of data prints between the page header and the column header. Here is my script.
TITLE.COLUMNS=@VM : @VM : 7.5 : @FM : COLUMNS
TITLE=Daily Sales Report ' : DATE.LABEL : @VM : @VM : "Page 'P'" : HEADER
SET_PRINTER("HEADER", TITLE, TITLE.COLUMNS, HEADER)
How do I get around this?
At 13 JAN 2006 08:01AM Bob Orsini wrote:
Not sure if this is a problem but why do you have @vm's in the 2nd paramater. Also I do not see the header here. If this does not help try and increase your top margin.
At 13 JAN 2006 08:02AM Bob Orsini wrote:
Not sure if this is a problem but why do you have @vm's in the 2nd paramater. Also I do not see the header here. If this does not help try and increase your top margin.