Export
From Documentation
You can export the computed result of Pivottable to other formats.
Export to Microsoft Excel
Given a Pivottable instance, you can dump the current result in .xls format to an OutputStream. The exported Excel file contains a sheet that reflects the computed result you see on browser windows, without paging. For example,
ByteArrayOutputStream out = new ByteArrayOutputStream();
PivotExportContext context = Exports.getExportContext(pivot, false, null);
Exports.exportExcel(out, "xls", context, null); // writes Pivottable information to the output stream
Filedownload.save(out.toByteArray(), "text/csv", "pivot.csv"); // file download
try {
out.close();
} catch (IOException e) {}
PivotExportContext
PivotExportContext is an intermediate result for exporting Pivottable to a table/sheet data structure. You can construct it from a Pivottable, or from a PivotModel and a PivotRenderer (so you don't need a component instance).
Export to CSV
Version History
Version | Date | Content |
---|---|---|