FR and TeeChart
Hi, I'm testing demo FR 3 with teechart and have problem
on form I have
frxChartObject1: TfrxChartObject;
frxReport1: TfrxReport;
procedure Test;
var
s : TLineSeries;
begin
s := TLineSeries.Create(nil);
s.LinePen.Width := 1;
s.AddXY(1,1); s.AddXY(3,1); s.AddXY(5,4); s.AddXY(7,-1);
s.ParentChart := (frxReport1.FindObject('Chart1') as TfrxChartView).Chart;
with (frxReport1.FindObject('Chart1') as TfrxChartView) do begin
chart.Foot.Text.Add('Title is OK');
end;
frxReport1.ShowReport();
s.free;
end;
But on preview there is blank chart there.
What I'm doing wrong, Is there other component or ... ?
thx.
on form I have
frxChartObject1: TfrxChartObject;
frxReport1: TfrxReport;
procedure Test;
var
s : TLineSeries;
begin
s := TLineSeries.Create(nil);
s.LinePen.Width := 1;
s.AddXY(1,1); s.AddXY(3,1); s.AddXY(5,4); s.AddXY(7,-1);
s.ParentChart := (frxReport1.FindObject('Chart1') as TfrxChartView).Chart;
with (frxReport1.FindObject('Chart1') as TfrxChartView) do begin
chart.Foot.Text.Add('Title is OK');
end;
frxReport1.ShowReport();
s.free;
end;
But on preview there is blank chart there.
What I'm doing wrong, Is there other component or ... ?
thx.
Comments
procedure TForm1.frxReport1BeforePrint(Sender: TfrxReportComponent);
begin
if Sender.Name = 'Picture1' then
TfrxPictureView(Sender).Picture.Assign(
Chart1.TeeCreateMetafile(False,
Rect(0, 0, Round(Sender.Width), Round(Sender.Height))));
end;
I will order FastReport, it is good tool.