We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.
All documentation
  • Introduction
  • Connecting to data source
  • Browser compatibility
  • Documentation for older versions
  • Migrating from WebDataRocks to Flexmonster

    This guide will help you migrate from WebDataRocks to Flexmonster in your project.

    The migration process is simple: Flexmonster is embedded in a JavaScript application similarly to WebDataRocks, so the code you’ve created around the WebDataRocks component will require only minor changes.

    If you are using a front-end framework, see how to migrate from WebDataRocks in a framework of your choice:

    Step 1. Get Flexmonster Pivot

    All possible ways to include Flexmonster in your project are described here: Get Flexmonster.

    Step 2. Import flexmonster.js

    Import flexmonster.js depending on how you have downloaded Flexmonster:

    Flexmonster CLI or npm

    • If you are using a module bundler, import Flexmonster in the way your bundler supports. For example:
      import Flexmonster from "flexmonster";
    • Alternatively, you can also import flexmonster.js in HTML using the <script> tag:
      <script src="node_modules/flexmonster/flexmonster.js"></script>

    CDN

    The flexmonster.js file was imported in step 1.

    ZIP package

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

    Step 3. Replace the init API call

    Replace the new WebDataRocks() API call with the new Flexmonster() API call depending on how you have downloaded Flexmonster:

    Flexmonster CLI or npm

    WebDataRocks:

    const pivot = new WebDataRocks({
    container: "pivotContainer",
    toolbar: true,
    report: {
    // Your report
    }
    });

    Flexmonster:

    const pivot = new Flexmonster({
      container: "pivotContainer",
      componentFolder: "node_modules/flexmonster/",
      toolbar: true,
      report: {
        // Your report
      }
    });

    Notice the componentFolder parameter in new Flexmonster() — it should point to the folder with Flexmonster files. Since Flexmonster is installed as an npm package, the componentFolder should be defined as node_modules/flexmonster/.

    CDN

    WebDataRocks:

    const pivot = new WebDataRocks({
    container: "pivotContainer",
    toolbar: true,
    report: {
    // Your report
    }
    });

    Flexmonster:

    const pivot = new Flexmonster({
    container: "pivotContainer",
    componentFolder: "https://cdn.flexmonster.com/",
    toolbar: true,
    report: {
    // Your report
    }
    });

    Notice the componentFolder parameter in new Flexmonster() — it should point to the folder with Flexmonster files. Since Flexmonster is included from our CDN, the componentFolder should be defined as https://cdn.flexmonster.com/ (or https://cdn.flexmonster.com/<version>/ if you are using a specific Flexmonster version).

    ZIP package

    WebDataRocks:

    const pivot = new WebDataRocks({
    container: "pivotContainer",
    toolbar: true,
    report: {
    // Your report
    }
    });

    Flexmonster:

    const pivot = new Flexmonster({
    container: "pivotContainer",
    componentFolder: "flexmonster/",
    toolbar: true,
    report: {
    // Your report
    }
    });

    Notice the componentFolder parameter in new Flexmonster() — it should point to the folder with Flexmonster files. If this folder is in the root of your project, the componentFolder should be set to "flexmonster/". Otherwise, adjust the componentFolder according to the flexmonster/ folder's location in your project.

    Note To use a trial version of Flexmonster from the ZIP package, you need to set a trial key. It can be found in the flexmonster/TrialKey.txt file. Copy the contents of the file and set the trial key using the licenseKey initialization parameter:

    const pivot = new Flexmonster({
      container: "pivotContainer",
      // ...
      licenseKey: "XXXX-XXXX-XXXX-XXXX-XXXX"
    });

    new Flexmonster() has more initialization parameters than new WebDataRocks(). See the full list of available parameters in the API reference: Flexmonster().

    Step 4. Replace WebDataRocks API with Flexmonster API

    Flexmonster supports all methods and events available in WebDataRocks and provides additional ones. See the full list of Flexmonster methods and events.

    To start using Flexmonster API, you need to:

    1. Change the WebDataRocks instance to the Flexmonster instance in method calls.
      You can skip this if you were referencing WebDataRocks through a custom variable (e.g., pivot, like in step 3), and now you will reuse that variable to reference Flexmonster. Otherwise, if you were referencing WebDataRocks through webdatarocks, replace webdatarocks with flexmonster:

      WebDataRocks

      webdatarocks.setReport(report);

      Flexmonster

      flexmonster.setReport(report);
    2. Update methods and events themselves if needed.
      Since all WebDataRocks methods and events are available in Flexmonster, there is no need to update their names. However, some Flexmonster methods and events have slightly different signatures. Check them out in the API Reference:

    Step 5. Replace the localization file

    If your WebDataRocks component was translated into a different language, replace the WebDataRocks localization file with the corresponding Flexmonster file:

    WebDataRocks

    report: {
      // Other report configurations
      localization: "https://cdn.webdatarocks.com/loc/es.json"
    }

    Flexmonster

    report: {
      // Other report configurations
      localization: "https://cdn.flexmonster.com/loc/es.json"
    }

    Learn more about localizing Flexmonster.

    Step 6. Update your reports

    To use a WebDataRocks report in Flexmonster, you need to make one minor change. The rest of the report will be converted automatically upon loading it in Flexmonster.

    To update your report, change "uniqueName": "Measures" to "uniqueName": "[Measures]" in the slice:

    WebDataRocks

    "slice": {
      "rows": [
        {
          // ...
        },
        {
          "uniqueName": "Measures"
        }
      ],
      // Other properties
    }

    Flexmonster

    "slice": {
      "rows": [
        {
          // ...
        },
        {
          "uniqueName": "[Measures]"
        }
      ],
      // Other properties
    }

    Step 7. Remove WebDataRocks

    Remove all WebDataRocks files used in your project:

    If WebDataRocks was installed from npm, run the following command to uninstall WebDataRocks:

    npm uninstall @webdatarocks/webdatarocks

    Step 8. See the result

    Open the page with the pivot table in the browser, then click on the grid and press Ctrl + Alt + i (Option + Control + i on macOS). You should see Flexmonster's licensing pop-up window; this would mean that WebDataRocks is successfully replaced by Flexmonster.

    The migration is complete.

    Troubleshooting

    If you run into any issues during the migration, visit our troubleshooting page.

    What's next?

    With Flexmonster, you can connect to JSON/CSV files, SQL and MongoDB databases, Elasticsearch, and Microsoft Analysis Services. See the full list of supported data sources.

    Flexmonster also offers features that are not available in WebDataRocks: