Excel XML Spreadsheet: Date.Type is mandatory :)
Posted by jpluimers on 2011/07/28
When you generate Excel XML Spreadsheets, and you load it in Excel, it will report some errors in your Temporary Internet Files directory.
For instance, when you forget to fill the Data.Type attribute, then you get a log file with a message like this:
XML ERROR in Table REASON: Missing Tag FILE: V:\export.xml GROUP: Cell TAG: Data ATTRIB: Type
There seems to be no XSD for the XML Spreadsheet format, so you have to get yourself familiar with the XML in Excel and the Spreadsheet Component documentation on MSDN.
To make things more practical for myself, I perfomed these steps:
- created a spreadsheet with all of the data variations I expected
- saved this spreadsheet as XML
- generated the XSD from that XML
- imported the XSD to generate wrapper classes and interfaces
Even with that, you will need to accommodate for many peculiarities.
Hopefully I will find some time to write more those down soon.
The first is ss:Data:
- It contains the actual data of a cell
- It has a required ss:Type attribute, which is an enumeration of Number, DateTime, Boolean, String, and Error.
- When it is String, then x:Ticked should be 1 (meaning True) when the string can be parsed as non-String type (and you would type the value into excel starting with a Tick mark (‘ aka single quote or apostrophe)