2

Is there any tool that can export a dynamically generated html to excel in c sharp?

user673453
  • 167
  • 1
  • 4
  • 16

3 Answers3

1

why do u want to write functionality that already exists. mean excel has it, u can import any web page (just to note excel uses IE engine to render tags). here are steps how it can be achieved.

Open excel; go to Data Tab; click From Web;

New Web Query child window opens.

write into Address Bar and go to the web page u wan to import.

after page loads into the window click import button

that's all.

(i assumed u are using ms office 2007, if diff version, diff steps)

just one more note. ms office uses IE rendering engine, so not all tags are supported, so if it looks ugly, do not blame me ;)

Nika G.
  • 2,374
  • 1
  • 17
  • 18
1

see Create Excel (.XLS and .XLSX) file from C#

Community
  • 1
  • 1
woggles
  • 7,444
  • 12
  • 70
  • 130
0

I'm not sure how you want to export html to Excel. In Excel we are talking about rows and columns while html is a document. You would probably want to export html to Word or pdf.

In any case, for creating Excel files in C# I've used the following 2 libraries: http://www.codeproject.com/KB/office/biffcsharp.aspx and http://code.google.com/p/excellibrary/

Tudor Carean
  • 972
  • 2
  • 12
  • 22
  • I want to export a html report to excel such that the excel report will have the same format as that of the html report. I was able to export the html report but the format is not as required – user673453 Jul 07 '11 at 09:14
  • How does this html document look like? I assume it's a table, or something that can be transformed into a table... – Tudor Carean Jul 07 '11 at 09:26
  • the html consists of an outer table and four tables within this outer table. The first inner table have three columns, the 2nd table have two columns the 3 table can have any number of columns which is decided at run time and the 4th table have three columns. – user673453 Jul 07 '11 at 09:29