The spreadsheet functions appear to create empty cells that aren't really empty 
- could use some help on this..

The need has arisen to "clear" cells in certain locations to allow text in the 
cell to the immediate left to 'overflow';
Monkeying around with SpreadsheetSetCellValue('') etc., 
SpreadsheetSetCellFormula(), ClearContents have been unsuccessful - (neither is 
merge an option).


To illustrate the problem, create a spreadsheet from an empty query:

<cfscript>
        variables.qryTarget = QueryNew( 
'one,two,three,four,five','varchar,varchar,varchar,varchar,varchar');
        QueryAddRow(variables.qryTarget, 10);
        variables.spObj = SpreadsheetNew("foo");
        SpreadsheetAddRow(variables.spObj, 'one,two,three,four,five');
        SpreadsheetAddRows(variables.spObj,qryTarget);
        for (i=2;i LTE qryTarget.Recordcount; i=i+1) {
                SpreadsheetSetCellValue(variables.spObj, 'overflowoverflow 
overflowoverflow overflowoverflow overflowoverflow ', i, 1 );
        }
        variables.tempfile = GetTempDirectory() & 'foo.xls';
        // set the first col to a reasonable width
        SpreadsheetSetColumnWidth(variables.spObj,1,10);
        SpreadsheetSetColumnWidth(variables.spObj,2,10);
        SpreadsheetSetColumnWidth(variables.spObj,3,10);
        SpreadsheetSetColumnWidth(variables.spObj,4,10);
        SpreadsheetSetColumnWidth(variables.spObj,5,10);
        SpreadSheetWrite(variables.spObj, variables.tempfile, "yes");
</cfscript>
<cfdump var="#variables.tempfile#">

Then, open the spreadsheet w/Excel and place your cursor in any "empty" cell, 
ie B2 and hit "Delete"
Voila, empty cells that arent' really empty...

--
Jon





This message and any attached documents are only for the use of the intended 
recipient(s), are confidential and may contain privileged information. Any 
unauthorized review, use, retransmission, or other disclosure is strictly 
prohibited. If you have received this message in error, please notify the 
sender immediately, and then delete the original message. Thank you.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:334020
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to