DateTime (Time Format Problem )

Technical support for Spire.DataExport

Moderators: iceblue support, DataExport, Manager

DateTime (Time Format Problem )

Postby sgohane » Thu Sep 20, 2007 9:37 am

Hi


I want to export datatable into excel file but the column in which datetime is present shows only date part and time part shows 12:00:00 AM.
Please suggest some remedy for this problem.I am using Imports Spire.DataExport.XLS namespace and CellExport1.DataFormats.DateTime = "M-d-yyyy H:mm"

CellExport1.SaveToHttpResponse("res.xls", Response)

This is very urgent.

Thanks in advance...........
sgohane
 
Posts: 3
Joined: Thu Sep 20, 2007 9:13 am

Postby DataExport » Thu Sep 20, 2007 1:56 pm

Hello,

Try to format datetime value in GetDataParams event of Spire.DataExport, see following code.


Code: Select all
   private void cellExport1_GetDataParams(object sender, Spire.DataExport.EventArgs.DataParamsEventArgs e)
      {
         if    ((e.Sheet == 0) && (e.Col == 6))
         {
            e.FormatText = "M-d-yyyy H:mm";
         }
      }
DataExport
 
Posts: 35
Joined: Thu Jun 29, 2006 2:29 pm

Postby sgohane » Fri Sep 21, 2007 7:01 am

Thanks for your suggestion but it was of no use instead of i given string format specifer for datetime in datatable
sgohane
 
Posts: 3
Joined: Thu Sep 20, 2007 9:13 am


Return to Spire.DataExport

Who is online

Users browsing this forum: No registered users and 1 guest