Export Teechart is oversized in DOCX
Hi,
I have a frxPictureView on a report that I use to display a chart from a Teechart component.
On the screen this looks fine. When exporting to Word, the image is about 25% too big and displays wrong.
To replicate this using Delphi, add a frxReport, frxDOCXExport, TChart and TButton to the form.
Double click the frxReport and add a frxPictureView (called Picture1).
For the button click event, add the following code:
For the frxReport1BeforePrint event, add the following code:
Now run the project and click the button. The chart appears fine on the screen.
If you click the Save button and export to Excel, the chart appears too big and is partly chopped off.
Am I doing something wrong?
Thanks.
I have a frxPictureView on a report that I use to display a chart from a Teechart component.
On the screen this looks fine. When exporting to Word, the image is about 25% too big and displays wrong.
To replicate this using Delphi, add a frxReport, frxDOCXExport, TChart and TButton to the form.
Double click the frxReport and add a frxPictureView (called Picture1).
For the button click event, add the following code:
frxReport1.ShowReport(True);
For the frxReport1BeforePrint event, add the following code:
if Sender.Name = 'Picture1' then
begin
TfrxPictureView(Sender).Picture.Assign(
Chart1.TeeCreateMetafile(False, Rect(0, 0, Round(Sender.Width), Round(Sender.Height))));
end;
Now run the project and click the button. The chart appears fine on the screen.
If you click the Save button and export to Excel, the chart appears too big and is partly chopped off.
Am I doing something wrong?
Thanks.
Comments