Flexmonster Software License Agreement (“Agreement”) has been revised and is effective as of October 15, 2026.
The following modifications were made:
Downloading, installing, and/or continuing to use Flexmonster Software after October 15, 2026, constitutes Licensee’s acceptance of the terms and conditions of the modified version of Agreement. If Licensee does not agree to any of these terms and conditions, they must cease using Flexmonster Software and must not download, install, use, access, or continue to access Flexmonster Software. By continuing to use Flexmonster Software or renewing the license or maintenance after the effective date of these modifications to Agreement, Licensee accepts and agrees to be bound by the terms and conditions of the modified Agreement.
This guide explains how to use Flexmonster methods and events in a Next.js application. First, we will get a reference to the Flexmonster instance. Then we will use this reference to call methods and subscribe to events.
To interact with Flexmonster through code, you need a reference to the Flexmonster instance. Complete the following steps to get the reference:
Step 1. Since Flexmonster must be imported and rendered on the client side, ensure the Next.js page that uses Flexmonster API (e.g., App) is a Client Component and dynamically imports the PivotWrapper component with ssr: false:
"use client"
import dynamic from "next/dynamic";
const FlexmonsterPivot = dynamic(() => import("@/app/PivotWrapper"), {
ssr: false,
loading: () => <p>Loading Flexmonster...</p>
});
// Other code
The PivotWrapper is a wrapper for FlexmonsterReact.Pivot. See how the PivotWrapper component is created when embedding Flexmonster into a Next.js app.
Step 2. Create an empty ref object (e.g., pivotRef) and pass it as the ref attribute to the Flexmonster wrapper:
import * as React from "react";
import type { Pivot } from "react-flexmonster";
// ...
export default function App() {
const pivotRef: React.RefObject<Pivot | null> = React.useRef<Pivot>(null);
return (
<div className="App">
<FlexmonsterPivot
ref={pivotRef}
toolbar={true}
/>
</div>
)
}
The pivotRef reference to the Flexmonster instance is created.
In this guide, we will use the pivotRef.current.flexmonster property, which gives you access to Flexmonster API.
Call Flexmonster methods using the previously created pivotRef:
pivotRef.current?.flexmonster.setReport(report);
Some methods can also be defined as the component's props:
<FlexmonsterPivot
ref={pivotRef}
toolbar={true}
customizeCell={customizeCellFunction}
/>
Such methods include:
Check out the sample Next.js project for more examples with Flexmonster methods.
See the full list of Flexmonster methods.
There are two ways to subscribe to Flexmonster events:
You can also unsubscribe from an event.
Define an event as the component's prop and assign an event handler to it:
<FlexmonsterPivot
ref={pivotRef}
report="https://cdn.flexmonster.com/reports/report.json"
reportcomplete={onReportComplete}
/>
Handlers can be passed as inline JavaScript code or as variables. In both cases, curly braces should be used:
<FlexmonsterPivot
ref={pivotRef}
toolbar={true}
beforetoolbarcreated={toolbar => {
toolbar.showShareReportTab = true;
}}
/>
<FlexmonsterPivot
ref={pivotRef}
toolbar={true}
beforetoolbarcreated={customizeToolbar}
/>
The sample Next.js project demonstrates how to subscribe to events via the component’s props.
See the full list of Flexmonster events.
Use the previously created pivotRef to call the on() method:
pivotRef.current?.flexmonster.on("reportcomplete", onReportComplete);See how the on() method is used in the sample Next.js project.
Check out the full list of Flexmonster events.
Use the off() method to unsubscribe from an event:
pivotRef.current?.flexmonster.off("reportcomplete");This will remove all handlers from the event. To remove a specific handler, pass its name as a second parameter to off():
pivotRef.current?.flexmonster.off("reportcomplete", onReportComplete);Note If a handler is specified as an anonymous function, you can remove it only by removing all handlers.
See how the off() method is used in the sample Next.js project.
Can't find your answer here?
Visit the FAQ page
Flexmonster Pivot Table & Charts is a JavaScript pivot table component for adding interactive reporting and data analysis to web applications. Users can summarize, filter, sort, and explore data in pivot tables and charts, drill into results, and export reports.
Flexmonster works in plain JavaScript and TypeScript projects. It also integrates with React, Next.js, Angular, Vue, Blazor, and other technologies. See all integration options.
Flexmonster supports JSON and CSV files, SQL databases, MongoDB, Elasticsearch, and Microsoft Analysis Services (SSAS). You can also connect other data sources through your own backend. See supported data sources.
Flexmonster offers three licensing models: a Single Corporate License for internal use by one company (from $799/year), a SaaS License for embedding Flexmonster into a multi-tenant platform (from $2,499/year), and an OEM License for vendors distributing Flexmonster inside a product installed at other businesses (from $1,499/year for a 3-license bundle). Every license allows an unlimited number of developers and covers development, staging, and production environments at no extra charge.
SaaS projects can also use the free SaaS Entry license during development. Learn more on the pricing page.
Yes. Flexmonster offers a 30-day free trial that lets you evaluate all its features. No credit card is required. The trial version has a watermark.
To get started with Flexmonster, follow our integration guide.