Output as Excel (Swift)

Set up and configure output to Excelâ„¢ format from your reporting application. This option is useful if you want to perform custom calculations in an application such as Numbers.

Note:

Excel reports, as output from Genero Report Writer, do not print at high quality. If you require high-fidelity printing, use one of the other output options, such as SVG.

To output your report as an Excel spreadsheet file, specify XLS or XLSX in the selectDevice() function.
let rcPtr = createRuntimeConfiguration(reportDesignFileName)
selectDevice (rcPtr, XLS)
let rcPtr = createRuntimeConfiguration(reportDesignFileName)
selectDevice (rcPtr, XLSX)
The report file will be written to the current working directory, unless you specify another location through the use of environment variables or by using the C API within your Swift application.
Tip:

If you are experimenting with the provided Swift demo, ensure you change the file extension from the hard-coded "pdf" to the appropriate Excel extension type (.xls or .xlsx). On Mac® OS, NSWorkspace.shared().open() opens the document with the application defined by the system file association.

Device-specific configuration functions

Once you have specified XLS as the output, there are device-specific configuration functions available:
  • configureXLSDevice()
  • setXLSMergeCells()
Once you have specified XLSX as the output, there are device-specific configuration functions available:
  • configureXLSXDevice()
  • setXLSXMergeCells()

These functions should be included after calling the selectDevice() function but before calling the createContentHandler() function.

For the full list of available functions, refer to the Genero Report Writer C API documentation.