Release date: 01 August 2008
SET CLASSLIB TO (HOME()+"ffc\_reportlistener")
SET PROCEDURE TO utilityReportListener.prg ADDITIVE
Example:
use demoreps\sales local loSession, lnRetval, loXFF, loPreview, loScripts loSession=EVALUATE([xfrx("XFRX#LISTENER")]) lnRetVal = loSession.SetParams(,,,,,,"XFF") && no name = just in memory If lnRetVal = 0 REPORT FORM demoreps\sales object loSession * * the XFRX#DRAW object reference is stored in oxfDocument property * loXFF = loSession.oxfDocument * * initialize the previewer * SET PATH TO xfrxlib SET CLASSLIB TO xfrxlib ADDITIVE loPreview = CREATEOBJECT("frmMPPreviewer") * * setup the extension handler * loPreview.oExtensionHandler = CREATEOBJECT("SampleExtensionHandler") loPreview.windowtype = 1 loPreview.iTool = 2 && embedded toolbar * loPreview.iTool = 1 && standard toolbar loPreview.PreviewXFF(loXFF) loPreview.show(1) ENDIF DEFINE CLASS SampleExtensionHandler as Custom oPreviewContainer = null PROCEDURE ToolbarOnInit LPARAMETERS toToolbar LOCAL button IF toToolbar.AddObject("mybutton", "commandbutton") BINDEVENT(toToolbar.mybutton, "click" , this, "ButtonClicked") toToolbar.mybutton.tabindex = 1 toToolbar.mybutton.Visible = .t. IF UPPER(totoolbar.BaseClass)!="TOOLBAR" toToolbar.mybutton.left = toToolbar.cmdQuit.left toToolbar.cmdQuit.left = toToolbar.mybutton.left + toToolbar.mybutton.width ENDIF endif PROCEDURE ButtonClicked LOCAL lcString lcString = "this.oPreviewContainer.Name: "+this.oPreviewContainer.Name+CHR(13) lcString = lcString + "current page: "+TRANSFORM(this.oPreviewContainer.nPageNo)+CHR(13) lcString = lcString + "XFRX#DRAW Object: "+this.oPreviewContainer.oXFRXWriter.Name+CHR(13) lcString = lcString + "Page count: "+TRANSFORM(this.oPreviewContainer.oXFRXWriter.PageCount)+CHR(13) WAIT WINDOW lcString * * this.oPreviewContainer.oXFRXWriter.PrintDocument(...) * this.oPreviewContainer.oXFRXWriter.SavePicture(...) ENDDEFINE
Version 12.5 released on: 31 January 2008
Version 12.4 released on: 14 November 2007
SET CLASSLIB TO (HOME()+"ffc\_reportlistener")
SET PROCEDURE TO utilityReportListener.prg ADDITIVE
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.
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 formats | GDI | GDI |
Report engine | GDI+ | GDI |
Report previewer | GDI+ | GDI+ |
Printing out of XFRX | GDI+ | 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 formats | GDI+ | GDI+ |
Report engine | GDI+ | GDI+ |
Report previewer | GDI+ | GDI+ |
Printing out of XFRX | GDI+ | GDI+ |
XFRX ver. 12.4 with wordwrapping set to GDI | ||
VFP 9.0 | VFP 8.0 and earlier | |
Output to PDF and other output formats | GDI | GDI |
Report engine | GDI+ | GDI |
Report previewer | GDI+ | GDI+ |
Printing out of XFRX | GDI+ | 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.
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.
The parameter object has the following properties:
Following are sample of the two most common scenarios:
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
DEFINE CLASS SampleExtensionHandler as Custom PROCEDURE EmailOptions LPARAMETERS loXFF, loOptions loOptions.cSMTP_HOST = "mail.your_domain.com" loOptions.cFrom = "eqeus@eqeus.com" ENDPROC ENDDEFINE
Release date: 27 August 2007
To be able to preview the XPS document, you need an XPS document viewer. If you are running Windows Vista you already have one as it is included with .NET Framework 3.0. For Windows XP and Windows Server 2003 you can download the viewer from http://www.microsoft.com/whdc/xps/viewxps.mspx.
Release date: 5 December 2006
USE invoices ORDER customer LOCAL loSession, lnRetval, loXFF, loPreview, loScripts loSession=EVALUATE([xfrx("XFRX#LISTENER")]) lnRetVal = loSession.SetParams("",,,,,,"XFF") && no name = just in memory If lnRetVal = 0 REPORT FORM invoices OBJECT loSession loXFF = loSession.oxfDocument * * initialize the previewer * SET CLASSLIB TO xfrxlib ADDITIVE loPreview = CREATEOBJECT("frmMPPreviewer") loPreview.setExtensionHandler(CREATEOBJECT("MyExtensionHandler")) loPreview.windowType = 0 loPreview.iBook = 0 loPreview.PreviewXFF(loXFF) loPreview.show(1) ENDIF DEFINE CLASS MyExtensionHandler AS Custom PROCEDURE Export LPARAMETERS toXFF IF USED("_xfExportTypes") USE IN _xfExportTypes ENDIF * * define my export options list * CREATE CURSOR _xfExportTypes (name C(50), extension C(4), targetCode C(10)) INSERT INTO _xfExportTypes VALUES ("HTML", "html", "HTML") INSERT INTO _xfExportTypes VALUES ("PDF", "pdf", "PDF") INSERT INTO _xfExportTypes VALUES ("Excel", "xls", "XLS") ENDPROC PROCEDURE ExportOptions LPARAMETERS toXFF, toOptions IF toOptions.cTarget = "XLS" * * my own code to handle output to Excel * =MESSAGEBOX("exporting to "+toOptions.cOutputFile) RETURN .F. && suppress the default behavior eLSE RETURN .T. && continue with the default behavior ENDIF ENDPROC ENDDEFINE
Release date: 5 September 2006
Release date: 17 August 2006
Installation notes:
Since 12.0, the Writer and Calc outputs
are supported, both of which can be generated either using the absolute or
flow layout format (please see chapter "Flow layout document option" in the
Developer's guide for more information about the flow
layout options).
To generate the OpenOffice document, use the following codes as the 7th parameter (targetType) of the SetParams method:
Document type |
targetType |
OpenOffice Writer document with absolute layout |
ODT |
OpenOffice Writer document with flow layout |
FODT |
OpenOffice Calc spreadsheet with absolute layout |
ODS |
OpenOffice Calc spreadsheet with
flow layout
|
FODS
|
Example:
loXFF.SavePicture("output.bmp","BMP",1,1,24,,"DPI",300) && saves the picture as 300 DPI loXFF.SavePicture("output.bmp","BMP",1,1,24,,"ZOOM",150) && zoom to 150%
Release date: 14 March 2006
XFRX now
recognizes two types of hyperlinks:
This “custom
event” hyperlink feature can be used to invoke application specific actions
(information forms, custom processes, etc.) or for implementing drill-down functionality – invoking detailed
report where the field user clicked on is taken as a parameter for the
report (for example, clicking a customer name in the report listing all
customers can run a report with detail information about this specific
customer). The new report can be directed to a new page of a multipage
previewer, which could provide a comfortable environment for “drilling down”
specific information – with the ability to go back to the original report
without closing the current one, side by side report comparison, exporting /
printing selected reports, etc.
Please find more information about this feature as well
as a step-by-step example in the Developer's guide, "Implementing custom event hyperlinks (drilldown) in
XFRX previewer" chapter.
Evaluation package note: The Prevdemo directory with the XFRX previewer implementation sample has been removed as the same functionality is now supported by the "native" class frmMPPreviewer of XFRXLib.vcx.
Release date: 6 December 2005
OpenOffice Writer document format is now
supported.
OpenOffice is using the OASIS Open Document Format for Office Applications,
which is also supported by a variety of other office applications including
StarOffice, KOffice, and IBM Workplace. XFRX generates the file format
natively, so OpenOffice doesn’t have to be installed on the computer where the
document is generated.
You can find more information about the OASIS Open Document Format at
http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office.
More information about OpenOffice can be found at
http://www.openoffice.org.
Release date: 7 September 2005
Turkish (1254) and Greek (1253) code pages are now supported in the PDF output
A printer properties dialog for a given printer can now be invoked from XFRX, returning the printer properties structure as a string. This string can be saved as a user preference and sent to XFRX when printing. This functionality is similar to SYS(1037) introduced in VFP 9.0, with two differences/improvements:
The page setup and printer selection dialogs are skipped, which saves two clicks for the users and preempts confusions in case the printer has already been selected. (Very often, there is a printer selection box in the "main" form and a button to invoke printer properties).
A custom printer properties structure can be used when XFRX transforms the output to a printer
The version of currently used library file
the required version
the location of currently used library file
Release date: 2 June 2005
Release date: 20 April 2005