TQRChart axis scaling problems

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
OCS
Newbie
Newbie
Posts: 13
Joined: Wed Sep 02, 2009 12:00 am

TQRChart axis scaling problems

Post by OCS » Tue Nov 05, 2013 1:15 pm

Software:

IDE : Codegear RAD Studio 2007 for C++
Steema TeeCharts 8.05.50522
QBS Software QuickReport 4.07

Hello,

I´m facing a weird problem with the TQRChart component. I´ve got an MDI application that is used to generate printouts. The application can be remotely controlled by external commands, and one of these commands tells it to generate a MDI child form containing a chart and then print that chart using QuickReport and the TQRChart component. After printing the chart it closes the MDI child form containing the chart. This is how it works:

1) The application is already started and either visible or minimized
2) The application receives an external command via WM_COPYDATA caught by the MDI Parent Window
3) create a MDI child form containing a TChart diagram
4) create a TQuickRep form containing a TQRChart to render the TChart diagram from 2)
5) use the TQuickRep from to print the chart
6) close the TQuickRep form
7) close the MDI child form

This works very well most of the time, but sometimes the vertical axis labels are messed up (see attachment broken.jpg). After some investigation I figured the printout depends on the state of the MDI child window. When the application (and the MDI child frame) is visible the printout looks like the attachment normal.jpg. When the application is minimized to the taskbar the printout looks like the attachment hidden.jpg. In rare cases the printout looks like attachment broken.jpg, but that happened only if the main application was minimized.
I don´t understand how a TQRChart component renders the chart, I was under the impression the TQRChart´s size depends solely on the TQRChart´s size on the TQuickRep. Since we use a fixed page and paper size the printout should always look the same. How come the printout looks different, depending on the state of the corresponding MDI child window. Why do the printouts normal.jpg and hidden.jpg look different? Is this intended, and, if not, how can I fix it?

Kind regards,
Guido
Attachments
Broken.jpg
Messed up printout
Broken.jpg (101.83 KiB) Viewed 15314 times
Normal.jpg
Printout generated when visible
Normal.jpg (116.01 KiB) Viewed 15255 times
Hidden.jpg
Printout generated when minimized
Hidden.jpg (84.87 KiB) Viewed 15222 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: TQRChart axis scaling problems

Post by Narcís » Fri Nov 08, 2013 8:25 am

Hello,

Can you reproduce it in an application with a TChart component in a form instead of a TQRChart? Can you please attach a simple example project we can run "as-is" to reproduce the problem here?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

OCS
Newbie
Newbie
Posts: 13
Joined: Wed Sep 02, 2009 12:00 am

Re: TQRChart axis scaling problems

Post by OCS » Mon Nov 11, 2013 9:10 am

Hello,

I´ve uploaded a zip file containing an executable and the C++ sources. Selecting "Start background export" and "Stop background export" start and stop the background image export respectively. You will notice different results depending on the state of the main window.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: TQRChart axis scaling problems

Post by Narcís » Mon Nov 11, 2013 9:46 am

Hello,
OCS wrote:I´ve uploaded a zip file containing an executable and the C++ sources.
Where did you upload the files? Did you forget to include it in your reply?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

OCS
Newbie
Newbie
Posts: 13
Joined: Wed Sep 02, 2009 12:00 am

Re: TQRChart axis scaling problems

Post by OCS » Mon Nov 11, 2013 12:09 pm

I´m sorry, I missed the error message:

"The file is too big, maximum allowed size is 512 KiB."

I stripped the .exe from the archive, so you have to build the .exe your own. Is there another way to upload the archive ( ~1MiB)?

Regards,
Guido
Attachments
TeeQRTest.zip
(9 KiB) Downloaded 421 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: TQRChart axis scaling problems

Post by Narcís » Mon Nov 11, 2013 12:21 pm

Hi Guido,

Yes, please send it to http://www.steema.net/upload/

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: TQRChart axis scaling problems

Post by Narcís » Mon Nov 11, 2013 12:27 pm

OCS wrote:I´m sorry, I missed the error message:
I stripped the .exe from the archive, so you have to build the .exe your own. Is there another way to upload the archive ( ~1MiB)?
BTW, I see the project file is missing. Could you please a attach a complete project with its sources?
Narcís wrote:Can you reproduce it in an application with a TChart component in a form instead of a TQRChart?
Also, did you test that? How did it go?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

OCS
Newbie
Newbie
Posts: 13
Joined: Wed Sep 02, 2009 12:00 am

Re: TQRChart axis scaling problems

Post by OCS » Mon Nov 11, 2013 12:43 pm

Can you reproduce it in an application with a TChart component in a form instead of a TQRChart?
No, I was unable to reproduce the effect without a TQRChart. I saved bitmaps of a TChart and they were all fine.
Do you still need the project files even if they use the TQRChart?

Regards,
Guido

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: TQRChart axis scaling problems

Post by Narcís » Mon Nov 11, 2013 12:47 pm

Hi Guido,

Thanks for your feedback. Yes please, it would have been easier to work without the TQRChart component but we will have to look at it this way.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

OCS
Newbie
Newbie
Posts: 13
Joined: Wed Sep 02, 2009 12:00 am

Re: TQRChart axis scaling problems

Post by OCS » Mon Nov 11, 2013 1:45 pm

I´ve uploaded the File "TeeQRTest.zip" into your upload area.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: TQRChart axis scaling problems

Post by Narcís » Mon Nov 11, 2013 2:44 pm

Hi OCS,

I can't find the file. Did you use your forums profile email address for posting it?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

OCS
Newbie
Newbie
Posts: 13
Joined: Wed Sep 02, 2009 12:00 am

Re: TQRChart axis scaling problems

Post by OCS » Mon Nov 11, 2013 2:49 pm

Yes, I used my profile´s user name and email address.
I just uploaded the file again, just to make sure.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: TQRChart axis scaling problems

Post by Narcís » Mon Nov 11, 2013 3:31 pm

Hi OCS,

Thanks for your feedback but I'm still unable to find the file here. Did you get a message like this: "Received TChart.jpg Content Type image/jpeg Length 46620"? Otherwise, could you please send it to info at steema dot com with a reference to this thread?

Thanks again and apologies for the inconvenience.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: TQRChart axis scaling problems

Post by Narcís » Tue Nov 12, 2013 12:03 pm

Hi Guido,

We have finally received your files. We will investigate the issue here and will get back to you when we have some news.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: TQRChart axis scaling problems

Post by Narcís » Tue Nov 12, 2013 3:58 pm

Hi Guido,
OCS wrote: Is this intended, and, if not, how can I fix it?
This is really weird and definitely not intended. An easy alternative might be using a TChart component, export it to an image (MetaFile if necessary) and use it in the QuickReport. Using StretchDraw as in the example here might be suitable for your requirements.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply