PassTrough for TeeChart
This would have been a working function (tested it first in a regular form
and than modified it in pp/Passtrough).
But the aQry (TdaADOQueryDataView) his DataSource is empty. Might be normal
with DADE but how can i access the data from the passtrough ???
Kind Regards, Harry.
procedure TSdwRapTeeChartActualVsBudget1Function.ExecuteFunction(aParams:
TraParamList);
var
CompId : String;
aQry : TdaADOQueryDataView;
aChart : TppTeeChart;
aSeries : TChartSeries;
begin
LogIt('PieBuild', 'Start');
GetParamValue(0, aQry);
GetParamValue(1, aChart);
ShowMessage(aChart.Chart.Title.Text[0]);
LogIt('PieBuild', 'aQry', aQry);
LogIt('PieBuild', 'aQry.DataSource', aQry.DataSource);
LogIt('PieBuild', 'aQry.DataSource.DataSet', aQry.DataSource.DataSet);
while not aQry.DataSource.DataSet.Eof do
begin
LogIt('PieBuild', 'Complex_1');
LogIt('PieBuild', 'Complex_2',
aQry.DataSource.DataSet.FieldByName('COMP_ID').AsString);
if aQry.DataSource.DataSet.FieldByName('COMP_ID').AsString <> CompId
then
begin
aSeries := aChart.Chart.AddSeries(TBarSeries);
aSeries.Title :=
aQry.DataSource.DataSet.FieldByName('COMP_ID').AsString;
TBarSeries(aSeries).MultiBar := mbSideAll;
CompId :=
aQry.DataSource.DataSet.FieldByName('COMP_ID').AsString;
end;
aSeries.Add(aQry.DataSource.DataSet.FieldByName('ACTVSREVISED').AsFloat,
aQry.DataSource.DataSet.FieldByName('XMONTH').AsString);
aQry.DataSource.DataSet.Next;
end;
aChart.Chart.Legend.Visible := True;
aChart.Chart.View3D := False;
end;
and than modified it in pp/Passtrough).
But the aQry (TdaADOQueryDataView) his DataSource is empty. Might be normal
with DADE but how can i access the data from the passtrough ???
Kind Regards, Harry.
procedure TSdwRapTeeChartActualVsBudget1Function.ExecuteFunction(aParams:
TraParamList);
var
CompId : String;
aQry : TdaADOQueryDataView;
aChart : TppTeeChart;
aSeries : TChartSeries;
begin
LogIt('PieBuild', 'Start');
GetParamValue(0, aQry);
GetParamValue(1, aChart);
ShowMessage(aChart.Chart.Title.Text[0]);
LogIt('PieBuild', 'aQry', aQry);
LogIt('PieBuild', 'aQry.DataSource', aQry.DataSource);
LogIt('PieBuild', 'aQry.DataSource.DataSet', aQry.DataSource.DataSet);
while not aQry.DataSource.DataSet.Eof do
begin
LogIt('PieBuild', 'Complex_1');
LogIt('PieBuild', 'Complex_2',
aQry.DataSource.DataSet.FieldByName('COMP_ID').AsString);
if aQry.DataSource.DataSet.FieldByName('COMP_ID').AsString <> CompId
then
begin
aSeries := aChart.Chart.AddSeries(TBarSeries);
aSeries.Title :=
aQry.DataSource.DataSet.FieldByName('COMP_ID').AsString;
TBarSeries(aSeries).MultiBar := mbSideAll;
CompId :=
aQry.DataSource.DataSet.FieldByName('COMP_ID').AsString;
end;
aSeries.Add(aQry.DataSource.DataSet.FieldByName('ACTVSREVISED').AsFloat,
aQry.DataSource.DataSet.FieldByName('XMONTH').AsString);
aQry.DataSource.DataSet.Next;
end;
aChart.Chart.Legend.Visible := True;
aChart.Chart.View3D := False;
end;
This discussion has been closed.
Comments
Instead of passing the TdaQueryDataView, pass the entire pipeline. From
there you can access any of the fields in the pipeline and there for get
access to the record of your choice.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Works wonderfull, Thx