Solved

export html to excel using javascript

Posted on 2002-05-28
7
8,786 Views
Last Modified: 2007-12-19
How can i export a html-output directly to excel?
0
Comment
Question by:hessmac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 22

Accepted Solution

by:
CJ_S earned 100 total points
ID: 7038652
You have to do that using the contenttype, unfortunately you cannot set that from the html's point of view. Can you use a serverside language like asp?

if so, it is rather easy. just add the following code before you write anything else out:
response.contenttype="application/vnd.ms-excel"

CJ
0
 
LVL 2

Expert Comment

by:chops123
ID: 7043782
IE 6 has an option under the right-click menu saying
Export to Microsoft Excel.

Maybe you can try that out.

Programatically one would export to Excel only if the data in the HTML file is in a spread-sheet format.But the same also contains HTML tags.

What is the nature of the data you need to export ?

KC
0
 

Author Comment

by:hessmac
ID: 7047088
The data is a report containing all kind of figures percentages etc. is build with <TABLE>,<TR>'s and <TD>'s

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:chops123
ID: 7048343
Your data will not be in a spreadsheet format when simply exporting directly..

Have you tried the IE 6 feature of exporting to excel.

If that doesnt work,you may have to parse your HTML file,select each value required from <TD>'s and enter them in specific cells in the Excel sheet

Rgds
KC
0
 
LVL 12

Expert Comment

by:ahosang
ID: 8263215
This question has been abandoned. I will make a recommendation to the moderators on its resolution in a week or so. I appreciate any comments that would help me to make a recommendation.
 
In the absence of responses, I may recommend DELETE unless it is clear to me that it has value as a PAQ. Silence = you don't care
 
ahosang
0
 
LVL 12

Expert Comment

by:ahosang
ID: 8356814
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

split - CJ_S/chops123
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
ahosang
EE Cleanup Volunteer
0
 

Expert Comment

by:Chmod
ID: 8404935
As recommended

Points for chops123 at http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20597735.html

Chmod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question