[Javascript] table to excel in javascript
Paul Novitski
paul at juniperwebcraft.com
Fri Nov 10 12:25:21 CST 2006
At 11/10/2006 02:01 AM, vijaykumar bavareddy wrote:
>How to create MS-Excel file in javascript and paste table or grid
>data.. please help in this regard..
Vijay,
Here's my guess of what you intend: to copy a table of data from a
web page and paste it into Excel.
I don't think it's possible for JavaScript to copy data to the
clipboard of the client computer.
I was going to say that JavaScript can't launch a client-side
application, but on second thought I guess this is possible by
specifying the complete path of an existing .xls file on the local
computer. The operating system or browser might require the user to
confirm the launch with a dialog, so the process wouldn't be transparent.
However, once the Excel file has been launched, JavaScript, which
operates only within the browser window, will not be able to effect a
paste operation into Excel.
Neither can you output a CSV file on the client computer using
JavaScript, for similar security reasons.
I'd say your best bet would be to use a language such as PHP to
generate a file on the server in a format that Excel can read, like CSV or XLS.
Regards,
Paul
More information about the Javascript
mailing list