Aggiungere la mappa XML all'interno della cartella di lavoro utilizzando il metodo XmlMapCollection.Add
Contents
[
Hide
]
Possibili scenari di utilizzo
Aspose.Cells fornisceXmlMapCollection.Add() metodo che puoi utilizzare per importare la tua mappa XML all’interno della cartella di lavoro.
Aggiungere la mappa XML all’interno della cartella di lavoro utilizzando il metodo XmlMapCollection.Add
Il codice di esempio seguente aggiunge la mappa XML all’interno della cartella di lavoro utilizzando ilXmlMapCollection.Add() e lo salva comefile excel di output . Lo screenshot mostra la mappa XML che è stata importata dal filecampione.xml all’interno del file excel di output.
Codice d’esempio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(AddXMLMapInsideWorkbook.class) + "articles/"; | |
// Create workbook object | |
Workbook wb = new Workbook(); | |
// Add xml map found inside the sample.xml inside the workbook | |
wb.getWorksheets().getXmlMaps().add(dataDir + "sample.xml"); | |
// Save the workbook in xlsx format | |
wb.save(dataDir + "AddXMLMapInsideWorkbook_out.xlsx"); |