Page 1 of 1

stack overflow error with TQRchart and XPman

Posted: Thu Apr 27, 2006 5:29 pm
by 9345764
I have a problem with TQRchart. It was already there in TeeChart Pro v7.06. Still there in v7.07. I add a TQRchart to QuicpReport Pro 4.06, then add a TLineSeries in code and then a few points:

procedure TForm1.AddLineButtonClick(Sender: TObject);
var
ALineSeries : TLineSeries;
begin
with Chart1 do
begin
ALineSeries:=TLineSeries.Create(Self);
AddSeries(ALineSeries);
ALineSeries.Add(3800,'444',clBlue);
ALineSeries.Add(3300,'444',clBlue);
end;
end;

Next I use CloneChartSeries to copy the chart into a TQRchart and preview the report:

procedure TForm1.ReportBtnClick(Sender: TObject);
var
i : integer;
begin
Form2.QRChart1.Chart.FreeAllSeries;
Form2.QRChart1.Chart.Assign(Chart1);
// 6000
for i:=0 to Chart1.SeriesCount-1 do
CloneChartSeries(Chart1).ParentChart:=Form2.QRChart1.Chart;

Form2.QuickRep1.Preview;
end;

Next I get a 'Stack overflow' error. Funny thing is: it only happens if I use the XPman unit.

The complete small test project with code I will upload on this special upload thing.

Any ideas?

thanks Wilfried

Posted: Thu Apr 27, 2006 7:16 pm
by 9345764
I think I found the solution to my run time problem:

I traced the stack overflow error down to the TQRDBChart.Invalidate procedure along the following call stack after starting the preview :

QrTee.TQRDBChart.Invalidate
:0054d0ef TQRDBChart.Invalidate + $F
:0053e422 TCustomTeePanel.DrawToMetaCanvas + $2A
:0053dca1 TCustomTeePanel.TeeCreateMetafile + $85
QrTee.TQRChart.Print(127,127)
QuickRpt.TQRCustomBand.Print
QuickRpt.TCustomQuickRep.PrintBand(???)
QuickRpt.TQRController.PrintEmptyController
QuickRpt.TQRController.Execute
QuickRpt.TQuickRep.Execute
QuickRpt.TCustomQuickRep.CreateReport(False)
QuickRpt.TCustomQuickRep.Preview
TestUnit1.TForm1.ReportBtnClick(???)

I do not know what TQRDBChart is for on my quickreport : mine is not data aware.

The code of the invalidate method is:

procedure TQRDBChart.Invalidate;
begin
if AutoRepaint and Assigned(Parent) then
Parent.Invalidate;
end;

So i decide to set QRDBChar1.AutoRepaint to false prior to the preview and my problem is solved.

Still a very flickering Design time chart however. I wonder if I should go back to version 7.05

Hope this helps Teemach to fix this bug. Remember: only with XPman !

regards, Wilfried

Posted: Fri Apr 28, 2006 2:42 pm
by narcis
Hi wvisser,
Still a very flickering Design time chart however. I wonder if I should go back to version 7.05
We fixed that issue with v7.07. Can you please test that the qrtee.pas unit you are using is the one shipped with v7.07 binary installers, not the one as a free download in the web?

We need to update those installers but in the mean-time you need to use that unit. Also, new TeeRecompile tool shipped with source code installer already compiles TQRChart packages with your current TeeChart and QR version.

Posted: Sat Apr 29, 2006 8:37 am
by 9345764
The QrTee.Pas in my ..TeeChartPro7\Delphi10\Quickreport folder was dated 20-2-2006. I assume this one is installed by the 7.07 binary installer. It cannot be installed by the D10 updates since it is in a separate TeeCharPro path.
The 7.07 full source has a QrTee.pas dated 10-4-2006 ! and is different on many locations.
I simply used this newer QrTee.Pas and rebuild the QRTee packages and the problem was fixed.
I presume the 7.07 binary installer does not install the correct QrTee.pas correct ?

regards,
Wilfried

Posted: Sun Apr 30, 2006 6:48 am
by 9345764
I re-tried the TQRChart without setting the AutoRepaint property to false. I then still get a Stack overflow !
I think there still is a problem with this in the 7.07 version: with the AutoRepaint option the chart paint procedure somehow gets in a recursive loop, as described in my posts above.

Posted: Mon May 15, 2006 9:00 am
by Pep
Hi,

I cannot reproduce the problem here, using the latest v7.07 sources available on our web site. Could you please check if it happens with the latest sources and if it still happening please send me a simple app. (directly to my mail account pep@steema.com) with which I can reproduce the problem here ?