FoxyPreviewer
Export your VFP reports to Images, RTF, PDF, HTML or XLS super easy! Send them by email! Enhance the look of your previews, and bring a new life to your APPs!
Menu
Documentation

FoxyPreviewer documentation (PDF Document)
documentation, 3203K, Releases May 15, 2013
PREREQUISITES:
Visual FoxPro 9 SP2
If you use Top-Level forms, the installation of the latest cumulative HotFix for VFP9SP2 KB 968409 is required, to fix a bug from SP2 that makes the toolbar in a Top-Level form look disabled.
You can choose one of the following options to get the latest VFP9 Hotfix for SP2:
1 - Download from Mirosoft directly. Make a search for KB968409. Their link has changes my times in the past years
2 - Get from the downloads page in this site
USAGE:
- WITHOUT CHANGING ANY CODE IN YOUR APP (Simplified and recommended mode)
DO FOXYPREVIEWER.APP REPORT FORM YourReport PREVIEW
That's all !
That means that all you need to do is to "DO FoxyPreviewer.App" at the beginning of your executable, and ALL your reports that use the "PREVIEW" clause will be shown using the simplified but super powerful interface of FoxyPreviewer!
IMPORTANT:
Make sure to store the file FoxyPreviewer.App in a folder that has READ/WRITE permissions, because it will create and store some helper files that it needs to use at the same folder.
CUSTOMIZING SETTING PROPERTIES
Immediately after you "DO FOXYPREVIEWER.APP" all the properties below will be available in the "_Screen.oFoxyPreviewer" object.
You may choose what features will be available in the report preview toolbar, customize your documents, and even how the dialogs will appear. There are some few and obvious properties that you may set in order to fit your needs. Below are the methods and properties available:
Properties
You don't need to configure them at all. You can let your users determine all their preferences using the preferences button.
- cTitle - character, the preview window title
- nShowToolBar - numeric, determines the visibility of the report toolbar when the preview is run. (1 = Visible (default), 2 = Invisible, 3 = Use resource)
- nWindowState - numeric, determines the PreviewForm.WindowState 0 = Normal, 2 = Maximized
- nDockType - logical or numeric (0-4). If False, the dock will follow the resource file used. Or numeric, to force the toolbar docking.
- –1 Undocks the toolbar or form.
- 0 Positions the toolbar or form at the top of the main Visual FoxPro window.
- 1 Positions the toolbar or form at the left side of the main Visual FoxPro window.
- 2 Positions the toolbar or form at the right side of the main Visual FoxPro window.
- 3 Positions the toolbar or form at the bottom of the main Visual FoxPro window.
- 4 Keep the current dock settings from the resource file
- cImgPrint - character, the FullPath of the image file to replace the image of the "Print" button in the preview toolbar.
- cImgPrintPref - character, the FullPath of the image file to replace the image of the "Printer Prompt" button in the preview toolbar.
- cImgSave - character, the FullPath of the image file to replace the image of the "Save" button in the preview toolbar.
- cImgClose - character, the FullPath of the image file to replace the image of the "Close" button in the preview toolbar.
- cImgClose2 - character, the FullPath of the image file to replace the image of the "Close" button in the preview toolbar. This 2nd image will be switched in the MouseOver event of the "Close"button.
- cImgEmail - character, the FullPath of the image file to replace the image of the "Email" button in the preview toolbar.
- cImgSetup - character, the FullPath of the image file to replace the image of the "Setup" button in the preview toolbar.
- cImgMiniatures - character, the FullPath of the image file to replace the image of the "Miniatures" button in the preview toolbar.
- cImgSearch - character, the FullPath of the image file to replace the image of the "Search" button in the preview toolbar.
- cImgSearchAgain - character, the FullPath of the image file to replace the image of the "Search Again" button in the preview toolbar.
- cImgSearchBack - character, the FullPath of the image file to replace the image of the "Search Back" button in the preview toolbar.
- cImgFirst - character, the FullPath of the image file to replace the image of the "First" button in the preview toolbar. (FPv3)
- cImgPrev - character, the FullPath of the image file to replace the image of the "Previous" button in the preview toolbar. (FPv3)
- cImgNext - character, the FullPath of the image file to replace the image of the "Next" button in the preview toolbar. (FPv3)
- cImgLast - character, the FullPath of the image file to replace the image of the "Last" button in the preview toolbar. (FPv3)
- cImgGotoPg - character, the FullPath of the image file to replace the image of the "Go to Page" button in the preview toolbar. (FPv3)
- cImgZoomIn - character, the FullPath of the image file to replace the image of the "Zoom In" button in the preview toolbar. (FPv3)
- cImgZoomOut - character, the FullPath of the image file to replace the image of the "Zoom Out" button in the preview toolbar. (FPv3)
- cImgShare - character, the FullPath of the image file to replace the image of the "Share with external App" button in the preview toolbar. (FPv3)
- cImgPrintBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Print" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons
- cImgPrintPrefBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Printer Prompt" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons
- cImgSaveBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Save" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons
- cImgCloseBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Close" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons
- cImgClose2Big - character, the FullPath of the 32x32 pixels image file to replace the image of the "Close" button in the preview toolbar. This 2nd image will be switched in the MouseOver event of the "Close"button. Applicable when the property 'nButtonSize = 2' && big buttons
- cImgEmailBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Email" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons
- cImgSetupBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Setup" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons
- cImgMiniaturesBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Miniatures" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons
- cImgSearchBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Search" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons
- cImgSearchAgainBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Search Again" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons
- cImgSearchBackBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Search Back" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons.
- cImgFirstBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "First" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons.
- cImgPrevBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Previous" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons.
- cImgNextBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Next" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons.
- cImgLastBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Last" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons.
- cImgGotoPgBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Go to Page" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons.
- cImgZoomInBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Zoom In" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons.
- cImgZoomOutBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Zoom Out" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && big buttons.
- cImgShareBig - character, the FullPath of the 32x32 pixels image file to replace the image of the "Share with external App" button in the preview toolbar. Applicable when the property 'nButtonSize = 2' && Big buttons (FPv3)
- lSaveAsImage - logical, includes the "save as Image" option in menu
- lSaveAsHTML - logical, includes the "save as HTML" option in menu
- lSaveAsMHT - logical, includes the "save as MHTML" option in menu (available only in Simplified mode)
- lSaveAsRTF - logical, includes the "save as RTF" option in menu
- lSaveAsXLS - logical, includes the "save as XLS" option in menu
- lSaveAsPDF - logical, includes the "save as PDF" option in menu
- lSaveAsTXT - logical, includes the "save as TXT" option in menu
- cOutputPath - character, destination path used to save the outputs
- nEmailMode - numeric, the email type (1 = MAPI, 2 = CDOSYS HTML, 3 = CDOSYS TEXT, 4 = Custom procedure)
- lEmailAuto - logical, Automatically generates the report output file. The file name to be used is determined by the property "cSaveDefName".
- cEmailType - character, the file type to be used in Emails (PDF, RTF, HTML or XLS)
- cEmailPRG - character, the name of a PRG that will fire your custom email. In this PRG, you need to receive one parameter, tcFiIle, that is the temporary output file that you'll send by email. A complete sample, "MYSENDMAIL.PRG" is available, showing you how you can send your emails. To use it, you need to set the value of this property, for instance: .cEmailPrg = "MySendMail.Prg"
- cSaveDefName - character, the default name of the save file. Available in the SAVE AS dialog OR automatically used if lEmailAuto
- cTempDestFile - character, the temporary destination file (image, htm, pdf, etc). Its contents will be wiped after the 1st report run. That means that the default file name will return to be empty after the report run. (FPv3)
cFaxPRG - character, the custom procedure name responsible for sending faxes. For example: _Screen.oFoxyPreviewer.cFaxPrg = "mySendFax.prg"
- In that case your “MYSENDFAX.PRG” program MUST start with a LPARAMETERS statement, which will receive from FoxyPreviewer some needed parameters to send your fax:
- FoxyPreviewer does not bring any internal code to manage faxes. With this property, you have a "door" to allow you to receive some info from FoxyPreviewer and send your documents using your Faxing app.
- _Screen.oFoxyPreviewer.cFaxPrg = “mySendFax.prg”
- "MYSENDFAX.PRG" program MUST start with a LPARAMETERS statement, that will receive from FoxyPreviewer some needed parameters to send your fax:
- LPARAMETERS tcFile, tcFaxNumber, tcHTMLBody, tcSubject
- * Where:
- * tcFile = the file name that brings your report
- * tcFaxNumber = the fax number that your client will fill in the email field in the email form
- * tcHTMLBody = the text that your client wrote in the email form
- * tcSubject = the subject filled
- cSMTPServer - character, the SMTP server address. Applicable when ".nEmailMode=2 or 3"
- nSMTPPort - numeric, the SMTP port (usually 25). Applicable when ".nEmailMode=2 or 3"
- lSMTPUseSSL - logical, determines if the SMTP server requires SSL (security connection). Applicable when ".nEmailMode=2 or 3"
- cSMTPUserName - character, the SMTP user name. Applicable when ".nEmailMode=2 or 3"
- cSMTPPassword - character, the SMTP password. Applicable when ".nEmailMode=2 or 3"
- cEmailTo - character, the destination email. You may use the comma "," separator to use more than one address
- cEmailCC - character, the destination COPY email. You may use the comma "," separator to use more than one address. Applicable when ".nEmailMode=2 or 3"
- cEmailBCC - character, the destination BLIND COPY email. You may use the comma "," separator to use more than one address. Applicable when ".nEmailMode=2 or 3"
- cEmailReplyTo - character, the email to be used for replies. Applicable when ".nEmailMode=2 or 3"
- cEmailSubject - character, the email subject. Applicable when ".nEmailMode=2 or 3"
- cEmailBody - character, the email text body. Applicable when ".nEmailMode=2 or 3"
- cEmailFrom - character, the email sender information. You may add some custom captions, eg: 'FoxyPreviewer team'. Applicable when ".nEmailMode=2 or 3"
- cEmailBodyFile - character, the HTML file to be used as email body. Applicable when ".nEmailMode=2 or 3"
- lReadReceipt - logical, determines if the message will ask for a read receipt. Applicable when ".nEmailMode=2 or 3"
- lPriority - logical, determines if the priority level will be high. Applicable when ".nEmailMode=2 or 3"
- cEncryptProcedure - character, The programmer can apply his own Scrambling method on the password string (for advanced users). Applicable when ".nEmailMode=2 or 3"
- cDecryptProcedure - character, The programmer can apply his own Scrambling method on the password string (for advanced users). Applicable when ".nEmailMode=2 or 3"
- cCryptKey - character, the crypt key used to encrypt the SMTP password stored in the settings table (for advanced users). Applicable when ".nEmailMode=2 or 3"
- cAttachments - character, the fullpath of the files to be attached to the email message. Use a comma "," as a delimiter between files (for advanced users). Applicable when ".nEmailMode=2 or 3"
- cAdressTable - character, the name of the alias or FullPath of a table that contains an adress book with emails to be used when sending email messages using the provided form. This table MUST contain a Field of Character type, named "email". Apart from that, it can contain any other data that you want to be visible in a search grid, helping the users to choose the destination. For a better comprehension, please refer to the samples provided and the FAQS. (for advanced users). Applicable when ".nEmailMode=2 or 3"
- cAdressSearch - character, optional, the name of the field to be used for making searches. (for advanced users). Applicable when ".nEmailMode=2 or 3"
- nPDFType - determines the way FoxyPreviewer3 will create the PDF document,
0, 1 - Default, uses the Haru PDF library. Provides a very compact PDF document, very similar to the original report, allowing several customizations, like encrypting, author, block editing. But is not compatible with non TrueType fonts, such as barfonts, wingdings. May have difficulties dealing with unicode characters as well.
2 - EMF PDF, uses the Microsoft Print to PDF engine to generate the PDFs. Much faster than Type #1, with 100% of fidelity. The document generated is much larger and does not allow the customizationslisted above.
3 - EMF Custom, the report is completely redrawn using GDI+ commands, and sent to the PDF Printer, like #2
- cPDFPrinter - character, the name of the Microsoft PDF printer in the current machine. By default, windows attributes its PDF printer as "MICROSOFT PRINT TO PDF". But since users can change its name, this property brings the opportunity to inform the new printer name. This is relevant only when ".nPdfType = 2 or 3", that will need this engine to generate the output
- lPDFasImage - logical, the PDF document will generated as an image document && Default = .F.
- nPDFPageMode - integer, determines the Page mode for the PDF document. && Default = 0, 0 = Normal view, 1 = Show the thumbnails pane. Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- lPDFEmbedFonts - logical, determines if the PDF engine will embed the true type fonts in the PDF document. Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- lPDFReplaceFonts - logical, determines if the PDF engine will replace some basic fonts that are already embedded in any PDF document. Recommended for people using codepage different from 1252 (latin). Default = .T. . Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- lPDFEncryptDocument - logical, determines if the PDF engine will encrypt the PDF document, allowing you to set other restrictions to the documents, using the properties below. Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- lPDFCanPrint - logical, determines if the 'encrypted' PDF document will allow printing. Works only if lPDFEncryptDocument = TRUE (see above). Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- lPDFCanEdit - logical, determines if the 'encrypted' PDF document will allow editing. Works only if lPDFEncryptDocument = TRUE (see above). Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- lPDFCanCopy - logical, determines if the 'encrypted' PDF document will allow copying. Works only if lPDFEncryptDocument = TRUE (see above). Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- lPDFCanAddNotes - logical, determines if the 'encrypted' PDF document will allow adding notes. Works only if lPDFEncryptDocument = TRUE (see above). Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- cPDFMasterPassword - character, determines the master password of the 'encrypted' PDF document. Must be different from the 'User Password' property below. Works only if lPDFEncryptDocument = TRUE (see above). Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- cPDFUserPassword - character, determines the user password of the 'encrypted' PDF document. Must be different from the 'Master Password' property above. Works only if lPDFEncryptDocument = TRUE (see above). Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- lPDFShowErrors - logical, determines if error messages during the PDF generation will be raised to the user. Please set this property to TRUE if you are facing some PDF issues, missing fields, etc. This will help us find the source of the problem. Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- cPdfAuthor - character, the author of the document. Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- cPdfTitle - character, the title of the document. Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- cPdfSubject - character, the subject of the document. Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- cPdfKeyWords - character, the keywords that you want to include in the PDF document. Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- cPdfCreator - character, default: "PDFx / FoxyPreviewer". Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- cPDFSymbolFontsList - character, a Fonts list that can't be converted in PDF. Usually, bar codes and symbol fonts. Delimited with commas, eg. "Webdings,Biro". Internally, FoxyPreviewer has already a list of more than 30 fonts that will always be converted to images. Please try first to generate your PDF without adding the font to the list. If it does not render correctly, just add it here! Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- cPDFDefaultFont - character, the name of the default font name to be used as default in the PDF document. Applicable only when ".nPdfType = 1" && Haru PDF, deprecated
- nPDFLineHeightRatio - numeric, (0.10 - 2), determines the percentage to increase or decrease the line height of PDF documents when you have a CRLF in a field. Default = 1. This is to be used when you feel that for a specific font the line height should be modified. Valid for the Haru PDF documents (.nPdfType = 1, default).
- lSilent - logical, Stay silent regarding errors AND write any MESSAGEBOX() to the cErrors properties
- cErrors - character, brings error messages when lSilent = .F.
- cWatermarkimage - character, the name of the WM image. Important: this image MUST be stored locally, CAN'T be embedded in your EXE, obligatory property if you want to show the watermark
- nWatermarktype - numeric, 1 = Colored (default), 2 = Converts the source image to grey scale, optional property
- nWatermarktransparency - numeric, from .10 to 1, default = 0.25, the transparency level of the WM image; 1 = Opaque, optional property
- nWaterMarkWidthRatio - numeric, default = 0.75, the width size in proportion of the watermark in the report page, optional property
- nWaterMarkHeightRatio - numeric, default = 0.75, the height size in proportion of the watermark in the report page, optional property
- cLockedProps - character, determines the properties that will appear disabled for the users in the "Settings form". A string with the properties separated by a comma. Eg. "cLanguage,cTempFolder,nPdfType". These properties will appear disabled and the user will not be able to change them.
- nVersion - numeric, returns the simplified FoxyPreviewer version information
- cVersion - character, returns the detailed FoxyPreviewer version information
- lPrinted - logical, to be checked after the report is run. Tells you if the user printed the current report
- lSaved - logical, to be checked after the report is run. Tells you if the user saved the current report to a file
- lEmailed - logical, to be checked after the report is run. Tells you if the user emailed the current report
- nPageTotal - numeric, the quantity of pages of the current report
Methods
- SendEmailUsingCDO - Procedure to send any file by e-mail using the FoxyPreviewer properties available for the CDOSYS mode (See "CDOSYS Email properties" above). Just send as parameter the FULLPATH of the file to be sent, and FPv3 will send your file by e-mail. A dialog message will appear telling if the e-mail was sent or not if the Property ".lSilent = .F.". This is a deprecated aproach, since it's not compatible with TLS.
- ResetToDefault()
- Resets the "FoxyPreviewer_Settings.dbf" table to the default settings of FoxyPreviewer, ignoring any changes that were set by the current user
- eg.: _Screen.oFoxyPreviewer.ResetToDefault()
- Release()
- Releases FoxyPreviewer from memory, resetting all the Printing environment
- eg.: _Screen.oFoxyPreviewer.Release()
- GetFoxyScript()
- Creates a VFP Script in a TXT that can be sent to ask for support, to help reproducing your environment. Make sure to revise that file and delete any data that is sensitive to your company before sending it to support.
- eg.: _Screen.oFoxyPreviewer.GetFoxyScript()
- CallSettingsForm()
- Calls the Settings screen, allowing you to provide your users a way to update the report settings without the need of previewing.
- eg.: _Screen.oFoxyPreviewer.CallSettingsFormGetFoxyScript()