wizard_24_h Split my display on two pages

<< Click to Display Table of Contents >>

Navigation:  How to >

wizard_24_h Split my display on two pages

Question

Is it possible to print a document over 2 pages ?

We need to print shop totals across the page.

Using landscape and a small font we still can’t fit in all the data.

 

Example                             

                       ---------Shop 2------------    -----------Shop 11-----------        ---------Shop 12----------       ---------Shop 13----------

Stock     Description        Qty         Value    Profit    Qty           Value    Profit        Qty         Value   Profit       Qty         Value   Profit

Item                         Sold        Sold               Sold          Sold                   Sold        Sold                 Sold        Sold

xxxxx    xxxxxxxxxx          xxx         xxxx       xxxx    xxx           xxxx       xxxx        xxx         xxxx      xxxx       xxx         xxxxx    xxxxx

 

 

What I would like is that half the page would print on one page and the other half prints on the next page.

This is the same as Excel does.

 

Solution: create a temporary file that you will open two times:

DEF STREAM O.

DEF VAR myLine  as char no-undo.

 

OUTPUT STREAM O TO c:/temp/totals.txt.

 

For each …. BY ….:

     DISP STREAM O

          XXX XXXX

          WITH STREAM-IO.

     END.

OUTPUT STREAM O CLOSE.

 

INPUT STREAM O FROM c:/temp/totals.txt.

OUTPUT STREAM xPrint to "c:/temp/myreport.xpr" PAGES PAGE-SIZE 60.

PUT STREAM xPrint CONTROL "<PREVIEW>".

 

REPEAT:

IMPORT STREAM O UNFORMATTED myLine.

PUT STREAM xPrint UNFORMATTED substring(myLine, 1, 80) skip.

myLine = ''.

END.

INPUT STREAM O CLOSE.

 

PAGE STREAM xPrint.

 

INPUT STREAM O FROM c:/temp/totals.txt.

REPEAT:

IMPORT STREAM O UNFORMATTED myLine.

PUT STREAM xPrint UNFORMATTED substring(myLine, 81) skip.

myLine = ''.

END.

INPUT STREAM O CLOSE.

OS-DELETE c:/temp/totals.txt.

OUTPUT STREAM xPrint CLOSE.

 

RUN printFile("c:/temp/myreport.xpr").