Home Server

TeeChart Killing Yoy, Try this

edited February 2005 in Server
After a year of problems with TeeChart, upgrading Delphi, ReportBuilder &
TeeChart several times ...
These small lines of code solved my problem in my server app.
Thx Nard.

Explanation: The Server always crashed after running a report with a
TeeChart on it and switching to a 'normal' report. Runing 100 TeeCharts was
no problem, the first one without it was .... AV... As it is known that
TeeChart messes up with the creation of their components .. This code, in
the Ondestrou of the Datamodule of the server did the job.

procedure TdmSqlServer.DataModuleDestroy(Sender: TObject);
var
iLoop : Integer;
begin
iLoop := 0;
while iLoop < ComponentCount do
begin
if (Components[iLoop] is TppTeeChart)
or (Components[iLoop] is TppDPTeeChart) then
begin
Components[iLoop].Free;
end
else
Inc(iLoop);
end;
end;

I hope that if other people are encoutering this this might help them.

Comments

  • edited February 2005

    Excellent news! :)

    Thanks for sharing that tip!

    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.