Skip to content

FOP (Formatted Object Processor) Tool controller

This is a specific DownloadFile Tool controller that builds a PDF or RTF file using the data actually visible in the Panel based controller, and send it to the client browser.

Prerequisites:

Add Kitto.Tool.FOP to UseKitto.pas.

The FOP Tool uses FOP Engine provided by Apache FOP Project that must be present in a Folder of the Application Server. The Path of the FOP Engine must be configured into Config.Yaml:

yaml
FOPEnginePath: C:\FOP\FOPEngine1.1

It's mandatory to specify TransformFileName, the xsl file used for the FO transformation. The ClientFileName extension determines the type of the output: PDF or RTF.

Here's an example:

yaml
# Export a text file with fixed column length.
ToolViews:
  FOPReport:
    DisplayLabel: Activity by FOP
      Controller: FOPTool
        ClientFileName: ActivityByFOP.pdf
        TransformFileName: %APP_PATH%ReportTemplates\ActivityReport.xsl
        RequireSelection: False

Released under Apache License, Version 2.0.