BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi,
My pivot table is loading data from the database, but l was not able to display the date (year & quarter) like the one found your documentation https://ej2.syncfusion.com/angular/documentation/pivotview/drill-down/
Below is my codes
Kindly assit. I will appreciate it if l can get a sample.
Regards
Charles
Hi Charles,
When a data source contains date type fields, you can use the grouping feature to group those date type fields into years, quarters, months and days. Please refer the below code example and sample.
Code example:
this.dataSourceSettings = { groupSettings: [{ name: 'OrderDate', type: 'Date', groupInterval: ['Years', 'Quarters'], }, ], } |
Output screenshot:
Sample: https://stackblitz.com/edit/angular-fnwg76-pztq8t?file=app.component.ts
Web Controller: https://www.syncfusion.com/downloads/support/directtrac/general/ze/WebAPISample66744954
Also, please refer the below document to know more about date grouping.
Document: https://ej2.syncfusion.com/angular/documentation/pivotview/grouping/#date-grouping
If your data source does not have date type fields, bind the fields representing "Year" and "Quarter" from your data source to the columns to get the output shown in the drill down sample in our documentation. Please refer the below code example and sample.
Code example:
this.dataSourceSettings = { columns: [{ name: 'Year' },{name: 'Quarter'}], }; |
Output screenshot:
Sample: https://stackblitz.com/edit/angular-fnwg76-pztq8t?file=app.component.ts
Web Controller: https://www.syncfusion.com/downloads/support/directtrac/general/ze/WebAPISample66744954
Also, please refer the below document to know more about data binding.
Regards,
Angelin Faith Sheeba.