Add XML Map inside the Workbook using XmlMapCollection.Add method
Possible Usage Scenarios
Aspose.Cells provides XmlMapCollection.Add() method which you can use to import your XML Map inside the workbook.
Add XML Map inside the Workbook using XmlMapCollection.Add method
The following sample code adds XML Map inside the workbook using the XmlMapCollection.Add() method and saves it as output excel file. The screenshot shows the XML Map that has been imported from the sample.xml inside the output excel file.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Create workbook object | |
Workbook wb = new Workbook(); | |
// Add xml map found inside the sample.xml inside the workbook | |
wb.Worksheets.XmlMaps.Add(dataDir + "sample.xml"); | |
// Save the workbook in xlsx format | |
wb.Save(dataDir + "output_out.xlsx"); |