Showing posts with label PDF. Show all posts
Showing posts with label PDF. Show all posts

2022-05-08

XFRX vs FoxyPreviewer

I felt very honored to know that the VFP guru Rick Schummer presented a session - Visual FoxPro Reporting: XFRX vs. FoxyPreviewer in the 2022 version of VFF - Virtual Fox Fest. The organizers were very generous offering a recorded version of all sessions for free for the community in YouTube.



Rick very quickly and impartially shown some of the main features of both tools. 

Regarding FoxyPreviewer, I have some few considerations or remarks. Of course it would be impossible or Rick to know all the possibilities and features available. I just want to make clear that I feel very thankful for the review. And I am totally aware that the documentation needs some updates, and some points could be better explained, so here I take the opportunity to try to clarify some points.


  • Exporting report to an image file - There are 3 available options:
    - OBJECT TYPE 16 - This is the object type related to exporting to image files. Works exactly the same as the others.
    - OBJECT TYPE 20 - This OBJECT TYPE was not discussed in the presentation. It will choose automatically the ReportListener needed to generate the desired output, according to the file extension passed in the TO FILE clause. The available types are: PDF, RTF, HTML, MHTML, GIF, TIFF, EMF, JPG or PNG.
    REPORT FORM YourReport TO FILE MyImageReport.JPG OBJECT TYPE 20
    - Using the FoxyListener.OutputPage method &&Like regular VFP9
  • The truncated numeric fields in reports - He was very precise in his explanation, but I still would like to add some few information from a FAQ related to this:
When I run my reports with FoxyPreviewer sometimes asterisks symbols ********************* appear instead of the field. This was originally working, before using FoxyPreviewer

That happens because FoxyPreviewer uses the SET REPORTBEHAVIOR 90 mode, that uses GDI+ to render the texts. Unfortunately there is a slight difference of the size of the strings between these modes. To fix it, just edit your report and enlarge that field!

You can set the property - lExpandFields to make the report engine show the field numeric value ignoring the field size.
Using "lExpandFields", FoxyPreviewer retrieves the value that overflowed and resends it to the report engine with an enlarged field width.

This is a known issue, and Lisa Slater Nicholls wrote a short blog post regarding it:
Why do report layouts in VFP9 need wider field/expression controls than in VFP8 and earlier?

And here's another interesting text from Lisa, that explains the reason for that:
With REPORTBEHAVIOR=90, the new report engine uses GDI+ to render output, and text string rendering requires more space than plain old GDI.
The Report Designer uses GDI - not GDI+ - to render the report layout components, including all the text strings that you see. So if you visually right-align a label report element, the report designer records the leftmost co-ordinates of the element (the text start position) in the layout.
The length of the string under GDI+ rendering will most likely be greater than what you would think, based on what you see in the Designer.

  • SET COMPATIBLE ON - Oh, this is a known issue, and I had it fixed before. I just don't know why the fix was not included in the last version. I hope to post an update very soon.
  • ReportPreview.App and ReportOutput.App - As shown by Rick, these files are no longer needed if FoxyPreviewer was elected to be your single ReportEngine. I just feel important to add that if you are used to turn it off, you still need those files to restore the Reporting engine to the default VFP9.
  • Excel bug / Enhancements - Please send me your files and I will be very happy and honored to aply your updates to the main distributable version!
  • lOpenViewer property - In one of your samples Rick was using the property ".lOpenViewer = .T." - That means the generated output file would be opened automatically after generated. But the next REPORT FORM command contained the "TO FILE" and "PREVIEW" clauses. The "PREVIEW" clause means exactly the same - to open the file automatically!
    That's a very interesting usage of FoxyPreviewer. If you want your report to be shown in the default PDF viewer instead of a VFP FORM, just use the command:
    REPORT FORM YourReport OBJECT TYPE 20 TO FILE TempFile.pdf PREVIEW
  • The "PrintingPreferences" - Rick told us he feels some kind of frustration with the fact that the report is closed after you change your report settings in that dialog. But that's exactly what the "PRINTER PROMPT" clause does! From that dialog you have the opportunity to change the printer, copies and other settings and call the printer directly.
  • Rick was asked about embedding the toolbar in the Preview window. As he said, not in v2.99, but docking the toolbar is possible.
  • David Acuña asked about determining the SMTP server values previously. Yes, that's possible. Just set the "cSMTPServer", "nSMTPPort" and other related properties previously, just after FoxyPreviewer was initialized.
  • Maybe I misunderstood the real meaning of Rick's statement when he said that "The configurations are Global, not Per User". In fact, when you start FoxyPreviewer.App it will load the settings from the file "FoxyPreviewerSettings.dbf". This file is automatically generated after the 1st run of Foxy in that folder. Each of your users can have their own Settings Dbf file! You can save a copy of FoxyPreviewerSettings.DBF when your user logs off. Next time, after logging in and before calling FoxyPreviewer.App replace this file with the desired one. So, you can save a settins file for each of your users! When FoxyPreviewer does not find that DBF in its folder it will create a new one.

    Yes, everyone using that APP on that same machine will use those settings, as he mentioned.

    Here are some new thoughts regarding this, using a not very well documented possibility... There is an option to start FoxyPreviewer in a separate folder:

    Immediately after the user logs in your App, and the user is stored as "m.lcUser", people can try the following:

    lcFolder = ADDBS(JUSTPATH(SYS(16)))
    lcUserFolder = lcFolder + "Users\" + m.lcUser && Make sure the folder exists
    DO FOXYPREVIEWER.APP WITH (lcUserFolder)

    This way, every user will easily have his own Settings table. What do you think?


  • Distributing FoxyPreviewer - People just need ONE SINGLE FILE - FoxyPreviewer.App. And there is no need to install it. Just a simple"DO FOXYPREVIEWER.APP" at the beginning of your EXE code and it's done! The recommended is to store it at the same folder of your EXE, and make sure that folder will allow Foxy to create a subfolder and save some custom configuration files.

2018-05-24

FOXYPREVIEWER NEW HOME - www.foxypreviewer.com

As everybody knows, the cool and friendly structure of CodePlex is no longer available, so I decided to create a separate home for it.

From now on, all the releases, documentation, FAQS and more information will be available at www.foxypreviewer.com

Although CodePlex is still available as "ReadOnly", some people had difficulties downloading the latest release and documentation, so some other helpful guys have published some versions of these files. I would like to ask you to remove them, to avoid offering deprecated versions, because that makes it extremely difficult for all of us to provide support for old versions.

I have already a new version with some cool new features ad fixes, and I hope to publish it very soon.

See you at www.foxypreviewer.com !!!

2018-05-11

REPORTLISTENER HEADQUARTERS AND SAMPLES

REPORTLISTENER HQ

REPRODUCED FROM THE CAPTURED VERSION FROM THE WEBARCHIVE
www.reportlistener.com from 2007-08-23



Visual FoxPro 9.0 includes several major improvements to the crusty old Report Writer, making it a powerful, dynamic tool. One the primary ways to extend the capabilities of the Report Writer is through custom Report Listener classes. These classes allow you to hook into the report generation process to customize the appearance of your report. This site is dedicated to the sharing of custom Report Listener classes among the members of the Visual FoxPro community.


Available downloads: 



Converting General fields to Blob fields

 - The new Blob data type in VFP 9 is a General killer--they're much easier to work with than General. Unfortunately, there isn't an easy way to convert the contents of existing General fields into Blob fields; once you've put an image into a General field, it's all but impossible to get it back out. GeneralToBlobListener is a ReportListener subclass that handles this task painlessly.
Last updated: 2005-01-08 
Author: Doug Hennig
Download Converting General fields to Blob fields (Freeware - 7.2K)


HTML Preview with a Navigation Pane

 - Uses a custom ReportListener class and a helper class that work together to generate the output in HTML and GIF files. This HTML file is gererated through an XSL Transformation over a XML document that keeps some metadata of the preview output.
Last updated: 2004-11-03
Author: Fabio Vazquez
Download HTML Preview with a Navigation Pane (Freeware - 6.8K)


Using the GDI+ FFCs to work with output

 - This sample uses the GDI+ foundation classes to change the StringTrimming behavior for the field in the detail band of the report. Note that you have to make one manual change to the report as specified. 
Last updated: 2004-11-02 
Author: Garrett Fitzgerald 
Download Using the GDI+ FFCs to work with output (Freeware - 4.7K)


Font List

 - This code and simple listener generates a report-based list of the fonts on your system. 
Last updated: 2004-11-01 
Author: Garrett Fitzgerald 
Download Font List (Freeware - 1.1K)


QuickFRX2PDF

 - QuickFRX2PDF, this class will allow you to generate PDF files in a really fast and easy way. New version, will generate real PDF Files in a smaller size and faster. Help file included and sample form updated.
Last updated: 2005-10-10 
Author: Luis Navas 
Download QuickFRX2PDF (Commercial - 1MB) 


QuickVFPPdf

 - Taking advantage of GDI+ usage in Visual FoxPro 9 this class generates a PDF Document that will look exactly as your original report. Limitations: All the content of the report will be exported as an image to the PDF document (this will change in future versions). Works only on Visual FoxPro 9 (this will change in future versions).
Last updated: 2005-06-07 
Author: Luis Navas 
Download QuickVFPPdf (Commercial - 1MB) 


Report Preview/Output Engine

 - Report Preview/Output Engine - Written by AMaximum (Erlikh Maksim, Novorossiysk, Russia)
Last updated: 2005-05-04 
Author: Erlikh Maksim 
Download Report Preview/Output Engine (Freeware - 84K)

2011-04-19

The simplest way to create your PDF's / FoxyPreviewer Latest changes

It's been a long time since my last blog post about foxypreviewer. although somehow quiet in the blog, the work behind the scenes has been hard, and I've just released version 2.38, with several fixes and enhancements.

One of the coolest is the following:
to export a report to PDF without previewing, people just need to do the following:
     DO FoxyPreviewer.app
     REPORT FORM YourReport OBJECT TYPE 10


Yes !
That's all you need.
Even better than that, the new - oops !!!!, hahahaha, VFP9 is quite old right now, reporting system from VFP9 allows me to access some of the report clauses used in the report form command. so now we can use the object type clause of the report form command much better, using the "to file" and the "preview", see:

     DO FoxyPreviewer.app
     REPORT FORM (_Samples + "\Solution\Reports\Wrapping.frx") ;       
          OBJECT TYPE 10 ; && regular PDF
          TO FILE ("c:\FoxyNewTest.PDF") ; && destination file        
          PREVIEW    && open the default PDF viewer


to file - is the destination file, that can be sent directly in the report form command !
preview - opens the default file viewer, eg. adobe reader for PDFs

So, in summary, I've enabled 2 object type's allowing automatic PDF generation, without previewing, with just one single line of code, just the same way we used to run our reports!
  • object type # 10 = regular PDF, searchable
  • object type # 11 = PDF as image, non searchable
  • object type # 12 = RTF
  • object type # 13 = XLS
  • object type # 14 = HTML using XSL
  • object type # 15 = HTML using basic HTML commands, easier to export to web
  • object type # 20 = Any file type from the above, just send the corrret file extension, and FoxyPreviewer will internally use the needed ReportListener to create the output
New horizons
A very cool part of all this is that now we have even a new option for report previsualization, trasforming our reports in pdf, and using Adobe Reader to preview them !
that's really neat! Because the reader brings some very nice options for printing, text searching, hyperlinks, emailing, saving, etc etc etc...
If you want to customize your PDFs using the new object type clause, of course you can! Just use the following properties available in the _Screen.oFoxyPreviewer object:
WITH_Screen.oFoxyPreviewer
    .lQuietMode
    .lPdfEmbedFonts
    .lPdfCanPrint
    .lPdfCanEdit
    .lPdfCanCopy
    .lPdfCanAddNotes
    .lPdfEncryptDocument
    .cPdfMasterPassword
    .cPdfUserPassword
    .lPdfShowErrors
    .cPdfSymbolFontsList
    .cPdfAuthor
    .cPdfTitle
    .cPdfSubject
    .cPdfKeywords
    .cPdfCreator
    .cPdfDefaultFont
    .lOpenViewer
    .nPpdfPageMode


These properties are all described in the foxypreviewer documentation.
Of course this needs some tests, i'm waiting for the feedback of people interested in that feature.

The recommended mode - make it simple !!!

From now on, I'm recommending people to use only the simplified mode:
     DO FoxyPreviewer.app
     REPORT FORM YourReport PREVIEW

Some of the main improvements / fixes

- improved the fonts substitution in the PDF rendering. the fonts Arial and Courier New will appear well, using some internal fonts from the pdf engine.
- wingdings was enabled too!
- fix in PDF "stretch to fit" and multilines sentences - thanks to Fabio Vieira
- fix sending emails, automatic opening tables
- from now on, whatever that the pdf engine will not be able to draw, it will get an image from the source report surface, crop and paste the image in the PDF document. This works nice for barcodes, and some fonts that can't be embedded.
- included all of the available properties for the complete mode to the "_screen.ofoxypreviewer" object (that is created after you "do foxypreviewer.app"
- several small fixes in the xls rendering, hopefully now all reports will generate valid worksheets. (special thanks to jorge chang for his samples and testing)
- using the simplified mode now you can change your printer directly from the combobox, thanks to lisa slater nicholls, for her great article "a print job to call your own"


Special thanks

- to all the translators who have been translating the localizations table, alowing the tool to be multilanguage. currently we have 16 languages available!
- Soykan Ozcelik and Luis Maria Guayan, for their terrific support, tests and help, and more than that, for translating the Foxypreviewer documentation to Turkish and Spanish, allowing more people to use the tool, and for providing a very positive and constant support in their local VFP forums. currently we have all dialogs, tooltips and captions available in:

  • english
  • portuguese
  • czech
  • spanish
  • dutch
  • turkish
  • french
  • german
  • indonesian
  • arabic
  • greek
  • italian
  • persian
  • polish
  • russian
  • swahili
- and thanks to all people who have been testing this product very deeply.

That's super important, because this utility is getting really big, with lots of possibilities of usage, and for me it's impossible to test in all environments.


Documentation

As said above, the documentation has been updated, and also translated to turkish and spanish:
English documentation
Turkish documentation / Türkçe dökümantasyon
Spanish documentation / Documentacion en español


The foxypreviewer.app file size

- notice that the file foxypreviewer.app has become bigger, about 3MB. that is because I added the "debug info" information to the app.

That makes the file bigger, but on the other hand, provides a more detailed debugging information. that way, people will be able to tell me the line that originated the bug, even running foxypreviewer in production.

That will be only for now, during the tests. in the future, after i stop making constant changes, I'll remove that, and the apps will come back to the original and compact size, about 1.5 MB

And of course, you can recompile the app using the sources, removing the debuginfo if you want!

Foxypreviewer general info
Foxypreviewer documentation
FoxyPreviewer FAQS
Foxypreviewer downloads

2010-11-22

FoxyPreviewer v2.00 - New email form

The FoxyPreviewer email form uses a custom HTML editor created by Frederic Steczicky from atoutfox.org, and allows you to:

  • generate html outputs for the body of your message
  • changing the formatting, alignments, fonts, adding pictures, hyperlinks, etc...
  • preloading an html
  • attaching more files is allowed
  • mark message as priority
  • ask for read receipt




another cool thing is that after you click on "send", a continuous progress bar, with the cool marquee effect (thanks to Carlos Alloatti) will appear, till the message is delivered:



the old email form, that could generate only plain text messages is still there, you may select it in the settings form:



Obviously, some new messages need to be translated. if you want it to be enabled for your native language, download the most recent version of foxypreviewer, and send me your version of the file foxypreviewer_locs.dbf



Foxypreviewer general info
Foxypreviewer documentation
FoxyPreviewer FAQS
Foxypreviewer downloads