< e-grid-column field ="Date1" headerText ="Date" textAlign="Left" format="d/M/y" width="30"></e-grid-column>If i choose the date format of yMd the export works fine.can you please let mw know how i can choose different date fromat then yMd for pdf export?Regards,Chinmay
|
Index.cshtml
<e-grid-column field="OrderDate" headerText="Order Date" customFormat="@(new { type ="date", format="d/M/y" })" type="date" textAlign="Right" width="140"></e-grid-column>
<script>
var gridObj;
function toolbarClick(args) {
gridObj = document.getElementById("Grid").ej2_instances[0];
if (args.item.id === 'Grid_pdfexport') {
gridObj.pdfExport();
}
}
</script> |
How is this still not fixed. The column has a format property, but to let this work with export you have to resort to adding a custom format.
And the error given does not indicate where the problem lies so you search and search. I did some cut-paste debugging and found out it was the date column, but this should be front and center when this type of restriction to otherwise valid properties is in effect!
Hi Johan Bennink,
Greetings from Syncfusion support,
We understand your concern regarding custom date formats during export. By default, our export functionality supports the 'columns.format' as a string, such as "yMd", for built-in date formats. However, when utilizing formats other than the default, a custom date format in object type is required.
To assist you further, we recommend referencing our documentation on exporting with custom date formats. Below is a snippet of code demonstrating how to implement this:
|
App.component.ts
<e-column field='OrderDate' headerText='Order Date' [format]='formatOptions' width=100></e-column>
ngOnInit(): void { this.formatOptions = { type: 'date', format: "d/M/y" }; }
|
Documentation: https://ej2.syncfusion.com/angular/documentation/grid/pdf-export/pdf-export#exporting-with-custom-date-format
Please get back to us if you need further assistance.
Regards,
Vikram S