Hi Aspose. It has been a long time since I showed up here!
I have an issue that I am trying to push the client to use your product.
I have an Excel template file that has XML field mapped.
I am trying to feed that template using code.
Currently, the client is using Excel interops (which I really hate) and I am trying to replace that.
The current code is something like this:
xlsWB = app.Workbooks.OpenXML(pathTemplate)
xlsWB.XmlMaps(“Report_Map”).ImportXml(report.Data)
xlsWB.SaveAs(…)
I have tried to find something equivalent in Aspose.Cells (for .Net).
Do you support that? XmlMaps(name of my map).ImportXml(my xml data)?
@emoreau,
Aspose.Cells supports XMLMaps and ImportXML feature is also available. You may please follow the below link and write back to us if some issue is observed. XML Maps
The API Workbook.ImportXml(string url, string sheetName, int row, int col) can also update the XmlMap with same root element name as the specified xml file.
Not sure we are talking about the same thing. I am not trying to update the XmlMap. I am trying to import an XML file into a template that already has the XmlMap defined.
The thing I don’t understand is that the ImportXml method requires a row and a column. I don’t have them as they are defined by the template.
@emoreau,
We have noted your requirement and logged it in our database for a sample code. We will write back here once any update is ready for sharing.
This requirement is logged as: CELLSNET-47881 - Import XML file into workbook
Currently, the width of Column E,F of the output file is a little small. We will try to fix it.
The thing I don’t understand is that the ImportXml method requires a row and a column. I don’t have them as they are defined by the template.
The API Workbook.ImportXml(string url, string sheetName, int row, int col) can import a new XmlMap with linked data, or map/update the linked area of an exist XmlMap with same root element name as the specified xml file. When the root element name of the specifed xml file is not same as the one of any of existing XmlMap, a new XmlMap with linked data will be created at specified sheetName, row, col.
An other related question: my data in the XML is mostly decimal. Once the data is imported and the workbook saved, I see a lot of warnings in Excel showing “number stored as text”. Is there anyway to call the “Refresh Data” options from the Developer toolbar which seems to fix the issue?
My template as the correct formatting but it seems to be ignored by the ImportXML. I have also tried to create an xsd file specifying the correct format but that too failed.
The issues you have found earlier (filed as CELLSNET-47881) have been fixed in this update. This message was posted using Bugs notification tool by simon.zhao