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

Formatting Excel Spreadsheet issue after upgrade to CF2021

New Here ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

Good morning, I recently upgraded from Coldfusion 2016, to 2021, with no real problems but did notice one thing that I cant seem to get a handle on. I do exporting of data though CF to build formatted spreadsheets, and since the upgrade, one thing no longer works and it is related to the setRepeatingRows. I use the "cellRangeAddress = CreateObject("java", "org.apache.poi.ss.util.CellRangeAddress");" followed by "poiSheet.setRepeatingRows(cellRangeAddress.valueOf("$1:$1"));" and get an error that says 

The setRepeatingRows method was not found.Either there are no methods with the specified method name and argument types or the setRepeatingRows method is overloaded with argument types that ColdFusion cannot decipher reliably.

Has anyone run into this and would happen to have an idea around it?

 

 

Views

454

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 ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

I would:

1. Avoid a call within a call. Split the call up into 2:

 

cellRangeAddress = createObject("java", "org.apache.poi.ss.util.CellRangeAddress").valueOf("$1:$1");

poiSheet.setRepeatingRows(cellRangeAddress);

 

 

2. Replace "$1:$1" with one of the values recommended for the arguments of valueOf() in the POI API:

 

  • valueOf

    public static CellRangeAddress valueOf(java.lang.String ref)
    Creates a CellRangeAddress from a cell range reference string.
    Parameters:
    ref - usually a standard area ref (e.g. "B1:D8"). May be a single cell ref (e.g. "B5") in which case the result is a 1 x 1 cell range. May also be a whole row range (e.g. "3:5"), or a whole column range (e.g. "C:F")

 

 

 

 

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 ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

I restructured, gave me the same error message.....

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 ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

Could you please share the code up to the point where poiSheet is defined.

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 ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

Here's the complete code, minus the queries.

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 ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

I have spent some time on the code. Unfortunately, like you, I have been unable to get it to work.

My finding so far:

/**** This line produces an error when the CellRangeAddress object is passed as an argument to setRepeatingRows() ****/
cellRangeAddress = createObject("java", "org.apache.poi.ss.util.CellRangeAddress").valueOf("A1:A3");

/**** Strangely, this line, which also results in a CellRangeAddress object, works! ****/
// cellRangeAddress = createObject("java", "org.apache.poi.ss.util.CellRangeAddress");

poiSheet.setRepeatingRows(cellRangeAddress);

I think you should report a bug. I have attached the error message I received, in case you need it.

 

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 ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

LATEST

I was kinda afraid that was going to be the case...I really appreciate you taking your time to take a look at this. Its' driving me crazy and needed a different set of eye/confirmation what was really going on.

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