tracker issue : CF-4198484

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

Cfspreadsheet formatting is broken

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): tair paz / tair paz ()

Created: 04/05/2017

Components: Document Management, Office Integration

Versions: 2016,11.0,2018

Failure Type: Non Functioning

Found In Build/Fixed In Build: 2016.0.03.300466 / 2018.0.0.311568

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Windows 7 64-bit

Vote Count: 0

Problem Description: Cfspreadsheet formatting functions do not work correctly in cf16 version.  For example when you apply the styles to the rows and columns within the same rows the styles for the rows break. Image is attached. Also when variables indicating the row numbers are used in the scripts the formatting breaks as well (check the does not work comments sections in the code). The same functions worked properly in CF10. The issues occurred when the application got upgraded to cf16. The images of the outcomes for cf10 and cf16 are attached.

Steps to Reproduce:<cfscript>

    s = SpreadsheetNew("mysheet","yes");
    rownum = 1;

    SpreadsheetAddRow(s, "My title", rownum, 7);

    //does not work

	SpreadsheetAddRow(s, ",533 data,533 + Weekly,Other Misc Costs,Cost Adjustment,ITD Cost (No In House Tax), In House Tax,Accrued Hrs,Prev Assessed Amt (No In House Tax),Prev Assessed Hrs");

	 //does not work

	formatDollar= StructNew();
	formatDecimal= StructNew();
	//formatDollar.dataformat= "$##,##0.00_);[Red]($##,##0.00)";


	SpreadsheetAddRow(s,"My Total,200,300,400,500,600,700,800,900,1000");
	//does not work

    SpreadsheetFormatCellRange(s,formatDollar, 3,3,4,7);

	for ( i=1; i LE 10; i = i+1) {

<cfheader name="content-disposition" value="attachment; filename=TotalsRpt.xlsx">

<cfcontent type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" variable="#spreadsheetReadBinary(s)#">

Actual Result:
 Image is attached

Expected Result:
Image is attached

Any Workarounds:
Not to use cfspreadsheet functions


  1. April 05, 2017 00:00:00: AssmtGrandTotalRpt(28).xlsx
  2. April 05, 2017 00:00:00: TotalsRpt.xlsx


Users can avoid the formatting issue by using the following jmv argument: -Dcoldfusion.format.cellwise=true Alternatively styleCellwise can be set to true in the formatting struct passed to format the spreadsheet object. eg. {fontsize=10, styleCellwise=cellWiseBool}
Comment by Piyush K.
30982 | July 01, 2019 09:45:52 AM GMT