Production-ready React implementation for saving and loading pivot table reports — Seamlessly persist pivot table configurations using Syncfusion EJ2 PivotView toolbar integration with modern React patterns and best practices.
This repository delivers a complete, enterprise-ready solution for implementing save and load functionality in the Syncfusion React PivotView component. Perfect for building business intelligence dashboards, financial reporting tools, and analytics applications. The toolbar-integrated report management system allows users to persist complex pivot configurations and restore them instantly with zero data loss.
Repository Description: Complete React implementation demonstrating seamless integration of save and load functionality for reports in Syncfusion React PivotView, with toolbar integration and persistent state management for efficient data analysis workflows.
- ✅ Save Reports: Export pivot configurations to JSON format via toolbar button
- ✅ Load Reports: Restore saved reports with single-click file upload
- ✅ Toolbar Integration: Intuitive UI controls within EJ2 PivotView toolbar
- ✅ React 18 Support: Latest React patterns with functional components
- ✅ Syncfusion EJ2 PivotView: Enterprise-grade pivot table with advanced analytics
- ✅ File-Based Persistence: Direct JSON download and upload capabilities
- ✅ Zero Dependencies: No external storage services required
- Node.js: v14.0 or later
- npm: v6.0 or later (or yarn)
- React: 18.3.1+
- Syncfusion License: Community or commercial license
- Browser Support: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
-
Clone Repository
git clone https://github.com/SyncfusionExamples/save-and-load-report-through-the-toolbar-in-react-pivotview-component cd save-and-load-report-through-the-toolbar-in-react-pivotview-component -
Install Dependencies
npm install
This installs React 18.3.1, Syncfusion EJ2 PivotView 26.1.39, and testing utilities.
-
Verify Installation: Check that
node_modulescontains@syncfusion/ej2-react-pivotview
-
Start Development Server
npm start
Application opens at
http://localhost:3000with hot-reload enabled. -
Interact with PivotView
- Rearrange rows, columns, and values
- Apply filters and formatting
- Drag fields to reshape data analysis view
-
Save Report
- Click the Save button in toolbar
- Browser downloads
pivot.JSONcontaining your configuration
-
Load Report
- Click the Open button in toolbar
- Select a previously saved
pivot.JSONfile - PivotView instantly restores the saved configuration
├── src/
│ ├── App.js # Main PivotView component with save/load logic
│ ├── datasource.js # Sample pivot data source
│ ├── index.js # React application entry point
│ └── index.css # Styling
├── public/
│ ├── index.html # HTML template
│ └── manifest.json # PWA manifest
├── package.json # Dependencies and scripts
└── README.md # This file
The save/load functionality leverages:
getPersistData(): Extracts pivot configuration as JSONdataSourceSettings: Applies saved configuration to restore report- FileReader API: Handles file uploads for loading reports
- Base64 Encoding: Enables JSON-to-download conversion
npm start # Run development server (port 3000)
npm build # Build optimized production bundle
npm test # Execute test suite
npm eject # Eject from react-scripts (irreversible)- Syncfusion React PivotView Docs
- Syncfusion PivotView Toolbar Guide
- React Official Documentation
- MDN FileReader API
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the Syncfusion Community License. See Syncfusion License for details.
For issues, questions, or suggestions:
- 📧 Open an Issue
- 💬 Visit Syncfusion React Support
- 📖 Check Syncfusion Documentation