SpreadSheetAddRows and leading zeros
I'm using coldfusion 9 to create a spreadsheet from scratch. I'm doing this using SpreadsheetAddRows with a query. The exact same query in a cfgrid shows the leading zeros because the type in the sql statement is varchar. However, when this goes into a spreadsheet, excel strips off the leading zeros.
I've tried all of the usual stuff:
Single/Double quote in front of the value: quote shows up in the spreadsheet
Value enclosed in single/double quotes: quotes show up in the spreadsheet
Leading space: leading zeros are removed
I tried playing with the SpreadsheetFormatColumn function to format the column as text. However, the SpreadsheetAddRows method overwrites any existing formatting. I've tried using both overwrite and insert. I've even tried inserting a blank row, formatting it, and the using SpreadsheetAddRows. I can set the format after I call SpreadsheetAddRows but by then the damage is done and the zeros are gone. All I get is a text column with numbers formatted as text but missing all of their leading zeros.
If this is truly a limitation of the new spreadsheet functions then it is a serious one. It would keep me from being able to write data to any existing spreadsheet because I'd have to reformat all of the cells that are written to. Does anyone know of a way to do this???
