forked from DevExpress/DevExtreme
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
49 lines (48 loc) · 1.33 KB
/
Copy pathApp.js
File metadata and controls
49 lines (48 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import React from 'react';
import PivotGrid, { FieldChooser } from 'devextreme-react/pivot-grid';
import PivotGridDataSource from 'devextreme/ui/pivot_grid/data_source';
import XmlaStore from 'devextreme/ui/pivot_grid/xmla_store';
const App = () => (
<>
<div className="long-title">
<h2>Sales Statistics</h2>
</div>
<PivotGrid
dataSource={dataSource}
allowSortingBySummary={true}
allowSorting={true}
allowFiltering={true}
allowExpandAll={true}
height={570}
showBorders={true}
>
<FieldChooser
enabled={true}
allowSearch={true}
/>
</PivotGrid>
</>
);
const dataSource = new PivotGridDataSource({
fields: [
{ dataField: '[Product].[Category]', area: 'row' },
{
dataField: '[Product].[Subcategory]',
area: 'row',
headerFilter: {
search: {
enabled: true,
},
},
},
{ dataField: '[Ship Date].[Calendar Year]', area: 'column' },
{ dataField: '[Ship Date].[Month of Year]', area: 'column' },
{ dataField: '[Measures].[Reseller Freight Cost]', area: 'data', format: 'currency' },
],
store: new XmlaStore({
url: 'https://demos.devexpress.com/Services/OLAP/msmdpump.dll',
catalog: 'Adventure Works DW Standard Edition 2026',
cube: 'Adventure Works',
}),
});
export default App;