Skip to main content
New Participant
February 21, 2023
Question

Formatting Excel Spreadsheet issue after upgrade to CF2021

  • February 21, 2023
  • 1 reply
  • 1055 views

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?

 

 

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    February 21, 2023

    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")

     

     

     

     

    New Participant
    February 21, 2023

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

    New Participant
    February 22, 2023

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


    Here's the complete code, minus the queries.