DisplayTag
  1. DisplayTag
  2. DISPL-616

Signature of class CellRangeAdress constructor method changed from old poi leads to erronous call in displaytag-poi

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 2.0
    • Component/s: Export
    • Labels:
      None
    • Application server:
      N/A

      Description

      With the old version of Apache POI we used the Region class to define merged region whose constructor method was
      new Region(firstRow, firstCol, lastRow, lastCol);

      In the new version the class to use is CellRangeAddress wich use the constructor method
      new CellRangeAddress(firstRow, lastRow, firstCol, lastCol);

      Notice the signature changed from old way to new one. The fact is in displaytag-poi-2.2 I found the erronous old signature used to build the new class.

      This would lead to a crash in the xls export of a table caption.

      This is the fix for this bug :

          /**
           * Obtain the region over which to merge a cell.
           * @param first Column number of first cell from which to merge.
           * @param last Column number of last cell over which to merge.
           * @return The region over which to merge a cell.
           */
          private CellRangeAddress getMergeCellsRegion(int first, int last)
          {
             - return new CellRangeAddress(this.currentRow.getRowNum(), first, this.currentRow.getRowNum(), last);
             + return new CellRangeAddress(this.currentRow.getRowNum(), this.currentRow.getRowNum(), first, last);
          }

      Best Regards.

        Activity

        Hide
        LusuM added a comment -
        As a proof of concept, I give you the link to an official displaytag live example which crash when asked to do an Excel export :
        http://displaytag.homeip.net/displaytag-examples-1.2/example-new-export.jsp

        root cause
        Exception: [.DefaultHssfExportView] !DefaultHssfExportView.errorexporting! Cause: The 'to' row (0) must not be less than the 'from' row (24)
        Show
        LusuM added a comment - As a proof of concept, I give you the link to an official displaytag live example which crash when asked to do an Excel export : http://displaytag.homeip.net/displaytag-examples-1.2/example-new-export.jsp root cause Exception: [.DefaultHssfExportView] !DefaultHssfExportView.errorexporting! Cause: The 'to' row (0) must not be less than the 'from' row (24)
        Hide
        fabrizio giustina added a comment -
        already fixed in svn
        Show
        fabrizio giustina added a comment - already fixed in svn

          People

          • Reporter:
            LusuM
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1 minute
              1m
              Remaining:
              Remaining Estimate - 1 minute
              1m
              Logged:
              Time Spent - Not Specified
              Not Specified