tags:

views:

243

answers:

1

How can I import xml file to existing excel template. I have a map (xsd).

It has to be done on server. I used excelPackage , but couldnt find any documentation for the classes.

More specific question: how do I write in C# the following code from VB.NET

Dim xmlSchema As String = "c:\Schema1.xsd" 
Map = XL.ActiveWorkbook.XmlMaps.Add(xmlSchema) 
Wb.XmlImportXml(xmlStr, oMap) 
+1  A: 

There is extensive documentation and tutorials and everything on the Codeplex site for ExcelPackage:

http://excelpackage.codeplex.com/

As for your question:

  • if you have a XSD file, you can easily deserialize your XML file into an object graph
  • parse the objects as needed and insert the relevant information into a new Excel sheet based on your template

Your question is way too broad and not specific enough to be able to help with it - you'll need to make your question more specific and provide more information!

marc_s
more specific question: how do I write in C# the following code from vb: Dim xmlSchema As String = "c:\Schema1.xsd"Map = XL.ActiveWorkbook.XmlMaps.Add(xmlSchema)Wb.XmlImportXml(xmlStr, oMap)
xml