export pdf with column date format not working

Hello !

Is it a bug to be unable to export un PDF with a column with   type=" date"  format="yyyy-MM-dd" ? ( that do not crash, but that do nothing )

If i remove the type and the format, i can export.  That column has a " new Date();"  inside.


<ejs-grid #grid [dataSource]='data' [allowPdfExport]='true'>

          <e-columns>

            <e-column field='id' headerText='id' width=0></e-column>

            <e-column field='name' headerText='name' width=150></e-column>

            <e-column field='creation' headerText='creation' width=90  type=" date"  format="yyyy-MM-dd"></e-column>

          </e-columns>

        </ejs-grid>


  toolbarClick(args: ClickEventArgs): void {

    if (args.item.id.includes('pdfexport')) {

      this.grid.pdfExport();

    }

  }


1 Reply

SK Sujith Kumar Rajkumar Syncfusion Team July 28, 2021 07:17 AM UTC

Hi Frédéric, 
 
Greetings from Syncfusion support. 
 
Your reported problem was occurring because a custom date format was provided directly in the Grid’s format property. For custom date format, we suggest you to set it to the columns format property as demonstrated in the below code snippet, 
 
<e-column field='OrderDate' [format]='formatOptions' headerText='Order Date'></e-column> 
 
export class AppComponent implements OnInit { 
 
    public formatOptions: object; 
 
    ngOnInit(): void { 
       this.formatOptions = { type: 'date', format: 'yyyy-MM-dd' }; 
    } 
} 
 
We have prepared a sample based on this for your reference. You can find it below, 
 
 
More details on this can be checked in the below help documentation link, 
 
 
Please get back to us if you require any further assistance. 
 
Regards, 
Sujith R 


Loader.
Up arrow icon