Blazor Pivot Table Example - Remote Data
This sample demonstrates basic rendering of the pivot table bound to JSON or CSV data pulled from a remote server.
Content Type: |
Grand Total |
|---|
Grand Total | No records to display |
The Blazor Pivot Table supports JSON and CSV data source. The DataSource property in PivotViewDataSourceSettings can be assigned with the result of DataManager to bind remote data.
The SfDataManager, which will act as an interface between the service endpoint and the pivot table, will require the below minimal information to interact with service endpoint to retrieve the required data properly.- SfDataManager->Url - Defines the service endpoint to fetch data.
- SfDataManager->Adaptor - Defines the adaptor option. Here, WebApiAdaptor is used for remote binding.
Adaptor is responsible for processing the response and request from/to the service endpoint. The predefined adaptors are,
- 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 API created under OData standards.
In this demo, remote data is bound by assigning service data as an instance of DataManager to the DataSource property in PivotViewDataSourceSettings. But for CSV, the service URL is directly set to Url for remote data consumption.
More information on the remote data binding can be found in this documentation section.