3 Replies Latest reply on Feb 14, 2011 3:14 PM by endelt260

    Exporting to excel - max rows?

    meetoblivion

      Ran into a production issue today.


      Log states





      Caused by: org.jboss.seam.excel.ExcelWorkbookException: Excel only supports 255 rows
              at org.jboss.seam.excel.jxl.JXLExcelWorkbook.nextRow(JXLExcelWorkbook.java:130)
              at org.jboss.seam.excel.jxl.JXLExcelWorkbook.addCell(JXLExcelWorkbook.java:273)
              at org.jboss.seam.excel.jxl.JXLExcelWorkbook.addItem(JXLExcelWorkbook.java:505)
              at org.jboss.seam.excel.ui.UIColumn.encodeBegin(UIColumn.java:80)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
              at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
              at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
              at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)


      So I guess this is the first time they tried with a larger result set.  Is there a way to configure the size of excel files so they can take more than 255 rows?

        • 1. Re: Exporting to excel - max rows?
          kragoth

          Hmm, I wonder if someone got the max number of rows and columns confused in the Seam code.


          Excel supports:
          65,536 rows
          256 columns


          So.... 255 rows seems wrong. :)


          You may need to raise a JIRA for this.

          • 2. Re: Exporting to excel - max rows?

            Did a JIRA get opened for this?  Just got this error w/ 2.2.0.GA

            • 3. Re: Exporting to excel - max rows?

              Upon further review, I think the bug might just be just in the text of the error.  Found this in org.jboss.seam.excel.jxl.JXLExcelWorkbook.java (2.2.0.GA)




                  /**
                   * Moves the row pointer to the next row. Used internally when adding data
                   * 
                   */
                  private void nextRow() {
                      if (log.isTraceEnabled()) {
                          log.trace("Moving from row #0 to #1", currentRowIndex,
                                  currentRowIndex + 1);
                      }
                      currentRowIndex++;
                      if (currentRowIndex >= MAX_ROWS) {
                          throw new ExcelWorkbookException(Interpolator.instance()
                                  .interpolate("Excel only supports {0} rows", MAX_COLUMNS));
                      }
                  }



              Where MAX_COLUMNS is 255 and MAX_ROWS is 65535.