XFRX versions 12.5 + 12.4

Version 12.5 released on: 31 January 2008
Version 12.4 released on: 14 November 2007

New features / Updates

  • VFP 9.0 SP2 features are now supported

    This version supports both VFP 9.0 SP2 and VFP 9.0 pre-SP2 environments. In SP2 it supports the new dynamics and rotation features.

  • GDI+ compatible word wrapping algorithm

    The new version comes with an alternate GDI+ wordwrapping algorithm. Since the introduction of VFP 9.0 we are experiencing layout compatibility issues between the old reporting engine (pre-VFP 9.0) and the new reporting engine (VFP 9.0). [Please see Guide to Reporting Improvements VFP 9.0 help topic for more information.]

    With XFRX we are experiencing a similar problem - while the pre-VFP 9.0 report engine inside XFRX is using GDI for wordwrapping and layout calculation, the VFP 9.0 report that is used in XFRX for VFP 9.0 is using GDI+. Moreover, XFRX is using GDI+ for printing, output to pictures and previewing. The main difference between using GDI and GDI+ is text width. Each text element is slightly wider with GDI+, which can result in element content being cut, earlier wrapping longer stretched fields. Here is a summary:

    XFRX ver. 12.3 and earlier
        VFP 9.0   VFP 8.0 and earlier
    Output to PDF and other output formatsGDIGDI
    Report engineGDI+GDI
    Report previewerGDI+GDI+
    Printing out of XFRXGDI+GDI+

    Although converting everything to GDI+ would ease the complexity, it would bring another problem - "old" reports might need to be modified. So, instead, the latest XFRX version now contains both GDI and GDI+ wordwrapping algorithms and you can choose which one is going to be used. By default GDI+ is used in VFP 9.0 in the listener mode and GDI is used in VFP 8.0 earlier. There is probably no reason to switch to GDI in VFP 9.0 but it might sometimes be useful to switch to GDI+ as printing and previewing is still in GDI+:

    XFRX ver. 12.4 with wordwrapping set to GDI+
        VFP 9.0   VFP 8.0 and earlier
    Output to PDF and other output formatsGDI+GDI+
    Report engineGDI+GDI+
    Report previewerGDI+GDI+
    Printing out of XFRXGDI+GDI+
    XFRX ver. 12.4 with wordwrapping set to GDI
        VFP 9.0   VFP 8.0 and earlier
    Output to PDF and other output formatsGDIGDI
    Report engineGDI+GDI
    Report previewerGDI+GDI+
    Printing out of XFRXGDI+GDI+

    To set the wordwrapping algorithm manually then, before running your reports, create a public or private variable _xfrx_WordWrapAlgorithm and set it to 1 for GDI mode and 2 for GDI+ mode.

  • E-mail support in the XFRX previewer

    An email icon has been added to the XFRX previewer toolbar. It is disabled by default for backward compatibility and can be enabled by setting the iEmail property of the previewer class [xfCont, cntXFRXMultiPage or frmMPPreviewer] to 1. If you click the email icon, it runs the Email method of the xfCont class. By default it displays a simple dialog box asking for email address, subject, body, etc. and uses VFPWinsock library to send the email.

    Note: VFPWinsock is a free SMTP sendmail library written by a VFP MVP Francis Faure. It is not distributed together with XFRX and it can be downloaded from http://www.xfrx.net/vfpWinsock/index_e.asp. It is a nice little package written in VFP distributed as a single .prg.
    The default behavior can be intercepted or overridden by an extension handler [Please find more information about extension handlers in the Developer's Guide here:] - and, as the default dialog does not ask for all information VFPWinsock needs (eg. it does not ask for SMTP host) you actually need to create an extension handler to make it work in your environment. There are two events that extension handler can implement:
    • Email - the event is fired when the icon is clicked, before the dialog is displayed. XFF file reference is sent as the 1st parameter. Returning .F. will suppress the default behavior.
    • EmailOptions - this event is fired after the dialog is displayed and user clicked "Send". XFF file reference and options object is sent as a parameter. Returning .F. will suppress the email to be sent

      The parameter object has the following properties:

      • cTo
      • cCC
      • cBCC
      • cSubject
      • cAttachmentName
      • cBody

    Following are sample of the two most common scenarios:

    • Suppress the default behavior and handle the email event on your own

       

      
      
      loPreview = CREATEOBJECT("frmMPPreviewer")
      loPreview.iEmail = 1 && show the email icon
      loPreview.oExtensionHandler = CREATEOBJECT("SampleExtensionHandler")
      loPreview.PreviewXFF(loXFF) && preview the document 
      loPreview.show(1)
      
      DEFINE CLASS SampleExtensionHandler as Custom
      
         PROCEDURE Email
            LPARAMETERS  loXFF
            LOCAL loSession, lcFileName
            loSession=EVALUATE([xfrx("XFRX#INIT")])
            lcFileName = Addbs(Sys(2023))+"test.pdf" && temporary file name
            IF loSession.SetParams(lcFileName,,.T.,,,,"PDF") = 0 && the 3rd parameter says we do not want to preview the PDF
               loSession.TransformReport(loXFF)
      	
               LOCAL sm
               Set Procedure To vfpwinsock ADDITIVE 
               sm = Createobject("vfp_winsock_send_mail")
               sm.smtp_host = "your.smtp.server.here" &&&<<<<<<<<<<<<<<<<<<<< put your smtp server here
               sm.From = "eqeus@eqeus.com" 
               sm.To = "eqeus@eqeus.com"
               sm.subject = "Email test"
               sm.silence = .T.
               sm.attaCHMENT = lcFileName
               IF !sm.Send()
                  MESSAGEBOX(sm.erreur,16,"xfrx test")     
               ELSE
                  MESSAGEBOX("Message was sent",0,"xfrx test")
                  ERASE (lcFileName)
               ENDIF
            ENDIF
      
            RETURN .F.
         ENDPROC
      
      ENDDEFINE


    • Use the default dialog box, use an extension handler to supply mail server parameters and let XFRX send the email

       

      
      
      DEFINE CLASS SampleExtensionHandler as Custom
      
         PROCEDURE EmailOptions
            LPARAMETERS  loXFF, loOptions
            loOptions.cSMTP_HOST = "mail.your_domain.com"
            loOptions.cFrom = "eqeus@eqeus.com"
         ENDPROC
      
      ENDDEFINE

Bugs fixed

  • Landscape printing has been improved, both clockwise and anti-clickwise rotation is now supported
  • Landscape reports printing as portrait in Word has been fixed
  • The 10000 lines limit in XLS output has been removed
  • Picture shift problem in XLS has been fixed