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.
For an example, see orderlabels.4rp in the Reports demo application provided with Genero Studio.
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. Labels example