ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: vijay@spinetechnologies on March 27, 2023, 11:00:41 am

Title: Maintain the date format in Excel Export
Post by: vijay@spinetechnologies on March 27, 2023, 11:00:41 am
Hi Paramvir,

I am trying to bind a pqGrid with date columns. I have mentioned the dataType property as a date for the respective columns. Also, I am formatting the date in the "dd-M-yy, D" format.

The grid is binding properly and showing data as per the given format. But when I try to export the grid in Excel, the generated files lost the data format for the date columns.

For your reference, I'm attaching screenshots. One is with the grid with properly formatted data and the other is after the export.

Kindly provide the solution.
Title: Re: Maintain the date format in Excel Export
Post by: paramvir on March 27, 2023, 12:40:00 pm
you need to mention the format in the column definition e.g.,

Code: [Select]
{ title: "Shipped Date", width: 100, dataIndx: "ShippedDate", dataType: "date", format: 'dd-M-yy, D' },
Title: Re: Maintain the date format in Excel Export
Post by: vijay@spinetechnologies on March 27, 2023, 01:17:06 pm
Hi Paramvir,

As earlier mentioned, I have applied the format property in the colModel object.

I am facing issues with the Excel Export..
Whenever I export the grid in Excel format, the exported date columns are not in the provided format.
Title: Re: Maintain the date format in Excel Export
Post by: paramvir on March 27, 2023, 02:08:58 pm
It works fine in the exported Excel in this example: https://paramquery.com/pro/demos87/export

Please share a small reproducible issue on jsfiddle if still facing issues.
Title: Re: Maintain the date format in Excel Export
Post by: vijay@spinetechnologies on March 27, 2023, 03:30:17 pm
Hi Paramvir,

Thanks for the reply. I understand the issue.