Asked by:
Convert XML into Excel

Question
-
User-1569779262 posted
How Can one create Excel from XML. One more query: Can we write only certain tags in XML while creating XML? For Example:
I want to write say only 2 tags in XMLsay Name & Designation.
I am creating XML like beow:
System.Xml.Serialization.XmlSerializer serializerRA = new System.Xml.Serialization.XmlSerializer(typeof(UserBE));XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = new UnicodeEncoding(false, false);
settings.Indent = true;
settings.OmitXmlDeclaration = true;
StringWriter textWriterRA = new StringWriter();if (UserLoginList != null)
{
foreach (UserBE xUserBE in UserLoginList)
{
using (XmlWriter xmlWriter = XmlWriter.Create(textWriterRA, settings))
{
serializerRA.Serialize(xmlWriter, xUserBE);
}
}
}Monday, August 18, 2014 12:25 AM
All replies
-
User-2001332922 posted
hi
Try with data transformation services of Sequel Server
Monday, August 18, 2014 2:05 AM -
User-2001332922 posted
a uniform resource locator that seem relate to XML to Excel conversion http://forums.asp.net/t/2001688.aspx it indicates use of Open XML and A Feature of third party controls
Monday, August 18, 2014 2:45 AM -
User-2001332922 posted
hi geet
are you active?
Tuesday, September 22, 2015 2:26 AM -
User-271186128 posted
Hi geet,
From your description, if you want to convert existing xml file to excel file. You could try to use DataTable.ReadXml method to import xml file into the data table. Then, export data table to excel file.
Here are some tutorials, you could refer to them:
https://msdn.microsoft.com/en-us/library/fs0z9zxd(v=vs.110).aspx
http://www.codeproject.com/Tips/626783/Reading-XML-Data-into-a-DataTable-Using-ASP-NET
export to excel:
If you want to use the xml string. First, you could extract the relevant data and insert them into datatable, then refer to the following links to export to excel file.
Best regards,
DillionWednesday, September 23, 2015 5:47 AM