Hello Syncfusion-Team,
In my grid I want to export the Grid as PDF. I have two columns with the type dateTime and have managed the formatting setting the format property on the column itself in the html like this:
[format]="{ type: 'dateTime', format: 'dd.MM.yyyy - HH:mm' }"
Because I only want to display columns in my PDF export which contain the field property, I am iterating over the columns and am only exporting those specific columns. My PDF export function looks like this:
requestExport(type: 'PDF' | 'XLSX') {
let exportColumns = new Array<any>();
this.grid.getColumns().forEach((col) => {
if (col.field) {
exportColumns.push(col);
}
});
if (type === 'PDF') {
this.grid.pdfExport({
columns: exportColumns,
fileName: `${this.exportFileName} - ${Utility.currentDateTime}.pdf`,
pageOrientation: 'Landscape',
allowHorizontalOverflow: false,
});
} else if (type === 'XLSX') {
this.grid.excelExport({
columns: exportColumns,
fileName: `${this.exportFileName} - ${Utility.currentDateTime}.xlsx`,
});
}
}
The problem is that the exported PDF does not format the dateTime format properly:
However, when I am removing the columns property in the pdfExportSettings the dateTime format is correct:
Is it a problem of the grid itself or am I doing something wrong here?
Thanks, Peter