I am coding on Luce 6.1.1.118 with cfspreadsheet i...
# lucee
d
I am coding on Luce 6.1.1.118 with cfspreadsheet installed and properly generating files. There is one export where I am having a difficult time with cells formatted in my xls template as currency alerting that there are 'Numbers stored as text' in the currency cell. Clicking into the cell and out of the cell clears the error and displays the currency properly. I have tried multiple times to cast the number as a double or bigdecimal, I've wrapped the number in Val(), but I still can't get the number to be accepted as a number in the resulting spreadsheet. My hope in sharing this is that someone else has had this issue but I don't mind being a pioneer and providing more information. Do you think I should focus on the template.xls file that is read in next? I've tried explicitly setting the cellformat, but it remains the same result.
z
Try 6.2 we did a lot of improvements with our java integration and testing against CF spreadsheet
👍 1
c
When you use spreadsheetAddRows() you can specify the data type for the columns, try setting that to numeric
c
I think @zackster was referring to the spreadsheet-cfml library rather than the cfspreadsheet extension, which I assume is what you're using @David Johnson? If you can't get the extension to work then you could give the library a go. It's more up to date, has more features, and (as Zac says) faster. It will happily co-exist with the extension if you have existing working spreadsheet code that you don't want to change (although it's not hard to switch).
d
Chase: The template is read in as a spreadsheet, no usage of spreadsheetAddRows exists, but I have tried to format the cell directly. cfsimplicity: Thanks! I've seen the library and will be giving it a try. The currency format in the export is not a deal-breaker, so other priorities would be addressed first, but I look forward to getting to it.
c
Sorry I'm confused, are you reading in the template.xls, then doing some manipulation to the file, then re-downloading it?
Have you tried setting the dataformat in spreadsheetFormatCell()
z
@cfsimplicity ah good point, https://github.com/Leftbower/cfspreadsheet-lucee-5/ hasn't been updated in7 years I'd highly recommend anyone using it to migrate to https://github.com/cfsimplicity/spreadsheet-cfml it's very actively maintained(tm) with extensive test cases otherwise, you are just battling tech debt and missing out on all the good new stuff
👍 3
d
Chase, yes! I read in template.xls, then add some data, then save it out as a new file for downloading. I have tried multiple dataFormat ways. Even when the syntax is accepted, the Number stored as text problem remains. Today I am going to implement cfsimplicity and see how it responds.
c
@David Johnson If you run into any issues with spreadsheet-cfml just let me know.
d
I sure will, but so far, no problems! I've installed (it was a little tricky to glom that the folders and files had to be in the same spreadsheet folder but I should have assumed that) but now there are exports happening successfully. I'm off to tackle some other bug cards.
👍 1