TChart 4.04 --> FR3 Report

edited 11:23AM in FastReport 3.0
Greetings!

For starters I'm using BCB6 and TChart that shipped with it, TChart Standard 4.04, and FR3. I've recompiled FR3 libs for 'TChart Standard'.

I have a need to use over 30 TChart objects into various FR3 reports.

I have a TfrxPictureView component named 'SomeSillyChart' in my example.fr3 file.
To this component I want a TChart object to be drawn.

I tried this:
TfrxReport *frxReport1 = new TfrxReport(this);
frxReport1->LoadFromFile("c://example.fr3");
TfrxChartView *Chart;
Chart = (TfrxChartView*)frxReport1->FindObject("SomeSillyChart");
Chart->Chart->Assign(myChart); // This line causes access violation!
...

Now, why does the last line cause access violation? I've checked with debugger and the type cast does not return null meaning the type cast was succesful. So it's the Assign method call that causes the access violation. myChart is a valid pointer to a TChart object that has few series containing values. Apparently the myChart is not of the type that Assign method expects.

1. What type is TfrxChartView's Chart property?
2. How do I get my TChart to the report?

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 11:23AM
    first you are in the wrong forum tou should be in fr3 forum
    in fr3 you can no long assign a chart
    if your chart already exists on its own form


    new method for fr3

    use a pictureview object in the report instead and use report beforeprint event

    procedure TForm1.frxReport1BeforePrint(Sender: TfrxReportComponent);
    begin
    if Sender.Name='Picture1'then
    TfrxPictureView(Sender).Picture.Assign(form2.Chart1.TeeCreateMetafile(False,
    Rect(0, 0, Round(Sender.Width), Round(Sender.Height))));
    end;
    you will have to translate to bcb sorry
    ;)

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.