Creating runtime chartSeries
Hi.
We need to create the Series of a DBChart at runtime from RAP.
We've created the RTTI classes to make this possible, but we're getting an
Acess Violation when doing the following code at RAP:
var testbar: TChartSeries;
begin
testbar := TBarSeries.Create(Report);
testbar.ParentChart := DPMyTeeChart1;
and when debuggin in delphi our code we see that the aValue has no value (it
is a variant with no value?)
here is the portion of code:
class function TPlanChartSeriesRTTI.SetPropValue(aObject: TObject;
const aPropName: string; var aValue): Boolean;
begin
Result := True;
if ppEqual(aPropName, 'ParentChart') then
TChartSeries(aObject).ParentChart := TCustomChart(aValue); //here
aValue show (No Value) in debugger
TIA.
We need to create the Series of a DBChart at runtime from RAP.
We've created the RTTI classes to make this possible, but we're getting an
Acess Violation when doing the following code at RAP:
var testbar: TChartSeries;
begin
testbar := TBarSeries.Create(Report);
testbar.ParentChart := DPMyTeeChart1;
and when debuggin in delphi our code we see that the aValue has no value (it
is a variant with no value?)
here is the portion of code:
class function TPlanChartSeriesRTTI.SetPropValue(aObject: TObject;
const aPropName: string; var aValue): Boolean;
begin
Result := True;
if ppEqual(aPropName, 'ParentChart') then
TChartSeries(aObject).ParentChart := TCustomChart(aValue); //here
aValue show (No Value) in debugger
TIA.
This discussion has been closed.
Comments
TCustomChart that the series should be a child of. Have you coded all of
this in Delphi code first, before porting it to RAP code?
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
testbar.ParentChart := DPMyTeeChart1.Chart;
and works.
We coded an chart in Delphi to know what properties and methods we need in
rap. So now we are creating the RTTI to suport this.
We can't create the reports in delphi because our reports can be done by the
end-user, so now we have a lot of customsearchpanels, classes, pass-thru
functions, and now RTTI classes.
Thanks a lot.
Valdir
Planejar Brasil