TChart 4.04 --> FR3 Report
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:
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?
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
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