Skip to main content
Participant
Feb 21, 2023 3:36 PM UTC
Question

Formatting Excel Spreadsheet issue after upgrade to CF2021

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 is closed to new replies. Start a new post to keep the conversation going.

    6 replies

    BKBK
    Community Expert
    Community Expert
    Feb 21, 2023 6:56 PM UTC

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

     

     

     

     

    Translate
    Participant
    Feb 21, 2023 7:27 PM UTC

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

    Translate
    BKBK
    Community Expert
    Community Expert
    Feb 21, 2023 8:34 PM UTC

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

    Translate