Menu

Types

Help
2005-01-25
2013-03-22
  • michal klincewicz

    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

     
    • Henk van den Berg

      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

       

Log in to post a comment.

MongoDB Logo MongoDB