Export

From Documentation
Revision as of 04:59, 13 March 2012 by SimonPai (talk | contribs)


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

Last Update : 2012/03/13


Version Date Content
     



Last Update : 2012/03/13

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.