shareReport(options: ShareReportConnectionObject): Promise<String>
[starting from version 2.9]
Saves the current report to Flexmonster Data Server and provides a link to the saved report.
To save a report, Flexmonster creates an XMLHttpRequest and sends it to the Data Server as a POST request. The request is sent to <url>/save
, where url is the Data Server’s URL (e.g., http://localhost:9500
).
For more details on report sharing, see this guide: Share the report.
Parameter/Type | Description |
---|---|
options ShareReportConnectionObject | optional Contains the configuration needed to save the shared report. This parameter is optional if the Data Server is used as a data source on the page. Otherwise, it is needed to define options . |
Returns a Promise object that resolves to a string, which is a link to the saved report.
1) Share a report with JSON as a data source:
new Flexmonster({ container: "pivot-container", componentFolder: "node_modules/flexmonster/", report: { dataSource: { filename: "data.json" } }, shareReportConnection: { url: "http://localhost:9500" } }); flexmonster.shareReport();
2) Share a report with Flexmonster Data Server as a data source:
new Flexmonster({ container: "pivot-container", componentFolder: "node_modules/flexmonster/", report: { dataSource: { type: "api", url: "http://localhost:9500", index: "fm-product-sales" } } }); flexmonster.shareReport();