The PivotGrid control extends the FlexGrid, so you can export its contents to XLSX files in the same way you would export regular FlexGrid controls.
Full Wijmo OLAP series:
Add a reference to the wijmo.grid.xlsx module to the page, and then create a function to build the XLSX file you want. You have complete control of the output. For example, you may add sheets containing the current view, any pre-defined views, and the raw data. Here’s an example:
function exportToXlsx() {
// create book with current view
var book = wijmo.grid.xlsx.FlexGridXlsxConverter.save(thePivotGrid, {
includeColumnHeaders: true,
includeRowHeaders: true
});
book.sheets[0].name = 'Main View';
// add sheet with raw data
if (theRawGrid.rows.length <= 20000) {
var raw = wijmo.grid.xlsx.FlexGridXlsxConverter.save(theRawGrid, {
includeColumnHeaders: true,
includeRowHeaders: false
});
raw.sheets[0].name = 'Raw Data';
book.sheets.push(raw.sheets[0]);
}
// save book
book.save('wijmo.olap.xlsx');
}