Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8807
  • Last Modified:

export html to excel using javascript

How can i export a html-output directly to excel?
0
hessmac
Asked:
hessmac
1 Solution
 
CJ_SCommented:
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
 
chops123Commented:
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
 
hessmacAuthor Commented:
The data is a report containing all kind of figures percentages etc. is build with <TABLE>,<TR>'s and <TD>'s

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
chops123Commented:
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
 
ahosangCommented:
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
 
ahosangCommented:
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
 
ChmodCommented:
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now