XFRX version 9.6

Release date: 05/24/2004

Bug fixes

  • Fixes in XLS output format:
    • Excel version check has been added
    • Texts that could have been evaluated as numeric expressions (e.g. 10-2, 45/3) were incorrectly transformed as numerics in Excel output
    • Numeric expressions with formats can now be converted to formatted numeric cells  
    • Page size, orientation and page margins are now correctly transformed to the generated documents
  • chr(10) should work the same way as chr(13) or chr(13)+chr(10). Chr(10) was ignored by XFRX.
  • Rectangles stretching from page header to page footer were too high if report title was used
  • 'opaque' ractangles with white back color should be printed as transparent. (this worked incorrectly in output to images)
  • resizing the bookmark panel in the previewer generated an error is there were no bookmarks
  • White lines were incorrectly printed as black in RTF output
  • Tabs are now supported in PDF
  • Problems with rotated underlined text in PDF have been fixed

New features

Note: If you are interested in making your reports accessible via the internet, you can have a look at a web based report previewer demo application utilizing XFRX compiled as VFP COM DLL. (Run demo).

Zipping the generated file

The generated file can now be automatically zipped. We have added new parameters to Setparams method:
SetParams method

Syntax:
XFRXSession::Setparams(tcOutputName, tcDirectory, tlNotOpenWiewer, tcCodePage, tlSilent, tlNewSession, tcTarget, tcArchive, tlAdditive, tlDeleteFileAfter)

New parameters:

tcArchive
  The name of the zip archive to be created. If not empty, the generated file will be added to the archive after generation (optional)

tlAdditive
  If set to .T. and the archive already exists, the file will be added. (optional)
Please note: you can add several files to the archive, but existing files with the same name will not be overwritten - the new files will always be added.

tlDeleteFileAfter
  If set to .T., the generated file is be deleted after it is copied to the archive. (optional)

Example:

With these SetParams parameters, XFRX first creates "invoices.pdf", then creates "archive.zip" (if it doesn't exist) and adds "invoices.pdf" into the archive. Then "invoices.pdf" will be deleted:

lnRetVal = loSession.SetParams("invoices.pdf",,.T.,,,,"PDF","archive.zip", .t., .t.)

Optional band printing

You can prevent individual report bands from printing by calling skipBands() methods of the XFRXSession object. A parameter of this method is a string containing a comma delimited list of bands that will be skipped. The bands are represented by codes as stated in the following table:


BandCode
TitleT
Page headerH
Column headerCH
Group n headerGHn
DetailD
Group n footerGFn
Column footerCF
Page footerF
SummaryS

Example:
loSession.skipBands("H,GH1,GF3,S")

Numeric field picture format in Excel

The format definition of numeric cells in Excel is different from the format syntax used in Foxpro. XFRX is now able to convert the simple format definitions and allows for user-defined implicit and/or explicit Excel-type format definitions.
In Visual Foxpro, the numeric field is converted to its text representation based on an explicit format definition (format field in the report expression definition) or field's decimal places and SET DECIMAL setting.
When a numeric field is transformed to an Excel cell, the following algorithm is used:
  1. If there is an explicit XLS format defined, use it.
    To define an explicit XLS format for a numeric field, add:

    #UR XLSF= (expression)

    to the field's comment.

    Example:
    #UR XLSF="General"

    The "General" formatting - no special formatting, the number of decimal places is determined by the field's value
    #UR XLSF="Standard"
    The "Standard" formatting - two decimal places, thousand and decimal separators will be used according to the Excel defaults
    #UR XLSF="#0.00"
    Two decimal places, no leading zeros
    #UR XLSF="#0.00;[red]#0.00"
    Two decimal places, display negative numbers in red
  2. If the field contains a format definition, try to look up the format in a conversion table. A conversion table can be populated programatically when XFRX is executed so that the formats that are often used and cannot by converted automatically by XFRX would not require an explicit definition in each field in the report.
    To add an entry to the conversion table, use addXLSFormatConversion method of XFRXSession class.

    Example:
    loSession.addXLSFormatConversion("@L 999999.99","000000.00")

  3. If the field contains a format definition and it is not listed in the conversion table, try to convert it. XFRX is able to convert simple format definitions containing the following characters: '9', '#', ',', '.' and ' '. For example, 999,999.99 is converted to ###,###.00.
  4. If the format cannot be converted, use the implicit XLS numeric format, if available.
    To define the implicit XLS numeric format, call setDefaultXLSFormat method of the XFRXSession object with the implicit format as a parameter.

    Example:
    loSession.setDefaultXLSFormat("General")

  5. If the implicit XLS numeric format is not defined, XFRX creates a format definition to display the same number of decimals as in VFP report output.
If you want to specify that a certain numeric field should be converted as a text cell in the excel sheet, define "TEXT" as its explicit XLS numeric format:

#UR XLSF='TEXT'

For a live example of formatting the Excel cells, please have a look at the "XLS formatted numeric cells sample" report in the demo application.