• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Unable to find a constructor for class org.apache.poi.xssf.usermodel.XSSFDataValidationHelper

New Here ,
Sep 22, 2022 Sep 22, 2022

Copy link to clipboard

Copied

Hello,

I have recently updated coldfusion from 2016 to 2021, before update I used following code to write an excel file with cells containig dropdown list

 

<!--- Create an instance of a new spreadsheet --->
<cfset spreadsheet = spreadsheetNew("My Spreadsheet", true)>

<!--- we need all this so we can have dropdowns --->
<cfset workbook = spreadsheet.getWorkBook()>
<cfset worksheet = workbook.getSheet("My Spreadsheet")>
<cfset dataValidationConstraint = createObject("java","org.apache.poi.xssf.usermodel.XSSFDataValidationConstraint")>
<cfset cellRangeList = createObject("java","org.apache.poi.ss.util.CellRangeAddressList")>
<cfset dataValidationHelper = createObject("java","org.apache.poi.xssf.usermodel.XSSFDataValidationHelper").init(worksheet)>

<!--- Define cell list rowstart, rowend, column start, column end --->
<cfset list = cellRangeList.init(0, 0, 0, 0)>
<cfset dvconstraint = dataValidationHelper.createExplicitListConstraint(["YES","NO"])>
<cfset dataValidation = dataValidationHelper.createValidation(dvconstraint, list)>
<cfset dataValidation.setSuppressDropDownArrow(true)>

<!--- add it to the spreadsheet --->
<cfset worksheet.addValidationData(dataValidation)>

<!---write file--->
<cfspreadsheet action="write" name="spreadsheet" filename="test.xlsx" format="csv" overwrite="true">

 

On CF 2016 this script worked fine, now on 2021 version I have the following error:

Unable to find a constructor for class org.apache.poi.xssf.usermodel.XSSFDataValidationHelper that accepts parameters of type ( org.apache.poi.xssf.usermodel.XSSFSheet )

 

My 2021 installation is:

- Version: 2021.0.04.330004

- JVM: jdk-11.0.16

 

Has someone any suggestions to let work the same script also on 2021 version?

 

Thanks

 

Views

209

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 24, 2022 Sep 24, 2022

Copy link to clipboard

Copied

Yes, that is likely to be a bug. Please report it in Adobe Tracker..

 

As you can see from XSSFDataValidationHelper's API, it definitely has a constructor of type org.apache.poi.xssf.usermodel.XSSFSheet. Please mention this in your bug ticket.

 


@RiccardoArea wrote:

 

Has someone any suggestions to let work the same script also on 2021 version?

 

 


 

In my opnion, the only recourse is for Adobe's ColdFusion Team to urgently fix it. I say this because it is a fundamental problem.  

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 24, 2022 Sep 24, 2022

Copy link to clipboard

Copied

Thanks @BKBK, as you suggested I have reported it in Adobe Tracker, here the link of the report

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 24, 2022 Sep 24, 2022

Copy link to clipboard

Copied

LATEST

Thanks. I have added a comment to the ticket and voted to have it fixed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation