Pricing changes are coming in January. Contact our Sales team to secure the current price for your desired license.
All documentation
  • API Reference for older versions
  • shareReport

    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.

    Parameters

    Parameter/TypeDescription
    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

    Returns a Promise object that resolves to a string, which is a link to the saved report.

    Examples

    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"
    }
    });

    pivot.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"
    }
    }
    });

    pivot.shareReport();

    See also

    Share the report
    setReport
    getReport
    open
    load
    save