problem with TeeChart, QuickReport and CBuilder 5

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
sunny
Newbie
Newbie
Posts: 2
Joined: Fri Jan 28, 2005 5:00 am

problem with TeeChart, QuickReport and CBuilder 5

Post by sunny » Mon Jan 31, 2005 7:06 pm

I just installed TeeChart 7.03, with already existed Quick Report 3.6.2 and CBuilder 5.0.

In my project, I need to show the chart in a Quick Report. The application will open a Data Range Selection Form first, then show the report if the user click the Preview Button. Everything is fine, but when I try to close the whole applicaiton, I got a error message, Win32 error code 1400, Invalid Window Handle.

If I removed the chart from the report, everything works fine.

I do find a reply about this problem, but I am not sure whether it has been solved in version 7.03.


http://www.berneda.com/publicnews/publi ... 0c0000.htm


From: Josep Lluis
Subject: Re: QuickReport (Pro) + QRChart (newest) + D6 Pro (all updates) = EOSError
Date: Tue, 27 May 2003 12:27:19 +0200
Newsgroup: public.teechart5.delphi

Hi Thomas,

yes, it seems to be a bug in the Qrtee.pas :

Function TQRDBChart.GetRectangle:TRect;
Var tmpZoomFactor : Double;
begin
if Parent<>nil then
With TQRChart(Parent) do
begin
if (ParentReport<>nil) then tmpZoomFactor:=100.0/ParentReport.Zoom
else tmpZoomFactor:=1;
{ result:=Rect(0,0, Round(ClientWidth*tmpZoomFactor),
Round(ClientHeight*tmpZoomFactor) ); }
result:=Rect(0,0, Round(Width*tmpZoomFactor),
Round(Height*tmpZoomFactor) );
end;
end;

In brackets the trouble making code sequence, below the sequence
that works
You should change this and compile again the QrChart sources.

Best Regards
Josep Lluis Jorge
pep@steema.com

"dk_sz" wrote in message news:1eznlW4IDHA.488@TEEPC...
> I have QuickReport Pro 3.62 (and TeeChart Standard 4.04 - the one with D6
> Pro).
> This makes QR incompatible with the normal Borland/Steema QRChart
(something
> to do with packages).
> However, one can download (as I have done) the source for QRChart here:
> http://www.teemach.com/download/Downloa ... Additional
> and recompile + install (I have followed all the intructions etc.).
>
> I have then placed QRChart on a SubDetail band (with OnNeedData ->
> MoreData sometimes True or False in different tests to see if that
matters).
>
> Now in runtime I then preview report. Everything looks as expected etc. I
> close app and get following error
> (and remember, I do not get any error if I in report-form-designer remove
> the
> QRChart from the subdetail and then try above):
>
> In line 12342 in SysUtils I get:
> Exception class EOSError with message:
> SystemError. Code. 1400:
> (translated from Danish to English ->) "Invalid windows-handle".
>
>
> Am I missing something obvious I should check or..?
> I have checked and tryed above with new/simple reports resulting in same
> error.
> Is this problem unknown if one uses the standard QR-stuff?
> * In that case I will email QUSoft (after some further testing).
> Will it help buying the newsest version of TeeChart? Can anyone comfirm
> that?
>
>
> best regards
> Thomas Schulz
>
>

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue Feb 01, 2005 10:01 am

Hi.

Yes, the problem was addressed and fixed in the latest version (7.03). Here is the lates TQRDBChart.GetRectangle implementation:

Code: Select all

Function TQRDBChart.GetRectangle:TRect;
Var tmpZoomFactor : Double;
begin
  if Assigned(Parent) then
  With TQRChart(Parent) do
  begin
    if Assigned(ParentReport) then tmpZoomFactor:=100.0/ParentReport.Zoom
                              else tmpZoomFactor:=1;

    {$IFDEF D6}
    try
    {$ENDIF}
      result:=Rect(0,0, Round(ClientWidth*tmpZoomFactor),
                        Round(ClientHeight*tmpZoomFactor) );
    {$IFDEF D6}
    except
      on EOSError do
      begin
        result:=Rect(0,0, Round(Width*tmpZoomFactor),
                          Round(Height*tmpZoomFactor) );
      end;
    end;
    {$ENDIF}
  end
  else result:=GetClientRect;
end;
Marjan Slatinek,
http://www.steema.com

sunny
Newbie
Newbie
Posts: 2
Joined: Fri Jan 28, 2005 5:00 am

Post by sunny » Wed Feb 02, 2005 8:31 pm

thanks, I do notice that there is a folder named Quick Report under ..\Steema Software\TeeChart 703 for Builder 5\Builder5, do I need to rebuild the QRChart package?

By the way, where can I get the QRChart Recompilation instruction for CBuilder 5? I only see it for Delphi.

Thanks

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

Post by Narcís » Mon Feb 07, 2005 10:49 am

Hi sunny,
By the way, where can I get the QRChart Recompilation instruction for CBuilder 5? I only see it for Delphi.
You can find them here. The packages here are described for TeeChart Pro 7 and Delphi 7, you will have to sort it out for your TeeChart and IDE version. In C Builder 5 and TeeChart 7 packages names would be like DclTQR7C5.bpl, where the first name digit means TeeChart version and second means IDE.
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