Hi,
Can anyone help me to covert an XML file to Excel using C# and ASP.NET, please?
If Microsoft Office is not installed in my client's machine will the XSLT convert from XML to Excel?
Thanks
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
r pPosted Jun 28, 2010, 8:51 AM
Hi,
Recently I had a chat with a friend and he suggested me to use Open XML.
He says, in this case you don't have to install Office in the server or in client's machine.
I did not try it.
Please see the following links:-
http://openxmldeveloper.org/articles/4283.aspx
http://msdn.microsoft.com/en-us/library/aa338205(office.12).aspx
http://en.wikipedia.org/wiki/Office_Open_XML
Thanks
Sam HobbsPosted Jun 20, 2010, 5:34 PM
r pPosted Jun 20, 2010, 1:27 PM
I am going through different articles in C# corner. I could not find the right one.
I am doing this for a web application.
Suppose the user does not have Microsoft Excell installed in his machine, if I develop my web application using Office Interop will my website work without any problem? I am still searching for an example.
Thanks,
Mahesh ChandPosted Jun 20, 2010, 12:52 PM
You can use OfficeInterop API to load XML file in XML API classes (XmlDocument, XmlReader etc) and then use Excel objects to convert it to an Excel sheet. See Office Interop section of C# Corner (left side bar on home page) for more details. For this, you must have to install Office Interop DLL on the machine.
Other option can be, load your XML into a DataGrid object (in-memory) and then use DataGrid to export to Excel. Search this site for keyword Export DataGrid to Excel to get some samples on this.
Cheers!