Spire.DataExport for .NET is a 100% pure data .NET library suit for exporting data into MS Word, Excel, RTF, Access, PDF, XPS, HTML, XML, Text, CSV, DBF, SYLK, SQL Script, DIF, Clipboard, etc.

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

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