How can I set the data type in a cell without having to first parse through my Strings to determine whether they are Date() Number() ect? It is a real pain that the setXLDataType method is protected. Gr. Makes me want to decompile your code.
Michal
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The setXLDataType method is protected because it simplifies the (public) interface of the Cell-class. And, most important, it is protected to prevent non-validating xml. For instance, if you were to set the XLDataType independent of the kind of data in the data-element you could accomplish something like:
<Data ss:Type="DateTime">foo</Data>
causing Excel not to open the spreadsheet because of 'Problems during load'. Try it.
Offcourse, if you are willing to take the risk of producing non-validating xml, you are free to rewrite the SSCell-class source code.
ys,
Gendan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How can I set the data type in a cell without having to first parse through my Strings to determine whether they are Date() Number() ect? It is a real pain that the setXLDataType method is protected. Gr. Makes me want to decompile your code.
Michal
Dear Michal,
The setXLDataType method is protected because it simplifies the (public) interface of the Cell-class. And, most important, it is protected to prevent non-validating xml. For instance, if you were to set the XLDataType independent of the kind of data in the data-element you could accomplish something like:
<Data ss:Type="DateTime">foo</Data>
causing Excel not to open the spreadsheet because of 'Problems during load'. Try it.
Offcourse, if you are willing to take the risk of producing non-validating xml, you are free to rewrite the SSCell-class source code.
ys,
Gendan