FR and TeeChart

edited 4:15AM in FastReport 3.0
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.

Comments

  • edited 4:15AM
    Create a chart in the Delphi code. Put the empty Picture object into a report and write the following TfrxReport.OnBeforePrint handler:

    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;
  • edited 4:15AM
    OK, thanks, it is little bit diffrent from Qreport but is working.

    I will order FastReport, it is good tool.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.