How can I filter the prime ng table and export only filtered data to excel #1714
-
I have a primeng table where I am trying to export the filtered data to excel, I have create a table as component and using it where ever required. Here is the stackblitz code I am working on. I am using exceljs and file-saver npm packages to export the data. The only issue I had is to download only filtered data instead of all. Here is the stackblitz https://stackblitz.com/edit/primeng-card-demo-azewpe?file=src%2Fapp%2Fapp.module.ts I have gone through this link but no luck https://medium.com/@sankarums/angular-primeng-table-export-only-filtered-data-to-excel-7fc97878099c this.table.filteredValue this always gives me null In the given example let us say I select client1 and click on export to excel it should download only the rows that belongs to client1 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I am able to figure it out I added one more property in my component
Added onfilter method (onFilter)="onFilter($event)"
Imported the component as viewchild @ViewChild('dt1') table!:PrimeTableComponent;
|
Beta Was this translation helpful? Give feedback.
I am able to figure it out I added one more property in my component
Added onfilter method (onFilter)="onFilter($event)"
Imported the component as viewchild @ViewChild('dt1') table!:PrimeTableComponent;
and on export I did this