Hi Bernard,
Thanks for contacting Syncfusion support.
By default, Grid will export the given dataSource even after filtering several columns or doing anyother actions. But in the toolbarClick event, we can generate a query and execute them on the Grid dataSource. Later, the result will be given to the pdfExport method as the Export Properties. Refer to the following code example.
<script>
var grid = new ej.grids.Grid({
dataSource: orderData,
allowFiltering: true,
allowPdfExport: true,
filterSettings: { type: 'Excel' },
toolbar: ['PdfExport'],
toolbarClick: function (args) {
if (args.item.text === 'PDF Export') {
let query = grid.renderModule.data.generateQuery(true); // get grid corresponding query
grid.getDataModule().executeQuery(query).then((e) => {
console.log(e.result);
grid.pdfExport({ dataSource: e.result }); //Export the filtered data.
}).catch((e) => {
console.log(e);
})
}
},
enableVirtualization: true,
height: 400,
. . .
. . .
});
grid.appendTo('#Grid');
</script> |
Note: If Grid in filtered state only you will get the filtered data while export. Otherwise you will get the entire dataSource in the result.
Please get back to us, if you need further assistance.
Regards,
Seeni Sakthi Kumar S.