tracker issue : CF-4206253

select a category, or use search below
(searches all categories and all time range)
Title:

SpreadsheetFormatCell seems to not support underline?

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Tobias R. / ()

Created: 12/04/2019

Components: Document Management, Spreadsheet

Versions: 2018

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: 2018.0.06.316308 / 2020.0.0.317648

Priority/Frequency: Normal / Unknown

Locale/System: English / Mac 10 All

Vote Count: 0

Problem Description:
If you attempt to pass an underline setting in the format structure sent to the function, it throws an error, whether it is true or false.

Steps to Reproduce:

Code example:

<cfscript>
	spreadsheetForBug = spreadsheetNew('BugTest');
	cellFormat= { color="red", bold=true};
	try {
		SpreadsheetFormatCell(spreadsheetForBug,cellFormat,1,2);
		writeoutput('Formatted cell with options #serializeJSON(cellFormat)#');
	}
	catch(any e) {
		writeoutput('Could not format cell with options #serializeJSON(cellFormat)#' & '<br />');
		writeoutput(e.cause.type & '<br />');
		writeoutput(e.cause.message & '<br />');
	}
</cfscript>
<br /><br />
<cfscript>
	spreadsheetForBug = spreadsheetNew('BugTest');
	cellFormat= { color="red", bold=true,underline=false };
	try {
		SpreadsheetFormatCell(spreadsheetForBug,cellFormat,1,2);
		writeoutput('Formatted cell with options #serializeJSON(cellFormat)#');
	}
	catch(any e) {
		writeoutput('Could not format cell with options #serializeJSON(cellFormat)#' & '<br />');
		writeoutput(e.cause.type & '<br />');
		writeoutput(e.cause.message & '<br />');
	}
</cfscript>
<br /><br />
<cfscript>
	spreadsheetForBug = spreadsheetNew('BugTest');
	cellFormat= { color="red", bold=true,underline=true };
	try {
		SpreadsheetFormatCell(spreadsheetForBug,cellFormat,1,2);
		writeoutput('Formatted cell with options #serializeJSON(cellFormat)#');
	}
	catch(any e) {
		writeoutput('Could not format cell with options #serializeJSON(cellFormat)#' & '<br />');
		writeoutput(e.cause.type & '<br />');
		writeoutput(e.cause.message & '<br />');
	}
</cfscript>

Actual Result:

Formatted cell with options {"COLOR":"red","BOLD":true} 

Could not format cell with options {"COLOR":"red","BOLD":true,"UNDERLINE":false}
java.lang.ClassCastException
class coldfusion.runtime.CFBoolean cannot be cast to class java.lang.String (coldfusion.runtime.CFBoolean is in unnamed module of loader coldfusion.bootstrap.BootstrapClassLoader @5da13494; java.lang.String is in module java.base of loader 'bootstrap')


Could not format cell with options {"COLOR":"red","BOLD":true,"UNDERLINE":true}
java.lang.ClassCastException
class coldfusion.runtime.CFBoolean cannot be cast to class java.lang.String (coldfusion.runtime.CFBoolean is in unnamed module of loader coldfusion.bootstrap.BootstrapClassLoader @5da13494; java.lang.String is in module java.base of loader 'bootstrap')

Expected Result:
Formatted cell with options {"COLOR":"red","BOLD":true} 

Formatted cell with options {"COLOR":"red","BOLD":true, "UNDERLINE":true} 

Formatted cell with options {"COLOR":"red","BOLD":true, "UNDERLINE":false} 

Any Workarounds:
Enclosing "true" in quotes prevents the error, but this is not necessary with the bold setting.

Attachments:

Comments: