Recent

Author Topic: Outputing the TAchart to existing MS word document  (Read 2966 times)

wtw0803

  • Newbie
  • Posts: 2
Outputing the TAchart to existing MS word document
« on: April 10, 2018, 12:13:40 pm »
i have been having a problem of exporting a TA chart to a existing MS word document.
i am a noob when it comes to programming. Is there an easy way of doing so ?
Any help regarding the problem will be appreciated.
thank you very much for the attention:)

ccrause

  • Hero Member
  • *****
  • Posts: 845
Re: Outputing the TAchart to existing MS word document
« Reply #1 on: April 10, 2018, 01:58:35 pm »
You can start by copying to clipboard as bitmap or save to file (several formats supported):
Code: Pascal  [Select][+][-]
  1.   Chart1.CopyToClipboardBitmap;
  2.   Chart1.SaveToFile(TPortableNetworkGraphic, 'chart.png');
I'm sure there are several different ways of doing this, this is just to get you started.

wp

  • Hero Member
  • *****
  • Posts: 11857
Re: Outputing the TAchart to existing MS word document
« Reply #2 on: April 10, 2018, 04:19:02 pm »
Look at the demos "save", "wmf" or "fpvetorial" in the folder (lazarus)/components/tachart/demo/save of your Lazarus installation.

If you are on Windows only I'd recommend the wmf export which is well-understand by Word. See the "wmf" demo. You can even copy the chart to the clipboard as a metafile. But note: Since wmf support is Windows-only the required package TAChartWMF is not installed by default (Select menu "Package" > "Install/Uninstall packages", find TAChartWMF in the right list of packages "available for installation", Click "Install selection", then "Save and rebuild IDE" -- this takes some time after which Lazarus restarts with the new package installed.).

wtw0803

  • Newbie
  • Posts: 2
Re: Outputing the TAchart to existing MS word document
« Reply #3 on: April 10, 2018, 04:55:59 pm »
Thanks for all the replies!
They are very useful and really helped me :)

 

TinyPortal © 2005-2018