How can I copy the contents of an asp:Table to the clipboard so that it can be pasted in something like Excel?
I assume some sort of JavaScript is required?
For winforms it is easy enough using the Clipboard object but how about for asp.net?
How can I copy the contents of an asp:Table to the clipboard so that it can be pasted in something like Excel?
I assume some sort of JavaScript is required?
For winforms it is easy enough using the Clipboard object but how about for asp.net?
The problem with browsers is that clipboard access is often a privileged access so you end up needing something like Flash.
There's a nice library out there I used a couple of times called ZeroClipboard - https://github.com/jonrohan/ZeroClipboard
A technique I saw somewhere said to open a popup, copy the data into it, pre-select it, and tell the user to press CTRL+C. Sounds silly, but it is easy for the user and doesn't require any special privileges.
I started using it in a few sites and my users LOVE it. Everything is done in jQuery. Here's a screenshot from a transaction where users wanted to copy an HTML table into Excel. Clicking on a "Export to Excel" button produces this...