Question Output page numbers in text file

shawnp

New Member
Hi all - This has me quite puzzled. I'm having to fix a number of programs where the page number isn't properly outputting to the text file.

I've got the "output to value(OutFile) PAGED", and the frame is set to PAGE-TOP, but the output always shows "Page 1" on every page, even if there's 100 pages.

I've placed the page-number function in other spots, thinking maybe it's a placement thing, but then I'll get them on every record, even though the page number does change for each page - I'll just have 30 records all listing "page 1", 30 more listing "page 2", etc. But where we want it (shown below, although I'm open to moving it elsewhere as I tried), it's always "Page 1". Help?

Code:
FORM WITH FRAME f-label132 PAGE-TOP NO-BOX NO-LABELS WIDTH 180 STREAM-IO.

IF FIRST-OF(tpd.site) THEN
         DO:
           OutFile = "<path hidden>\sp\oor" +  tpd.site + STRING(TODAY,"999999") +
             SUBSTRING(STRING(TIME, "HH:MM"), 1, 2) + SUBSTRING(STRING(TIME, "HH:MM"), 4, 2) + ".txt".
           OUTPUT TO VALUE(OutFile) PAGED.
          
           DISPLAY
               SKIP(1)
                "openord-site                                       O P E N   O R D E R S   R E P O R T                        Page: " PAGE-NUMBER FORMAT ">>9"
                "  Order    Due Date LN# Ord Date Qty OH     Qty Avl    Item                    Description        Qty Ord    Qty Opn    Qty PO     Qty Job    V# Exp Res" 
                "---------- -------- --- -------- ---------- ---------- ----------------------- ------------------ ---------- ---------- ---------- ---------- -- --- ---" 
               with frame f-label132.
END.
 

Osborne

Active Member
It may be due to not having HEADER in the FORM definition or the displaying of the frame is in the wrong place.

If you run this against the Sports2000 database you will see page numbers and hopefully it points you in the right direction:
Code:
FORM HEADER
     SKIP(1)
     "openord-site                                       O P E N   O R D E R S   R E P O R T                        Page: " PAGE-NUMBER FORMAT ">>9"
     "  Order    Due Date LN# Ord Date Qty OH     Qty Avl    Item                    Description        Qty Ord    Qty Opn    Qty PO     Qty Job    V# Exp Res" 
     "---------- -------- --- -------- ---------- ---------- ----------------------- ------------------ ---------- ---------- ---------- ---------- -- --- ---" 
     WITH FRAME f-label132 PAGE-TOP NO-BOX NO-LABELS WIDTH 180 STREAM-IO.

FORM
    Order.Ordernum
    WITH NO-BOX NO-LABELS DOWN FRAME forders STREAM-IO.

OUTPUT TO VALUE(OutFile) PAGED.

VIEW FRAME f-label132.

FOR EACH Order NO-LOCK:
   DISP Order.Ordernum WITH FRAME forders.
   DOWN WITH FRAME forders.
END.

OUTPUT CLOSE.
 
Top