FoxyPreviewer major update

Info for FoxyPreviewer v2.88.
It brings some minor fixes, but this time a major, jumbo change:

That brings some benefits, like:
- no more need to distribute reportpreview.app and reportoutput.app
- easy debugging, because all the needed files are in the same module (with debuginfo)
- no more need to deal with nonupdated systems. lots of users reported issues, but the source was the report*.app wrong (old) files
- ensure the foxypreviewer initialization will be done using the correct procedures
- a significant increase of speed running the reports and previews

This change meant only 200kb in the app, because most of the needed files were already in foxypreviewer.app and will solve the issue that lots of people had, with wrong report*.app files in their clients.
After this becomes stable, and tested by a considerable quantity of users, i'll publish a separate version of the app, without the debuginfo, to make it 50% smaller.

If for any reason someone wants to keep using the reportpreview.app and reportoutput.app files to render other reports, there should be no problems.
If you use the reportbuilder.app or use report listeners for other purposes, than you should not remore the app files.

I know this change may bring some problems, so please, i'm asking to you to test it in your environments, and specially with your exes. hopefully this will bring many benefits to us. please let me know how that goes. if you find some issues, please provide as much details that you can, so that i can reproduce the issue and upload a fix.

You can get the latest versions directly from here:


FoxyPreviewer for non Latin Languages (v2.87)


This is specially for people who work FoxyPreviewer and with a different codepage from 1252 (Latin).
Just uploaded a new version, v2.87 with a fix for some fonts that were appearing strange, condensed, just like below.
Thanks to Ivo Indra and Max Arlikh (tests and screenshots) for their tests, now I know that this solved for Russian and Czech languages. Hopefully this fix will be applicable to other languages.

So, if you're from a non latin country, please update to the latest version, at least 2.87, and let me know how that goes.

The wrong output appears first, then the fixed and correct:

Foxypreviewer general info
Foxypreviewer documentation
FoxyPreviewer FAQS
Foxypreviewer downloads


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

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:

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

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.


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


FoxCharts new release - with Double Y Axis

Just uploaded a new release of FoxCharts, a VFP-X project 

This version brings the so asked "double Y axis" charts as the main change.
  • Multicharts with negative values that were not being drawn correctly in some situations;
  • Line charts are drawn much faster (5x faster) when drawing with line caps (with shapes in the chart intersections);
  • Other small tweaks

        Have a look at the sample "chartssample_builder_2y.scx" in the samples folder of FoxCharts
        Just some few but important comments:
        1. needs to use depth = 0 (max 2)
        2. preferrably 2 data lines, one using the left axis and the other for the 2nd
        3. set the legends to the top

        Pay attention to the new properties:
        • ChartType = 18          && the newest chart type
        • Fields(n).AxisIndex = 2 && to what axis the data will correspond (1 = default)
        • LegendPosition = 6      && top center

        Having this, now you are able to create a chart like this, with no effort:

        Here is a simple script showing how to achieve the chart below directly:

        create cursor sales( ; 
            chart1 i null, ;
            chart2 i null, ;
            legend c (30) NULL)
        insert into sales values (130,      0, "jan")
        insert into sales values (120,  25000, "feb")
        insert into sales values ( 45,  50000, "mar")
        insert into sales values ( 60,  75000, "apr")
        insert into sales values ( 75, 100000, "may")
        insert into sales values (110, 135000, "jun")
        set classlib to locfile("foxcharts.vcx")
        public oform as form
        oform = createobject("form")
        local loChart as Foxcharts of "foxcharts.vcx"
        loChart = oForm.oChart
        with loChart
             .Backcolor = rgb(255,255,255)
             .BrushType = 2
             .ChartsCount = 2
             .ChartType = 18
             .ColorType = 1
             .Depth = 0
             .FieldAxis2 = 'legend'
             .FieldLegend = 'legend'
             .FontName = 'verdana'
             .Height = 288
             .LegendPosition = 6
             .SourceAlias = 'sales'
             .Width = 732
             with .subtitle
                  .caption = 'chart subtitle'
             with .title
                  .caption = 'testing 2nd y axis'
                  .forecolor = rgb(0,128,255)
             with .fields(1)
                  .axisindex = 1
                  .color = rgb(255,0,191)
                  .fieldvalue = 'chart1'
                  .legend = 'gr1'
                  .shape = 5
             with .fields(2)
                  .axisindex = 2
                  .color = rgb(0,142,146)
                  .fieldvalue = 'chart2'
                  .legend = 'gr2'
                  .shape = 2   && 'vfpxicon.png'
             loChart.DrawChart()     loChart.Visible = .t.
        oForm.Width  = loChart.Width
        oForm.Height = loChart.Height


        Using the CTL32 ProgressBar from FoxyPreviewer

        Foxypreviewer.app is a collection of classes. Inside the APP there are several classes, that you can access directly using VFP.
        Recently I received a request to show how the ctl32 progressbar could be used directly.

        Thats's really simple ! The key command is NEWOBJECT(), that allows us to access classes from an external EXE or APP.
        First of all the author of this gem, the CTL32 progressbar is Carlos Alloatti. For the complete information on how to use it, please go directly to the CTL32 website: www.ctl32.com.ar


        =DOTHERM(90, "Caption", "TitleBar") && shows the regular progressbar with 90%

        =DOTHERM(-1, "Caption", "TitleBar") && the -1 value in the 1st parameter brings the marquee cool effect

        =DOTHERM() && turns off the progressbar

        * doTherm.prg
        * =doTherm(90, "texto Label", "titulo")
        * =doTherm(-1, "teste2", "titulo") && continuo
        * =doTherm() && desligalparameters tnpercent, tcLabeltext, tctitletextif not pemstatus(_screen, "oThermForm", 5)   _screen.addproperty("oThermForm", "")endif
        IF EMPTY(tnPercent)
           _SCREEN.oThermForm = NULL
        IF TYPE("_Screen.oThermForm.Therm") <> "o"   
           DO CreateTherm
        LOCAL loThermForm AS Form
        loThermForm = _SCREEN.oThermForm
        IF NOT EMPTY(tcLabelText)
           loThermForm.ThermLabel.CAPTION = tcLabelText
        IF NOT EMPTY(tcTitleText)
           loThermForm.CAPTION = tcTitleText
        IF tnPercent = -1
           loThermForm.Therm.Marquee = .T.
           IF loThermForm.Therm.Mmrquee = .T.
              loThermForm.Therm.Marquee = .F.
           loThermForm.Therm.VALUE = tnPercent
        loThermForm.VISIBLE = .T.
        PROCEDURE CreateTherm
        LOCAL loForm AS Form
        loForm = CREATEOBJECT("Form")
        _SCREEN.oThermForm = loForm
        LOCAL lnBorder, liThermHeight, liThermWidth, liThermtop, liThermLeft
        lnBorder = 7
        WITH loForm AS FORM
           .SCALEMODE = 3 && pixels    .Height = 48
           .WIDTH = 300
           .AUTOCENTER = .T.
           .BORDERSTYLE = 3 && fixed dialog   .controlbox = .f.
           .CLOSABLE = .F.
           .MAXBUTTON = .F.
           .MINBUTTON = .F.
           .MOVABLE = .F.
           .ALWAYSONTOP = .T.
           .ALLOWOUTPUT = .F.
           .NEWOBJECT("Therm","ctl32_ProgressBar", "pr_ctl32_ProgressBar.vcx", LOCFILE("FoxyFreviewer.app"))
           .NEWOBJECT("ThermLabel", "Label")
           .ThermLabel.VISIBLE = .T.
           .ThermLabel.FONTBOLD = .T.
           .ThermLabel.TOP = 4
           .ThermLabel.WIDTH = .WIDTH - (lnBorder * 2)
           .ThermLabel.ALIGNMENT = 2 && center   liThermHeight = .Height - (lnBorder * 2) - .ThermLabel.Height   liThermWidth = .Width - (lnBorder * 2)
           .VISIBLE = .T.
        liThermTop = lnBorder + 20
        liThermLeft = lnBorder
        WITH loForm.Therm
           .TOP = liThermTop
           .LEFT = liThermLeft
           .HEIGHT = liThermHeight
           .WIDTH = liThermWidth
           .MarqueeSpeed = 30
           .MarqueeAnimationSpeed = 30
           .VISIBLE = .T.
           .CAPTION = ""