Support for custom paper sources

On Windows™ systems the reporting API function fgl_report_setSVGPaperSource() can be used to identify a custom paper source for your report. This function must be used in conjunction with these functions:

See Example code.

The printerinfo Script

On Windows systems the script <GRE-install-dir>/bin/printerinfo is provided to list the supported paper sources that can be changed programmatically using this function. This script is executed from the command line.

The output of the script lists the device-specific source names in the left column, with the general constant in brackets on the right. Either can be used to identify the paper source in calls to fgl_report_setSVGPaperSource():

This excerpt lists seven paper sources for the printer Balzac:


This figure is a screenshot of printerinfo output for the printer Balzac.

Figure 1. printerinfo output

Example Code

CALL fgl_report_setSVGPrinterName("Balzac")
CALL fgl_report_setSVGPaperSource("Tray 2")
CALL fgl_report_configureSVGPreview("PrintOnNamedPrinter")

This excerpt of the printerinfo output is for a printer that has 27 paper sources. Since there are only 15 predefined constants for the paper sources, most of the paper sources are identified by integer constants, which can be used in calls to fgl_report_setSVGPaperSource(.) Using the integer constant can prevent encoding issues when the device-specific name contains non-ASCII characters, such as "Sèlection automatique".


This figure is a screenshot of printerinfo output for the printer HPCLJ4650DTN.

Figure 2. printerinfo output