Click here to Skip to main content
15,878,814 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello every1

i have an excel file and i want to export it to html as per our client requirement. how can i do it without using office interop.


thank you in advance.
Posted

There are .net libabries (even free) out there (google will help) that can read xls and/or xlsx.
For example this one: http://exceldatareader.codeplex.com/[^], that can read borth, but no formatting as I see.

Choosing the right one depends on how exactly this export should be performed (only content matters, or you need to follow exact styling), and what exactly this excel file contains (only data and formulas, or are there any external references, or are there even embedded objects).

I think if you have embedded objects, you will not be able not avoid using Excel or some other excel-compatible spreadsheet editor interop - or you will have to code a lot.
 
Share this answer
 
Convert the file to csv, the split it on commas into an string array.

Add the elements from your array to your html file.
 
Share this answer
 
Comments
Adam R Harris 20-Dec-12 13:28pm    
He wants to do it without the interops i.e. Excel not installed on the server.
If he can get the files as a csv instead of .xsl then your solution would work.
Jagdish.rkl 20-Dec-12 13:34pm    
Thanks Dino and Thanks Adam.
can any one of you just provide a sample code for me. i am new to asp.net. i dont know how to do this.

Thanks in advance
DinoRondelly 20-Dec-12 14:59pm    
Code sample for?
I am not sure how your going to deal with the file if you dont have excel sorry, your going to have to research that a little more then i can right now.
Thanks to all of you for your prompt response to me. i am unable to solve it yet. what i have decided is to read the data from the excel through oledb and convert it into xml. later on make that xml display as html. i have got success in converting excel to xml but no success with xml to html.

Thank you all
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900