Restrict Date Format in Excel to 'dd\mm\yy'

Technical support for Spire.DataExport

Moderators: iceblue support, DataExport, Manager

Restrict Date Format in Excel to 'dd\mm\yy'

Postby Jackyog » Mon Aug 28, 2006 1:45 pm

Hi,

While exporting to excel, Is there a way to restrict the format for date columns like 'dd\mm\yy'. And should not allow user to enter any other format on the excel.


- Jack
Jackyog
 
Posts: 1
Joined: Mon Aug 28, 2006 1:42 pm

Postby DataExport » Tue Aug 29, 2006 2:39 pm

Hello,

If you want to set data format on a column, You need to write code in GetDataParams event.
Try to use the following example code,

Code: Select all
private void cellExport1_GetDataParams(object sender, Spire.DataExport.EventArgs.DataParamsEventArgs e)
{
      if (e.Col == 1)
      {
            e.FormatText = "dd/MM/yy";
      }
}
Technical Support
Spire.DataExport Team

support@e-iceblue.com
DataExport
 
Posts: 35
Joined: Thu Jun 29, 2006 2:29 pm


Return to Spire.DataExport

Who is online

Users browsing this forum: No registered users and 0 guests