FoxyPreviewer consists of a collection of classes, libraries and images, that allow you to export your reports into several output types, PDF, RTF, basic XLS and Images, with a modern and more powerful set of tools in the preview toolbar.
http://weblogs.foxite.com/vfpimaging/archive/2010/02/21/10127.aspxSome people have been asking about how to distribute the files, etc...
My first recommendation is to include all classes, VCX/VCT, images, the header files (*.H), and the file FoxyPreviewer.Prg in your Project, and compile. That's all.
But, just to make things easier for those who are starting with FoxyPreviewer, I'm shipping an APP version of the library -
FoxyPreviewer.APP, and a helper file,
FoxyPreviewerCaller.PRGThis APP contains all the Classes, custom ReportListeners, DLLs and images needed.
ALL IN JUST A SINGLE FILE.
The usage is almost the same:
Store the file FoxyPreviewer.App in the same folder that you have your EXE or the Report*.App files.
Add to your main project just one file:
FOXYPREVIEWERCALLER.PRGThe usage is
EXACTLY the same - the only difference is that instead of starting the FoxyPreviewer class directly, you'll access the Helper class that I created that you'll include in your EXE.
This was necessary in order to allow FoxyPreviewer to access the FRX files from your EXE. Being an external library, FoxyPreviewer.App can't access directly the FRX that are in your EXE. That's the reason that I'm asking you to include the helper file, FoxyPreviewerCaller.Prg in your EXE. That way, the helper class is inside your EXE, and it can access your FRX, and pass them to the Previewer class.
Behind the scenes, this helper class stores a copy of the FRX classes from your EXE in a TEMP file, that is used by FoxyPreviewer. This helper class does the needed cleanups, deleting the temporary files. All the properties available in the main class are available in the helper as well, so you'll use it the same way:
SET PROCEDURE TO FoxyPreviewerCaller.prg ADDITIVE
LOCAL loReport as "FoxyPreviewerCaller" OF "FoxyPreviewerCaller.Prg"
loReport = CREATEOBJECT("FoxyPreviewerCaller")
WITH loReport as ReportHelper
.AddReport("Sample.frx", "RANGE 1,1 NODIALOG")
.RunReport()
DO CASE
CASE .lPrinted
MESSAGEBOX("Report was printed !",64, "Report status")
CASE .lSaved
MESSAGEBOX("Report was saved as file:" + CHR(13) + .cDestFile,;
64, ;
"Report status")
=Thisform.OpenFile(.cDestFile)
OTHERWISE
MESSAGEBOX("Report Preview was closed without saving or printing",48, "Report status")
ENDCASE
ENDWITH
The APP distributed is using the English language translation by default.
If you want to change it to your own language, we have already 6 options available: English, portuguese, spanish, turkish, german and italian. Just edit the file Foxypreviewer.Prg, uncomment your desired language in the 1st lines, and recompile it, generating your localized FoxyPreviewer.App file.
Hope this clarifies the usage.
You may get the needed files from here:
http://weblogs.foxite.com/vfpimaging/archive/2010/02/21/10127.aspxRegards,
Cesar
My Blog