FoxChart 1.18 - DrawReport Method

Topics: Bug Information
Jun 22, 2009 at 4:33 AM
Edited Jun 22, 2009 at 4:39 AM

Hi Cesar:

I just download FoxCharts 1.18, and I not too sure if I found some inconsistencies using 'DrawReport' method, or if I did not properly used.

I implemented a form with an 'container' to be able to preview reports before printing.

This form has a custom 'OutputPage' with the following:
** Method OutputPage **
Lparameters nPageNo, eDevice, nDeviceType, nLeft, ntop, nWidth, nHeight, nClipLeft, nClipTop, nClipWidth, nClipHeight
If Vartype (This.oListener) = "O"
       This.oListener.OutputPage(nPageNo, eDevice, nDeviceType;
            nLeft, ntop, nWidth, nHeight, nClipLeft, nClipTop, nClipWidth, nClipHeight)
Endif
**-------------------------**

This method is used as follows:
With This
       .OutputPage(.nCurrentPage. CntPreview.shpCanva, 2;
            .cntPreview.Left. cntPreview.Top. cntPreview.Width. cntPreview.Height;
            .cntPreview.Left. cntPreview.Top. cntPreview.Width. cntPreview.Height)
Endwith
**-------------------------**

But the chart is not drawn on the object 'container' as opposed to the method 'ChartCanvas' I used in previous version In the 'ControlSource' of the image object.

 

Jun 25, 2009 at 4:31 PM

Recently downloading ReportOutput.app v9.2.1 and tried to get a report preview in a container object, but didn't get to show charts.

Jun 25, 2009 at 7:47 PM

Hi,

I have no problem printing a report in a preview container with the sample provided by Cesar "Main Chart Sample"; are you sure there is a chart to be printed? I mean can you see it on your form?

I also notice a typo and I dont hope this is in your 'production coding' as well, otherwise this could very well be the culprit.

With This
       .OutputPage(.nCurrentPage. CntPreview.shpCanva, 2;

missing an 's' and what is the 2 doing there?

 

Regards,

 

Koen

Jun 26, 2009 at 4:54 AM

I would like to add some screenshots, maybe it could be helpful, but I don't know how to do

Developer
Jun 26, 2009 at 1:39 PM
Edited Jun 26, 2009 at 1:40 PM

Hi Churrucks,

 

For posting screenshots, you may post your message at the IssueTracker section of Codeplex and attach a zipped file.

Another option is to publish them in a free website and post the links.

Obviously, you already have my email to send'em directly

Regards

Cesar

Developer
Jun 26, 2009 at 1:47 PM

Churrucks,

The "DrawReport" feature was designed by Bo Durban, and is a feature of GdiPlusX's Image Canvas class.

To call his attention on this, maybe you could repost your message having the "GdiPlusX" title.

 

DrawReport generates a temporary file with an image of the current chart in the EMF format, that provides wonderful results when resizing the charts. Notice that it is generated on the fly. Maybe there's something that could be tweaked there in order to ensure that the chart will be correctly created.

Maybe you could create a small sample for me and send it to my email directly, so that I can test it and see if something can be done in order to work with a ReportListener ?

Jun 26, 2009 at 7:35 PM

I have prepared an example for you, at what email I can send?

Developer
Jun 27, 2009 at 12:27 PM

Hi Churrucks,

Please send it to vfpimaging at hotmail dot com

TIA

CEsar

Jun 29, 2009 at 10:21 PM

Hi Cesar:

I was wondering if you've tried the example I sent you, and if you get the same results I have experienced which led to this discussion?

Regards,

Hector

Developer
Jul 15, 2009 at 10:08 PM
Edited Jul 15, 2009 at 10:11 PM

Hola Hector,

Thanks very much for your great sample !

Unfortunately, DrawReport() wont work as you planned, because it generates a temporary EMF image file, that is used for rendering purposes.

Since you are Calling each page of your report separately using "OutputPage()", it happens that at that moment, the EMF temp image file was already deleted, because you have in the "Destroy()" event of your DataEnvironment instructions for the FoxCharts object to destroy itself.

You can try there, just removing the line below from the Destroy event and your sample will work as you wanted.

Please understand that this is by design, from the ImageCanvas class from GdiPlusX. It seems that "OutputPage()" will not recreate the FoxCharts object again when rendering each page...

Hope this helps !

*Release oChart

Best Regards

Cesar

Jul 15, 2009 at 10:56 PM

Hello Cesar:

Thank you so much, that was helpful!!

Now I have great results with EMF image, when zoomin at preview.

Thanks again and go ahead.

Hector