Blazor Pivot Table Example - Remote Data
Content Type: |
Grand Total |
|---|
Grand Total | No records to display |
This sample demonstrates the basic rendering of a pivot table bound to JSON or CSV data retrieved from a remote server.
Syncfusion Blazor Pivot Table supports both JSON and CSV data sources. The DataSource property in PivotViewDataSourceSettings can be assigned with the result of DataManager to bind remote data efficiently.
The SfDataManager acts as an interface between the service endpoint and the pivot table. To properly interact with the service endpoint and retrieve the required data, the following minimal configuration is necessary:
- SfDataManager->Url - Defines the service endpoint URL to fetch data.
- SfDataManager->Adaptor - Defines the adaptor option. WebApiAdaptor is commonly used for remote binding.
The adaptor is responsible for processing requests and responses from/to the service endpoint. Syncfusion provides several predefined adaptors:
- UrlAdaptor - Use this to interact with any remote service. This is the base adaptor for all remote-based adaptors.
- ODataAdaptor - Use this to interact with OData endpoints.
- ODataV4Adaptor - Use this to interact with OData V4 endpoints.
- WebApiAdaptor - Use this to interact with Web APIs created under OData standards.
In this demo, remote data binding is achieved by assigning the service data as an instance of DataManager to the DataSource property in PivotViewDataSourceSettings. For CSV data, the service URL is directly set to the Url property for remote data consumption.
For detailed information about remote data binding configuration and best practices, refer to the remote data binding documentation.