代码部分基本上跟demo一样
- const ngPanel = new wjcOlap.PivotEngine({
- itemsSource: getData(1000),
- valueFields: ['Amount'],
- rowFields: ['Buyer', 'Type'],
- showRowTotals: 'Subtotals',
- showColumnTotals: 'Subtotals',
- })
- const WijimoOlapTable = () => {
- const exportFile = () => {
- let book = wjcGridXlsx.FlexGridXlsxConverter.saveAsync(gridRef.current, {
- includeColumnHeaders: true,
- includeRowHeaders: true
- });
- book.sheets[0].name = 'PivotGrid';
- // save the book
- book.saveAsync('PivotGrid.xlsx');
- }
- return <Olap.PivotGrid initialized={(instance) => gridRef.current = instance} itemsSource={ngPanel} ></Olap.PivotGrid>
- }
复制代码
|