Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

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

The picture generation process is divided into two steps:

...

Code Block
languagevb
linenumberstrue
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 

...

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%.

...

SetOtherParams()SavePicture()
FROMtnFrom
TOtnTo
BPPtnBpp
JPEGQUALITYtnJPEGQuality
THUMBNAILWIDTHtnThumbnailWidth
THUMBNAILHEIGHTtnThumbnailHeight
PAGESPERSHEETtnPagesPerSheet
ALLEVENODDtnAllEvenOdd
TRANSPARENT (boolean)liBacgroundMode (number)