Click here to Skip to main content
12,882,820 members (37,240 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# C#4.0
Hi All,

I need to convert html page to excel with formatting using c#. Please help me to work on this. Or suggest me any third party tools to convert html to excel (with formatting).

Thanks in Advance,
Arunachalam M.
Posted 6-Jan-13 19:47pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Rate this: bad
Please Sign up or sign in to vote.

Solution 3

As for html to excel with formatting issue, you can see below code:
Response.Buffer = true;
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.ContentType = ""application/ms-excel";;
this.EnableViewState = false;

The "ContentType" property which the default set is text/HTML can help us a lot. And hypertext will be exported to client. If we change it to ms-excel, it will be exported as Excel format and your browser will remind you to download and store it. The property of "ContentType" includes image/JPEG, text/HTML, image/GIF and
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

What formatting ? Excel will open a CSV, so just emit your data as a CSV to create an Excel compatible download.
Arunachalam Muthukumar 7-Jan-13 2:02am
For instance, the content in html table (td) is (15,345). When this is exported to excel, it will be changed to -15,345. Thats why I am looking for the tool to export to excel with formatting.
Christian Graus 7-Jan-13 2:20am
So you put (15,345) in the column of your CSV

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170422.1 | Last Updated 7 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100