ICEfaces
  1. ICEfaces
  2. ICE-4823

dataExporter has issues exporting current page with ignorePagination set to false

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 1.8.2-RC1, 1.8.2
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      -

      Description

      When on page > 1 in a paginated dataTable, the dataExporter (ignorePagination=false) will add empty rows to the spreadsheet accounting for entries in previous pages. For example, on page 1 it will correctly export the current page data with no extra empty rows. If you paginate to page 2 or 3, you will see the current page exported but also a large amount of empty rows which make up the previous pages. Attached is a screenshot.

        Activity

        Hide
        Az Lacroix added a comment - - edited

        It's question about OutputHandler for Excel.
        DataExporter provide rowIndex, which used by ExcelOutputHandler.

        Way to fix this IMO next:

        (file ExcelOutputHandler.java, changed lines market with ///!)
        ...
        private Integer startRow = null; ///!
        ...
        public void writeCell(Object output, int col, int row) {

        if(startRow == null) startRow = new Integer(row); ///!
        WritableCell cell = null;

        if( output instanceof String )

        { cell = new Label(col, row + 1 - startRow.intValue(), (String)output); ///! }

        else if( output instanceof Double )

        { cell = new Number(col, row + 1 - startRow.intValue(), ((Double)output).doubleValue()); ///! }

        try

        { sheet.addCell(cell); }

        catch(WriteException e)

        { System.out.println("Could not write excel cell"); e.printStackTrace(); }

        }

        Show
        Az Lacroix added a comment - - edited It's question about OutputHandler for Excel. DataExporter provide rowIndex, which used by ExcelOutputHandler. Way to fix this IMO next: (file ExcelOutputHandler.java, changed lines market with ///!) ... private Integer startRow = null; ///! ... public void writeCell(Object output, int col, int row) { if(startRow == null) startRow = new Integer(row); ///! WritableCell cell = null; if( output instanceof String ) { cell = new Label(col, row + 1 - startRow.intValue(), (String)output); ///! } else if( output instanceof Double ) { cell = new Number(col, row + 1 - startRow.intValue(), ((Double)output).doubleValue()); ///! } try { sheet.addCell(cell); } catch(WriteException e) { System.out.println("Could not write excel cell"); e.printStackTrace(); } }
        Hide
        Adnan Durrani added a comment -

        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java
        Completed: At revision: 19156

        Show
        Adnan Durrani added a comment - Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\dataexporter\DataExporter.java Completed: At revision: 19156

          People

          • Assignee:
            Adnan Durrani
            Reporter:
            Tyler Johnson
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: