XFRX version 9.5

 Release date: 04/01/2004 

If you are not planning to export reports as pictures, you can download a special version of XFRXLIB.FLL (http://www.eqeus.com/files/xfrxlib-nogdiplus.zip), which doesn't require the two dlls mentioned above.

Bug fixes

  • The problem with bookmark text cutting in encrypted PDF documents has been fixed.
  • Problem with multiline labels not displayed correctly in the previewer has been fixed (beta regression).
  • The z-order of rectangles stretching multiple bands has been fixed.
  • Problem with 'print-when' expression not evaluated in certain scenarios has been fixed.
  • Pictures are now correctly displayed in Word and Excel documents if temporary path parameter is not empty.
  • Pictures from general fields are now correctly displayed in RTF documents.
  • Problem with blank reports in VFP5 was fixed.
  • The problem with alignment on manually generated reports was fixed.
  • The stability of the XFRX previewer has been improved.

New features

  • BMP, PNG, JPEG, GIF and TIFF output formats were added.
  • The report previewer can be localized. Currently available localizations are: French, Czech and you can also add new  localizations yourself.

Exporting reports as pictures

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 XFFWriter class is called to generate the picture
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.
SavePicture method saves the report page(s) as a picture.

Syntax:
XFRXWriter::SavePicture(tcFilename, tcType, tnFrom [, tnTo [, tnBpp [, tnJPEGQuality [, tnThumbnailWidth [, tnThumbnailHeight] ] ] ] ])

Parameters:

tcFilename
 
The name of the file to be generated.

tcType
 
The format of the picture to be saved. Currently supported options are: BMP, GIF, JPEG, PNG, TIFF.

tnFrom
  
The page number to be saved. If TIFF format is being saved, the parameter specifies the first page to be saved.
 
tnTo
 
If TIFF format is being saved, the parameter specifies the last page to be saved. Ignored otherwise.

tnBpp
 
Bits per pixel. Currently supported values are 16 or 24.

tnJPEGQuality
 
Specifies the JPEG compression quality. The range is from 1 - the lowest quality to 100 - the best quality. The default value is 0 - default quality. Ignored for other output types.

tnThumbnailWidth
 
The width of the output picture in pixels.

tnThumbnailHeight 
  The height of the output picture in pixels.

If both tnThumbnailWidth and tnThumbnailHeight are omitted, the original page size is used. If only one of the values is sent, the other one is calculated accordingly.

Return values

 0 ... no errors was encountered
-1 ... unknown image format
-2 ... page out of range


If this sounds complicated, please have a look at the example, it is actually quite simple:

	loSession=EVALUATE([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 XFFWriter object reference,
		* which will used to save the pictures
		*
		loXFF = loSession.finalize()
		LOCAL lnI, lnJpegQuality
		lnJpegQuality = 80
		*
		* loXFF.pagecount contains the number of pages if 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				
				

XFRX report previewer localization

Each localization is stored in two files:
  • XFRXLIB_<localization_code>.dbf - strings translation
  • XFRXLIB_<localization_code>.vcx - find and page selection dialogs localization
To create a new localization, please follow these steps:
  1. Choose a code for your localization (e.g. DE for German)
  2. Create a copy of default localization DFB (localization\default\XFRXLIB_XXX.DBF (+CDX, +FPT)). Change the suffix according to your localization code. The default localization DBF contains English strings that need to be translated.
  3. Create XFRXLIB_<localization_code>.vcx visual class library using localization\default\locClass.prg. Send the localization code as a parameter.
    Example: Copy locClass to the XFRXLIB directory and call: do locClass with "DE"

    which will create the XFRXLIB_DE class library.

    Translate the two dialog classes in the class library.
  4. Copy the localization files to XFRXLIB directory.
To activate the localization in your code, call setLanguage method of XFCont class. Send the localization code as a parameter.

Example: this.cntXFRX.setLanguage("DE")