Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

XFRX is able to export individual report pages as BMP, PNG, GIF and JPEG pictures, multiple pages can be exported to TIFF image format.

The picture generation process is divided into two steps:

  1. the report is generate as XFF cursor
  2. 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:

loSession= xfrx("XFRX#INIT")
        *
        * nothing is sent as the file name, so only a memory cursor is created
        *
        lnRetVal =loSession.SetParams(,,,,,,"XFF")                           
        If lnRetVal = 0
               loSession.ProcessReport("invoices")                   
               local loXFF
               *
               * the finalize method returns a XFRX#DRAW object reference,
               * which will be used to save the pictures
               *
               loXFF = loSession.finalize()
               LOCAL lnI, lnJpegQuality
               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 lnI = 1 TO loXFF.pagecount
                       loXFF.savePicture("page"+ALLTRIM(STR(lnI))+".jpg", ;
                                      "jpg",lnI,lnI,24,lnJpegQuality)
               ENDFOR
               MESSAGEBOX("Pictures saved.")
        Endif 
  • No labels