| Search Locate Previous Next | Contents |
NewLeaf is shipped with a simple print-preview tool, which you can use to browse long reports, zoom in on details, and print selected pages. There are two ways of using this, suitable for short reports (less than 10 pages) or volume output.
Small reports
The simple way to handle low volume output is to have NewLeaf return the entire completed report to the workspace as a simple vector:
leaf.Use mylayout © Start leaf.Place .... leaf.table.Spread ... rpt1leaf.Close © retrieve entire report PostScrp.View rpt1 © Preview it PostScrp.Print rpt1 © Print it to default printer
The preview tool allows you to page up and down, and you will find that the <Home> and <End> keys go to the beginning and end of the report. To zoom in, drag a rubber-band rectangle enclosing the area to be magnified. Click anywhere to zoom out, or use the right-mouse menu.
High-volume output
The above method is not suitable for reports of more than 20 or so pages, as the data volume can get quite large and the algorithm for selecting pages can easily give WS FULL. It is much better to leave the report on the external spool file (which NewLeaf builds as it goes) and browse it from there. Because the spool file holds one page per component, there is no workspace overhead in selecting (say) page 567 from a 5000 page report!
leaf.Use rpt2 leaf.table.ColTitles 'Jan' 'Feb' ... leaf.table.List ?12345 12½100 fnleaf.Spool '' © Close file but leave on disk PostScrp.View fn © Preview as before PostScrp.Print fn © Print entire report
By default, the spool file is called newleaf.spl. Alternatively you can use the right argument to name this file and thus save several reports on disk at the same time.
To jump straight to a specific page, or run the print from a page to the end:
leaf.NumPages 'newleaf.spl' © How many pages are there? 567 PostScrp.View 'newleaf.spl' © go in at page 567 23 45 PostScrp.RunOff 'newleaf.spl' © run pages 23,45 only
You can safely delete the spool file as soon as you have finished with it.