[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Printer lists and reports
 ----------------------------------------------------------------------------

 Building a list in Windows is just a little more sophisticated task
 than in DOS, mainly because we are working in a graphical environment.
 This means that we may want to mix graphics and text and also that
 the text may use different kinds of fonts. This creates a new kind
 of sophistication.

 We are working on the idea of making lists as easy as doing
 SET DEVICE TO..., but in this first release it is not completely
 ready (but as you will see in a moment is extremely easy):

 We have created a Printer Object, which automatically controls all the
 printing processes. To create it we do:

 PRINT <ObjectName> [ NAME <ReportName> ]

 and finish with it:

 ENDPRINT


 <ObjectName> is the Object that automatically gets created. The NAME
 clause is the name Windows will show in the Windows standard printing
 spooler.

 Now, to start printing a page you do:

 PAGE

 and to end:

 ENDPAGE

 As soon as you create the Printer Object the standard Windows Dialog
 Box will appear letting you select the different implementations.
 You may use as many fonts as you wish, to do it you have to create some
 FONT objects:

 DEFINE FONT fntArial NAME "Arial" SIZE 40, 20
 ...

 After printing you have to destroy them:

 RELEASE FONT fntArial



 Here you have a complete example:

 function MakesList( oLbx )      // oLbx is a TWBrowse which we want to
                                // repaint after listing...

    local oPrn, fntArial
    local nRow := 1, nRec := Recno()

    GO TOP

    DEFINE FONT fntArial NAME "Arial" SIZE 40, 60

    PRINT oPrn NAME "Clients"                // Name the List Box Generated

       PAGE
          while ! EoF()
             oPrn:Say( nRow, 1, Clients->Name, fntArial )

             nRow += fntArial:nHeight
             //jhs get translated
             if nRow > 50 * fntArial:nHeight  // N. of lines x Character height
                nRow = 1                      // We have to calculate
                ENDPAGE                       // the number of lines we may
                PAGE                          // use with a certain font
             endif

             SKIP
          end
       ENDPAGE

    ENDPRINT

    GOTO nRec

    RELEASE FONT fntArial

 return

See Also: TPrinter Commands Print.ch
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson