I'm using Fast Reports 4.13.1. I need to display a number of charts on my summary band, and I'm trying to dynamically create them in OnBeforePrint
event handler of the band. The problem is, while the charts are created correctly, the series don't show the data I'm adding to them. Here's my OnBeforePrint
event:
var
dsSections,
dsTests,
dsHistory: TfrxDataSet;
Chart: TfrxChartView;
ChartCount: Integer;
begin
dsSections := Report.GetDataSet('frdTestSections');
dsTests := Report.GetDataSet('frdResults');
dsHistory := Report.GetDataSet('frdTestHistory');
ChartCount := 0;
dsSections.First;
while not dsSections.Eof do
begin
dsTests.First;
while not dsTests.Eof do
begin
if dsHistory.RecordCount > 0 then
begin
Chart := TfrxChartView.Create(rsHistory);
Chart.Left := (ChartCount mod 2) * 8 + 1;
Chart.Top := (ChartCount div 2) * 5 + 0.5;
Chart.Width := 8;
Chart.Height := 5;
Chart.Chart.Title.Text.Text := dsTests.Value('Name');
Chart.Chart.View3D := False;
Chart.AddSeries(csLine);
dsHistory.First;
while not dsHistory.Eof do
begin
ShowMessage(dsTests.Value('Name') + #13#10 + IntToStr(dsHistory.RecNo + 1) + ' ' +dsHistory.Value('Result')); // this is for debugging only
Chart.Series[0].Add(dsHistory.Value('Result'), IntToStr(dsHistory.RecNo + 1), clBlue);
dsHistory.Next;
end;
Inc(ChartCount);
end;
dsTests.Next;
end;
dsSections.Next;
end;
end;
What am I missing? Is there any property of TfrxChartView
I should set that I'm ommiting?