Print a report

Set up and configure output to a printer from your reporting application. The report is printed silently, without prompting the user.

  • Send output directly to the printer - you can send the output to a printer without previewing by calling the fgl_report_selectDevice function as part of your report configuration function with the parameter "Printer":
    CALL fgl_report_selectDevice("Printer")
    Note: For other output formats, the parameter can be one of: "Printer", "PDF", "Image", "SVG", "HTML", "XLS" or "XLSX" (output to an Excel™ spreadsheet), "RTF" (output in Microsoft™ RTF format)
  • Set page margins - the logical margins of the report page are read from the 4rp file (Report Design document.) The fgl_report_setPageMargins function overrides those margins. The syntax is:

    CALL fgl_report_setPageMargins (
    topMargin String, 
    bottomMargin String,
    leftMargin String, 
    rightMargin String
    )

    For example:

    CALL fgl_report_setPageMargins(
        ".05cm",#  topMargin String,
        ".05cm",#  bottomMargin String,
        ".05cm",#  leftMargin String,
        ".05cm" #  rightMargin String
    )
  • Set Print Quality - the fgl_report_setPrinterQuality function is used to control the quality used by the printer. By default this is not set. Setting this option reduces the set of usable printers to those matching it.
    One of these values are passed to the function as a parameter: draft|high|normal. The value is passed as a String, for example:
    CALL fgl_report_setPrinterPrintQuality("high")
  • Print Double-sided - the function fgl_report_setPrinterSides is used to specify whether the report pages should be one-sided or two-sided. By default this is not set. Setting this option reduces the set of usable printers to those matching it.

    One of these values are passed to the function as a parameter. The value is passed as a String:

    • one-sided: Each consecutive print-stream page is printed on the same side of consecutive media sheets.
    • two-sided-short-edge: Consecutive pairs of print stream pages are printed on the front and back sides of consecutive media sheets. The orientation of the pages is correct as if the pages were to be bound along the short edge of the paper.
    • two-sided-long-edge: Consecutive pairs of print stream pages are printed on the front and back sides of consecutive media sheets. The orientation of the pages is correct as if the pages were to be bound along the long edge of the paper.
    CALL fgl_report_setPrinterSides("two-sided-long-edge")
  • Select a Paper Tray - function fgl_report_setPrinterMediaTray controls what tray of the printer to use. This function and the functions fgl_report_setPrintermediaTray and fgl_report_setPrintermediaName are mutually exclusive. Setting this option reduces the set of usable printers to those matching it.

    One of these values are passed to the function as a parameter: bottom|envelope|large-capacity|main|manual|middle|side|top. The value is passed as a String.

    CALL  fgl_report_setPrinterMediaTray("top")