public void exportAll(DataTable table, Writer writer) throws IOException { int first = table.getFirst(); int rowCount = table.getRowCount(); int rows = table.getRows(); boolean lazy = table.isLazy(); if (lazy) { for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) { if (rowIndex % rows == 0) { table.setFirst(rowIndex); table.loadLazyData(); } exportRow(table, writer, rowIndex); } // restore table.setFirst(first); table.loadLazyData(); } else { for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) { exportRow(table, writer, rowIndex); } // restore table.setFirst(first); } }
public void exportPageOnly(DataTable table, Writer writer) throws IOException { int first = table.getFirst(); int rowsToExport = first + table.getRows(); for (int rowIndex = first; rowIndex < rowsToExport; rowIndex++) { exportRow(table, writer, rowIndex); } }