So it seems the culprit is creating a spreasheet from a query with 
SpreadsheetAddRows().
Rows created by QueryAddRow() although empty, are not 'blank' in Excel's 
opinion.

In this case, I needed some blank spreadsheet rows to inject long overflowing 
strings, inbetween the rows of source query data.
I would have used SpreadsheetAddRows() to loop through the whole thing, except 
that some fields need to contain comma-delimited strings - adding unwanted 
columns in the process. Another workaround in this case would be to find a way 
to escape the commas.




-----Original Message-----
From: Leigh [mailto:cfsearch...@yahoo.com]
Sent: Friday, May 28, 2010 10:03 AM
To: cf-talk
Subject: RE: Spreadsheet manipulation - clearing/deleting cell contents


If you want A1 to overflow into B1, then do not set anything for B1. For 
example, notice how this code sets a value for A1 and C1, but skips B1? As long 
as you do not touch the adjacent cell (B1), it will be considered blank. So any 
text to the left of it will overflow into that cell.

<cfscript>
   cfSheet = SpreadsheetNew("foo");
   SpreadsheetSetCellValue(cfSheet, 'this text should overflow', 1, 1);
   SpreadsheetSetCellValue(cfSheet, 'short text', 1, 3);
   saveToFile = ExpandPath("test-blank-cell.xls");
   SpreadsheetWrite(cfsheet, saveToFile, true);
   WriteOutput("Saved file: "& saveToFile &"<br>"); </cfscript>









~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334087
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to