 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Analian Guest
|
Posted: Tue Mar 29, 2005 7:06 pm Post subject: TChart to clipboard |
|
|
I've got a TChart object which I want to copy to the clipboard so I could be
able to paste it in office applications.
The straightforward
Clipboard()->Assign(Chart1);
simply ends with a "Cannot assign a TChart to TClipboard" exception. What
can I do? Thank you.
|
|
| Back to top |
|
 |
François Charton Guest
|
Posted: Tue Mar 29, 2005 11:09 pm Post subject: Re: TChart to clipboard |
|
|
"Analian" <analian (AT) mail (DOT) bg> a écrit dans le message de news:
[email]4249a758 (AT) newsgroups (DOT) borland.com[/email]...
| Quote: | I've got a TChart object which I want to copy to the clipboard so I could
be
able to paste it in office applications.
The straightforward
Clipboard()->Assign(Chart1);
simply ends with a "Cannot assign a TChart to TClipboard" exception. What
can I do? Thank you.
|
TClipboard "knows" only a few formats : mostly text and images. As such, it
cannot hold a TChart. This is the reason for your exception.
However, TChart objects can be exported to the clipboard either as bitmaps
(BMP) or metafiles (WMF or EMF).
Use the functions
Chart->CopyToClipboardBitmap() or
Chart->CopyToClipboardMetafile(bool enhanced)
(if enhanced=true, you export it as an EMF, if false, as a WMF)
This will allow you to export it as images, which can be more or less
resized in Office applications.
If you want to export the chart as an Excel or Word graph, then pasting in
the clipboard will not work. You need to do it all using Ole calls, (or the
TExcel components). This is not very difficult, but a bit tedious. However,
it allows one to transfer a chart as an excel (or word, or powerpoint)
chart, which the user will be able to modify)
Hope this helps
Francois
|
|
| Back to top |
|
 |
Analian Guest
|
Posted: Thu Mar 31, 2005 8:24 am Post subject: Re: TChart to clipboard |
|
|
I was curios about exporting to Office applications but it doesn't matter
any more. BMP and EMF's fine. Thank you for helping.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|