malllory.woods
06/13/2023, 2:53 PM<cfset wb = createObject("java","org.apache.poi.hssf.usermodel.HSSFWorkbook").init()/>
<cfset fontRedUnderlineBold = wb.createFont()>
<cfset fontRedUnderlineBold.setColor(createObject("java","org.apache.poi.hssf.util.HSSFColor$RED").getIndex())>
<cfset fontRedUnderlineBold.setUnderline(1)>
<cfset fontRedUnderlineBold.setBold(true)>
<cfset cellStyleCurrency = wb.createCellStyle()/>
<cfset cellStyleCurrency.setDataFormat(createObject("java","org.apache.poi.hssf.usermodel.HSSFDataFormat").getBuiltinFormat("($##,####0.00_);[Red]($##,####0.00)"))/>
<cfset cellStyleNumeric = wb.createCellStyle()/>
<cfset cellStyleNumeric.setDataFormat(createObject("java","org.apache.poi.hssf.usermodel.HSSFDataFormat").getBuiltinFormat("##,####0.00"))/>
<cfset cellStyleBGYellow = wb.createCellStyle()/>
<cfset cellStyleBGYellow.setFillForegroundColor(createObject("java","org.apache.poi.hssf.util.HSSFColor$LIGHT_YELLOW").getIndex())/>
<cfset cellStyleBGYellow.setFillPattern(cellStyleBGYellow.SOLID_FOREGROUND)/>
The code above works just fine until we get to the last line which used to set the foreground. When this is run this error appears:
Element SOLID_FOREGROUND is undefined in CELLSTYLEBGYELLOW.
So, this used to work in 3.12 but now doesn't in 3.17. I have been trying to search on what has changed but so far have come up empy.
Has anyone else experienced this?cfsimplicity
06/13/2023, 3:15 PM<cfset cellStyleBGYellow.setFillPattern(cellStyleBGYellow.getFillPattern()[ "SOLID_FOREGROUND" ])/>
bdw429s
06/13/2023, 4:22 PM