Page 1 of 1

Copy to Clipboard Error

Posted: Fri May 23, 2008 3:00 am
by 13045688
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

Posted: Fri May 23, 2008 7:59 am
by narcis
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.