Grid export to XLS problem

Help
2009-04-13
2012-12-13
  • Jacek Uznanski

    Jacek Uznanski - 2009-04-13

    Hi,
    when I'm exporting data from grid to XLS format, I'm getting following error:

    Error while exporting data:
    org.apache.poi.hssf.usermodel.HSSFCell.setEncoding(S)V
    java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFCell.setEncoding(S)V
            at org.openswing.swing.export.java.ExportToExcel.prepareGrid(ExportToExcel.java:336)
            at org.openswing.swing.export.java.ExportToExcel.processComponent(ExportToExcel.java:86)
            at org.openswing.swing.export.java.ExportToExcel.getDocument(ExportToExcel.java:64)
            at org.openswing.swing.table.client.Grids.export(Grids.java:2227)
            at org.openswing.swing.export.client.ExportDialog$2.run(ExportDialog.java:206)

    In my application I'm using JasperReports 3.5.0 reporting library. This library requires Jakarta POI library version 3.0.1 or later, where method HSSFCell.setEncoding() was deprecated and removed because "POI now automatically handles Unicode without forcing the encoding" (quote from POI API doc). OpenSwing is still using old version 2.0 of POI (from 2004 year) and call this removed method.
    Is it possible to use the last version of POI in OpenSwing? Maybe can I resolve this problem another way?

    Thanks in advance,
    Jacek

     
    • mcarniel

      mcarniel - 2009-04-14

      I surround this error with try-catch so export should work fine for recent releases of HSSF.
      Fix will be available with next release of OpenSwing, planned for tomorrow.

       

Log in to post a comment.