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:

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

...

Code Block
languagevb
linenumberstrue
LOCAL m.loSession, m.lnRetVal
m.loSession= xfrx("XFRX#INIT")
        *

       * nothing is sent as the file name, so only a memory cursor is created
       
*
        m.lnRetVal =m.loSession.SetParams(,,,,,,"XFF")                           
        If IF m.lnRetVal = 0
               m.loSession.ProcessReport("invoices")                          
        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()
               LOCAL lnI, lnJpegQuality
               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
                       m.loXFF.savePicture("page"+ALLTRIM(STR(m.lnI))+".jpg", ;
          
                           "jpg",m.lnI,m.lnI,24,m.lnJpegQuality)
         
     ENDFOR
               =MESSAGEBOX("Pictures saved.")
        Endif 

 

...

ENDIF


You can generate the following picture formats: TIFF (TIF), BMP, GIF, JPEG (JPG), PNG, EMF. For TIFF output XFRX generate The TIFF supports multiple pages so the whole report gets converted to a single file. For other outputs generate output formats one file per page is created - the file name will be short filename from parameter tcFilename is taken from the tcFilename parameter with _%PAGENO%.

Mapping The following table shows the mapping between extended parameters and the parameters of the SavePicture()'s parameters method.

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