This project is read-only.
1
Vote

Bug in Test App

description

Hi,
 
I downloaded this version ExcelExportLib-55527.zip
 
Just to start getting a look at what your tool can do I ran the test App and pressed the Run Test button. Excel opend and I received an error pointing to this log file:
 
 
 
XML ERROR in Table
REASON: Bad Value
FILE: C:\Documents and Settings\Administrator\Desktop\ExcelExportLib-55527\trunk\ExcelExportTest\bin\Debug\test.xml
GROUP: Cell
TAG: Data
VALUE: 2011-01-04T11:30:27 AM
 
XML ERROR in Table
REASON: Bad Value
FILE: C:\Documents and Settings\Administrator\Desktop\ExcelExportLib-55527\trunk\ExcelExportTest\bin\Debug\test.xml
GROUP: Cell
TAG: Data
VALUE: 2011-01-04T11:30:27 AM
 
XML ERROR in Table
REASON: Bad Value
FILE: C:\Documents and Settings\Administrator\Desktop\ExcelExportLib-55527\trunk\ExcelExportTest\bin\Debug\test.xml
GROUP: Cell
TAG: Data
VALUE: 2011-01-04T11:30:27 AM
 
XML ERROR in Table
REASON: Bad Value
FILE: C:\Documents and Settings\Administrator\Desktop\ExcelExportLib-55527\trunk\ExcelExportTest\bin\Debug\test.xml
GROUP: Cell
TAG: Data
VALUE: 2011-01-04T11:30:27 AM
 
XML ERROR in Table
REASON: Bad Value
FILE: C:\Documents and Settings\Administrator\Desktop\ExcelExportLib-55527\trunk\ExcelExportTest\bin\Debug\test.xml
GROUP: Cell
TAG: Data
VALUE: 2011-01-04T11:30:27 AM

comments

Fahrain wrote Jan 9, 2011 at 9:16 AM

I think there is something non standard in your OS date/time settings or Excel version. I've tested with excel 2003/2007/2010 and some versions of Open Office - works fine. So, please, tell me something about your environment:
  • OS version
  • Office version
  • date/time settings (Control Panel - regional settings - formats)

Oswaldao wrote Feb 17, 2011 at 9:19 PM

I observed the same error, but if you replace the date format from '2011-02-17T12:55:14 PM' to '2011-02-17T12:55:14Z', for ex, it starts working normally

Oswaldao wrote Feb 17, 2011 at 9:34 PM

Being more specifc, please make this small change in the code:
    public static string GetExcelDate(this DateTime date)
    {
        StringBuilder sb=new StringBuilder();
        sb.Append(date.Year);
        sb.Append("-");
        sb.Append(date.Month.ToString("00"));
        sb.Append("-");
        sb.Append(date.Day.ToString("00"));
        sb.Append("T");
        sb.AppendFormat("{0:HH:mm:ss.000}", date);
        //string time=date.ToLongTimeString();
        //if (time.IndexOf(':') == 1) //correcting 0:00:00 to 00:00:00
        //    sb.Append('0');
        //sb.Append(time);
        return sb.ToString();

Fahrain wrote Feb 18, 2011 at 10:06 AM

I've changed function to
    public static string GetExcelDate(this DateTime date)
    {
        return String.Format("{0:yyyy-MM-dd}T{0:HH:mm:ss.000}", date);
    }
On my test PCs all works fine

wrote Feb 13, 2013 at 7:45 PM