Output as Image (Swift)

Set up and configure output to an image file from your reporting application. This option is useful for archiving.

To output your report as an image file, specify Image in the selectDevice() function.

In the OrderReportSwift.swift file, which you can find in the OrderReportSwift demo project, the output specifies PDF. In this example, the demo is modified to output as an image:
// Configure the report execution to output an image file.
let rcPtr = createRuntimeConfiguration(reportDesignFileName)        
setOutputFileName(rcPtr, outputFilename)
selectDevice (rcPtr, Image)
configureImageDevice (rcPtr,BOOLEAN_NULL,BOOLEAN_NULL,BOOLEAN_NULL,
  INT_NULL,INT_NULL,"jpg","/Users/myName/Dir","imagetest",INT_NULL)
configureDistributedProcessing(rcPtr, "127.0.0.1", 7000)
Things to observe:
  • The second parameter for selectDevice() is set to Image.
  • The configureImageDevice() function sets the output type, location for the image files, and the filename prefix. All other parameter values are set to NULL, which specifies that the default values are to be used.

Device-specific configuration functions

Once you have specified Image as the output, there are device-specific configuration functions available:
  • configureImageDevice()
  • setImageUsePageNamesAsFileNames()
  • setImageShrinkImagesToPageContent()

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.