We have changed our pricing. Flexmonster Software License Agreement was also updated (list of changes)
All documentation
  • API Reference for older versions
  • getReport

    getReport(options: Object): ReportObject

    Returns ReportObject which describes the current report. Use this object to save or edit the report at runtime.

    Parameters

    Parameter/TypeDescription
    options
    Object
    optional Allows specifying which options should be included in the report.
    options.withDefaults
    Boolean
    optional Indicates whether the default values for options will be included in the report (true) or not (false).
    Default value: false.
    options.withGlobals
    Boolean
    optional Indicates whether the options defined in the GlobalObject will be included in the report (true) or not (false).
    Default value: false.

    Example

    1) Get report:

    <script src="flexmonster/flexmonster.js"></script>

    <button onclick="getReport()">Get report</button>
    <div id="pivotContainer">The component will appear here</div>

    <script>
    const pivot = new Flexmonster({
    container: "pivotContainer",
    report: {
    dataSource: {
    filename: "https://cdn.flexmonster.com/data/data.csv"
    }
    }
    });

    function getReport() {
    console.log(pivot.getReport());
    }
    </script>

    Open the example on JSFiddle.

    2) Swap two reports:

    <script src="flexmonster/flexmonster.js"></script> 

    <button onclick="swapReports()">Swap reports</button>
    <div id="firstPivotContainer">The component will appear here</div>
    <div id="secondPivotContainer">The component will appear here</div>

    <script>
    const pivot1 = new Flexmonster({
    container: "firstPivotContainer",
    toolbar: true,
    report: {
    dataSource: {
    filename: "data1.csv"
    }
    }
    });

    const pivot2 = new Flexmonster({
    container: "secondPivotContainer",
    toolbar: true,
    report: {
    dataSource: {
    filename: "data2.csv"
    }
    }
    });
     
    function swapReports() {
    const report1 = pivot1.getReport();
    const report2 = pivot2.getReport();
     
    pivot1.setReport(report2);
    pivot2.setReport(report1);  
    }
    </script>

    Try on JSFiddle.

    3) Get a report with defaults or globals: JSFiddle.

    See also

    setReport
    shareReport
    ReportObject
    open
    load
    save
    Save and restore the report