Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Export to excel within the JavaScript forums, part of the Web Development category; Hi, i am designing the webpage, where i have a page with search results that are dynamic (based on some input from the user, search is performed) .. i want ...
|
|||||||
|
|||
|
Export to excel
Hi,
i am designing the webpage, where i have a page with search results that are dynamic (based on some input from the user, search is performed) .. i want to export these results to Excel.. can any body help me.. i tried the following code: var oXL = new ActiveXObject("Excel.Application"); oXL.Visible = true; // Get a new workbook. var oWB = oXL.Workbooks.Add(); var oSheet = oWB.ActiveSheet; the code is working on my local machine.. but when i tried to load the webpage on server and then tried to run from my local machine...its giving error:: Automation Server can not create object.. Please let me know...if there is any other way to export to Excel...using java script... Last edited by paritosh.garg; 12-27-2007 at 01:28 AM. |
| Sponsored Links |
|
|||
|
Re: Export to excel
Hi
I tried using your Javascript; but it did not run on local machine except opening the excel file. I tried two scripts: Is there any error in the script? regards / Prafulla |
|
|||
|
Re: Export to excel
Script 1
Function ExportToExcel() Var sHTML = document.all.item("table1").outerhtml; Var oExcel = new ActiveXObject("Excel.Application"); Var oBook = oExcel.Workbooks.Add; sHTML = oBook.HTMLProject.HTMLProjectItems("Sheet1").Text; oBook.HTMLProject.RefreshDocument; oExcel.Visible = true; oExcel.UserControl = true; End Function Script 2 function Export() { window.clipboardData.setData(”Text”,document.all(’table2').outerHTML); try{ var ExApp = new ActiveXObject(”Excel.Application”); var ExWBk = ExApp.workbooks.add(); var ExWSh = ExWBk.worksheets(1); ExApp.visible = true; ExApp.DisplayAlerts = true; }catch(e){ alert(”your computer don’t install Microsoft Excel!”) return false } ExWBk.worksheets(1).Paste; } oExcel.Visible = true; oExcel.UserControl = true; Sorry for reposting, as the script tag perhaps disallowed on the forum. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Export 'All testcases at a time' from Mercury Quality Center | Geek_Guest | Quality Center | 10 | 05-30-2009 06:56 AM |
| Can exp just export a tablespace | orion42 | Oracle | 1 | 09-26-2007 01:55 PM |
| How can I export / import the tables from one database to another | Geek_Guest | Oracle | 2 | 07-30-2007 09:22 AM |
| Use of export xml file and import xml file options | naags | QTP | 1 | 07-19-2007 02:37 PM |
| WebSphere V5.0 : Import and export | Lokesh M | Web Tools | 0 | 05-27-2006 07:26 AM |