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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Mahesh ChandRank #1 · 393.4K reputationPosted Jun 20, 2010, 8:52 AM EDT
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!
r pRank #4,639 · 333 reputationPosted Jun 20, 2010, 9:27 AM EDT
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,
Sam HobbsRank #108 · 20.5K reputationPosted Jun 20, 2010, 1:34 PM EDT
r pRank #4,639 · 333 reputationPosted Jun 28, 2010, 4:51 AM EDT
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