Bug in cfspreadsheet “update”?
To those with experience with <cfspreadsheet>, I’d really appreciate your feedback. I’m trying to use the cfspreadsheet tag to generate a two page spreadsheet based on the output of two database queries. SheetOne uses "qryTopicList" and SheetTwo uses "qryTopicDetails".
Here's my code:
<cfscript>
// create empty spreadsheet objects
sheetOne = spreadsheetNew("topicList", "true");
sheetTwo = spreadsheetNew("topicDetails", "true");
// populate spreadsheet objects from queries
spreadsheetAddRows(sheetOne, qrytopicList);
spreadsheetAddRows(sheetTwo, qrytopicDetails);
</cfscript>
<!--- Write the two spreadsheet objects to a single file. --->
<cfspreadsheet action="write" filename="#theFile#" name="sheetOne" sheetname="Topic List" overwrite="true" />
<cfspreadsheet action="update" filename="#theFile#" name="sheetTwo" sheetname="Topic Details" />
When I run this code, I get an error:
java.lang.IllegalArgumentException: The maximum column width for an individual cell is 255 characters.
I tracked the error down to the last line of my code which adds sheet 2. I found that the query “qrytopicDetails” has columns with more than 255 characters in them. But I know that Excel is not limited to 255 characters per cell, so I thought this might be a java/POI/ColdFusion limitation. But then I reversed the sheet order and it worked:
<cfspreadsheet action="write" filename="#theFile#" name="sheetTwo" sheetname="Topic Details" overwrite="true" />
<cfspreadsheet action="update" filename="#theFile#" name="sheetOne" sheetname="Topic List" />
So, it seems that cfspreadsheet is able to "write" a column with more than 255 characters but cannot "update" if the query contains more than 255 characters. Is this a bug or am I missing something?
