XFRX is able to export individual report pages as BMP, PNG, GIF, JPEG (JPG) and EMF pictures, multiple pages can be exported to TIFF (TIF) image format.
The picture generation process is divided into two steps:
- the report is generate as XFF cursor
- savePicture method of the XFRX#DRAW class is called to generate the picture (Please see XFRX#DRAW class reference for details and a complete list of parameters)
The advantage of this approach is that once the XFF file is generated, it is very easy to get the page count, generate individual pictures in a cycle, etc.
If this sounds complicated, please have a look at the example, it is actually quite simple:
LOCAL m.loSession, m.lnRetVal
* nothing is sent as the file name, so only a memory cursor is created
IF m.lnRetVal = 0
local m.loXFF, m.lnI, m.lnJpegQuality
* the finalize method returns a XFRX#DRAW object reference,
* which will be used to save the pictures
m.loXFF = loSession.finalize()
m.lnJpegQuality = 80
* loXFF.pagecount contains the number of pages of the
* report that
* was just generated
* we are now going to save all pages one by one as
* separate jpeg pictures
FOR m.lnI = 1 TO m.loXFF.pagecount
You can generate the following picture formats: TIFF (TIF), BMP, GIF, JPEG (JPG), PNG, EMF. The TIFF supports multiple pages so the whole report gets converted to a single file. For other output formats one file per page is created - the file name is taken from the tcFilename parameter with _%PAGENO%.
The following table shows the mapping between extended parameters and the parameters of the SavePicture() method.
|FINDSTRING ||laFindString |
|TRANSPARENT (boolean)||liBacgroundMode (number)|