The Syncfusion Angular Pivot Table allows you to persist and restore report settings (also referred to as dataSourceSettings). In this sample, two custom toolbar actions are provided:
- Save: Exports the current Pivot Table configuration as a JSON file (for example, pivot.json).
- Open: Imports a previously saved JSON file and applies it to the Pivot Table.
These actions help users back up, share, or reload their exact Pivot Table layout, including rows, columns, values, filters, sorting, formatting, and more.
This sample uses the toolbarTemplate property of the Pivot Table to render two custom controls in the toolbar:
- A Save button (anchor element) that serializes the current report using getPersistData, converts it to a downloadable file, and triggers a download in the browser.
- An Open input (file element) that reads a selected JSON file using the FileReader API and then assigns the parsed content back to the component’s dataSourceSettings to instantly restore the report.
Key APIs and references used:
- Node.js (LTS recommended)
- Angular CLI (to run locally with ng serve)
- Visual Studio Code (or any preferred editor)
- Clone this repository:
- Open the project in Visual Studio Code.
- Install dependencies:
- In the integrated terminal, run:
- npm install
- In the integrated terminal, run:
- Start the development server:
- ng serve
- Navigate to the URL shown in the terminal (typically http://localhost:4200) to view the sample.
- This sample targets the Angular version specified in package.json. Update your local Node.js and Angular CLI to compatible versions if you encounter setup issues.
For any other queries, contact our Syncfusion® support team or post your queries through the community forums.
Request a new feature through Syncfusion® feedback portal.
This is a commercial product and requires a paid license for possession or use. Syncfusion's licensed software, including this component, is subject to the terms and conditions of Syncfusion's EULA. You can purchase a license here or start a free 30-day trial here