Copy to Clipboard Error

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
tangone
Newbie
Newbie
Posts: 23
Joined: Tue Jun 26, 2007 12:00 am

Copy to Clipboard Error

Post by tangone » Fri May 23, 2008 3:00 am

Hi,

I am currently developing a web application using teechart for asp.net version 3.2.3016.15522.
When I click on a button to call the below event to copy the image to the clipboard so that it can be pasted at the client side:

Code: Select all

 wChart.Chart.Export.Image.Bitmap.CopyToClipboard()
I get the below error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
How do I solve this issue?

Thanks.

Stephen

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri May 23, 2008 7:59 am

Hi Stephen,

Using CopyToClipboard doesn't make sense in ASP.NET applications as it would copy the chart image into the server's clipboard. In that case you should export the chart to an image file.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply