WebDataRocks End User License Agreement (“Agreement”) has been revised and is effective as of April 18, 2024.
The following modifications have been made:
The modified version of WebDataRocks End User License Agreement is available here.
Downloading, installing, and/or continuing to use WebDataRocks after April 18, 2024, constitutes your acceptance of the terms and conditions of the modified version of WebDataRocks End User License Agreement. If you do not agree to any of these terms and conditions, do not download, install, use, or access (or continue to access) WebDataRocks.
getReport(options:Object): Report Object
This method returns a current Report Object from a pivot table component. Use it to save or edit a report.
Name | Type | Description |
---|---|---|
options | Object | Contains the following properties: |
| Boolean | Specifies whether default values of an options object should be included in a report (true ) of not (false ). Default value: false . |
| Boolean | Specifies whether values of an options object defined in a global object should be included in a report (true ) or not (false ). Default value: false . |
1) Get a report:
var pivot = new WebDataRocks({ container: "#wdr-component", toolbar: true, height: 490, report: "https://cdn.webdatarocks.com/reports/report.json" }); function getReport() { console.log(pivot.getReport()); }
See the CodePen demo.
2) Swap two reports:
<div id="wdr-component1"></div> <div id="wdr-component2"></div> <script> var pivot1 = new WebDataRocks({ container: "#wdr-component1", toolbar: true, height: 490, report: { "dataSource": { "dataSourceType": "csv", "filename": "https://cdn.webdatarocks.com/data/data.csv" }, "slice": { "rows": [{ "uniqueName": "Category" }], "columns": [{ "uniqueName": "Measures" }, { "uniqueName": "Country" } ], "measures": [{ "uniqueName": "Price", "aggregation": "sum" }] } } }); var pivot2 = new WebDataRocks({ container: "#wdr-component2", toolbar: true, height: 390, report: "https://cdn.webdatarocks.com/reports/report.json" }); function swapReports() { var report1 = pivot1.getReport(); var report2 = pivot2.getReport(); pivot1.setReport(report2); pivot2.setReport(report1); } </script>
See the CodePen demo.
3) Get report with defaults or globals: see the CodePen demo.