Disable TeeChartDB Component
Help!
I got the DBChart component to show up for the
end user by adding ppChartUI, etc. - but now that I
changed my mind, I can NOT disable that component on the
end-user's tool bar!
Tried disabling it by removing all the teechart stuff from
uses clauses AND disabling it in the Show Components
property of the Designer. Also tried to read the components
in during 'the Report.Template.OnLoadEnd event, so I could
freee them.
However, the tech tip s example just shows how to find
objects that have a font, and I need more specific help if I
have to search for objects related to tee chart to free them
or destroy them in code ??????
Scott Stalheim
stalheim@tds.net
I got the DBChart component to show up for the
end user by adding ppChartUI, etc. - but now that I
changed my mind, I can NOT disable that component on the
end-user's tool bar!
Tried disabling it by removing all the teechart stuff from
uses clauses AND disabling it in the Show Components
property of the Designer. Also tried to read the components
in during 'the Report.Template.OnLoadEnd event, so I could
freee them.
However, the tech tip s example just shows how to find
objects that have a font, and I need more specific help if I
have to search for objects related to tee chart to free them
or destroy them in code ??????
Scott Stalheim
stalheim@tds.net
This discussion has been closed.
Comments
1. Removing the Chart related units will work. To test this try running the
RBuilder\Demos\EndUser\ReportExplore example. There is a declaration that
looks like
{x$DEFINE TeeChart}
With the x, the chart will not show, without the x the chart will
registered.
Check your application for occurences of the ppChrt, ppChrtUI, ppChrtDP
units.
2. Designer.ShowComponents. I tested this. Works for the Chart, but not the
DBChart. That is because the data-aware chart is actually called DPChart. In
the earlier days of RB, there was a DBChart that could be connected to a
dataset, but not a datapipeline. Later the datapipeline aware DPChart took
its place.
3. To iterate thru the objects you traverse the Report.Bands[].Objects[]
structure. To determine whether an object is a TeeChart you code something
like:
lObject := myReport.Bands[liBandIndex].Objects[liObjectIndex};
if (lObject is TppTeeChart) or (lObject is TppDPTeeChart) then
lObject.Free;
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Thanks. Working now, but found an oddity...
When I ran the demo and removed the x, the compiler hits an
error when it reaches the the uses declaration for ppChrtUI.
The error message is "file not found: ieditCha.dcu. I
wonder what that is all about?
I had eliminated these from the form in question, but did
not realize that they needed to be eliminated everywhere in
the application. In my case, I discovered that they were in
a couple other places where I thought they were needed but
they were not needed - so the program works fine now.
Guess I don't need to free the objects manually - perhaps i
would need to if I wanted the DBChart in some forms and not
others.
Scott
----------------------------------------------
Tech Tip: Resolving Compile Error w\TeeChart
----------------------------------------------
When using TeeChart and ReportBuilder in Delphi you will encounter this
error message upon compiling.
In order to get around it you can:
1. Build your project with packages.
2. Purchase TeeChart Pro from http://www.steema.com
The TeeChart author did not include all of the units to TeeChart in the free
version included with Delphi. (TeeMach the authors of TeeChart do not
receive any money from Borland for the inclusion of TeeChart with Delphi).
--
Tech Support mailto:support@digital-metaphors.com
Digital Metaphors http://www.digital-metaphors.com
--
Nard Moseley
Digital Metaphors
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com