Genero BDL and the Report Writer / BDL programs |
A common use of reports is to create a page of labels, such as address labels. Creating labels requires you to create a report design document representing a single label and a report application that prints multiple labels on a page.
The report design document (.4rp) contains the design for a single label. You can put anything you wish on the label, as long as it fits onto the page.
See Design labels for details on creating the single-label report design document (.4rp).
This example uses the OrderLabels.4rp report design document from the Reports GRW demo.
In the SimpleReport BDL program, the MAIN program block that configures the report engine is changed as follows:
-- configure report engine; the functions prefixed fgl that are called here -- are part of the Reporting API IF fgl_report_loadCurrentSettings("OrderLabels.4rp") THEN -- load the labels -- design document (4rp file) -- special settings for labels CALL fgl_report_selectLogicalPageMapping("labels") CALL fgl_report_setPaperMargins("5mm","5mm","4mm","4mm") CALL fgl_report_configureLabelOutput("a4width","a4length",null,null,2,6) END IF LET handler = fgl_report_commitCurrentSettings() -- commit changes
The rest of the SimpleReport program would remain unchanged. This example would print two labels across and six labels down per page.
Figure 1. Output of labels on a physical page