export to xls: date not in date format

Technical support for Spire.DataExport

Moderators: iceblue support, DataExport, Manager

export to xls: date not in date format

Postby santoz » Fri Oct 24, 2008 10:53 am


I'm doing an export to excel but my date is not displayed as a date.
the correct date is in there but as a number. If i change the properties of the field, i will get the correct date. How can i fix this?

Spire.DataExport.XLS.CellExport exp = new Spire.DataExport.XLS.CellExport();
exp.DataFormats.CultureName = "nl-NL";
exp.DataFormats.Float = "#,###,##0.00";
[b]exp.DataFormats.DateTime = "dd-MM-yyyy";[/b]
exp.DataFormats.Currency = "
Last edited by santoz on Mon Dec 08, 2008 10:12 am, edited 1 time in total.
Posts: 8
Joined: Wed Sep 10, 2008 8:22 am
Location: Netherlands

Postby DataExport » Thu Nov 06, 2008 7:39 am


You need to add getParams event to CellExport component,
Try to using following source code,
Code: Select all
  private void cellExport1_GetDataParams(object sender, Spire.DataExport.EventArgs.DataParamsEventArgs e)
            if (e.Col == 1)
                e.FormatText = "YYYY-MM-DD";
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