Quantcast
Channel: Excel Data Reader - Read Excel files in .NET
Viewing all 448 articles
Browse latest View live

New Post: Date time converted into int

$
0
0
I am having the same problem. I have a column of only dates (formatted as Date) and once converted to a csv it shows an integer. It's the latest code. Is there any solution?

Thank You

Commented Unassigned: DateTime parsing error - the OADate is wrong [12456]

$
0
0
The date that is parsed by excel data reader is a few years off.

When parsing '9/8/2013' exceldatareader is giving me 40056
When it should actually be 41525


Using the attached xls file, dates are converted wrongly.

void Main()
{
var dt = DateTime.Parse("9/8/2013");
Double d = dt.ToOADate();
Console.WriteLine(d);
Console.WriteLine(DateTime.FromOADate(d));

// output from exceldata reader
Console.WriteLine(DateTime.FromOADate(40056));
}


Output

41525
9/8/2013 12:00:00 AM
8/31/2009 12:00:00 AM
Comments: ** Comment from web user: csearles11 **

You can switch the date system in the spreadsheet itself. By default Excel for Windows uses the 1900 system, for Mac uses the 1904.

Good link on why and how you can change the date system: http://support.microsoft.com/kb/180162/en-us

Would be nice to have the library take care of this or to return the serial and the system so we can do the calculation.

Created Unassigned: ExcelDataReader 2.1.2.0 Nuget Package is wrong [12759]

$
0
0
Seems like the downloaded package does contain Excel.dll in both net20 and net45 folders. Since I am using the excel data reader in a .Net 4.5 based project, I found out that it's not resolving the assemblies correctly as it tries to find a dll called Excel.4.5.dll.

Commented Unassigned: ExcelDataReader 2.1.2.0 Nuget Package is wrong [12759]

$
0
0
Seems like the downloaded package does contain Excel.dll in both net20 and net45 folders. Since I am using the excel data reader in a .Net 4.5 based project, I found out that it's not resolving the assemblies correctly as it tries to find a dll called Excel.4.5.dll.
Comments: ** Comment from web user: asankaf **

I guess the dll that should be placed in net45 folder is Excel.4.5, not Excel.dll

Commented Unassigned: ExcelDataReader 2.1.2.0 Nuget Package is wrong [12759]

$
0
0
Seems like the downloaded package does contain Excel.dll in both net20 and net45 folders. Since I am using the excel data reader in a .Net 4.5 based project, I found out that it's not resolving the assemblies correctly as it tries to find a dll called Excel.4.5.dll.
Comments: ** Comment from web user: cyberjared **

I ran into this also. Had to grab the original binaries and put them in the /bin directory to handle it.

Commented Unassigned: ExcelDataReader 2.1.2.0 Nuget Package is wrong [12759]

$
0
0
Seems like the downloaded package does contain Excel.dll in both net20 and net45 folders. Since I am using the excel data reader in a .Net 4.5 based project, I found out that it's not resolving the assemblies correctly as it tries to find a dll called Excel.4.5.dll.
Comments: ** Comment from web user: Ian1971 **

I've updated the package it should now correctly reference Excel.dll in net45 folder.

Commented Unassigned: ExcelDataReader 2.1.2.0 Nuget Package is wrong [12759]

$
0
0
Seems like the downloaded package does contain Excel.dll in both net20 and net45 folders. Since I am using the excel data reader in a .Net 4.5 based project, I found out that it's not resolving the assemblies correctly as it tries to find a dll called Excel.4.5.dll.
Comments: ** Comment from web user: asankaf **

@edwinbleijenberg
Yes... That will solve the issue. But in a continuous integration environment, it's not possible and practical to always copy the right DLLs. I guess ExcelDataReader people will correct their nuget package ASAP

Commented Unassigned: ExcelDataReader 2.1.2.0 Nuget Package is wrong [12759]

$
0
0
Seems like the downloaded package does contain Excel.dll in both net20 and net45 folders. Since I am using the excel data reader in a .Net 4.5 based project, I found out that it's not resolving the assemblies correctly as it tries to find a dll called Excel.4.5.dll.
Comments: ** Comment from web user: asankaf **

Hi @Ian1971,
Thank you very much. I'll check


Created Unassigned: OpenXmlReader reading DateTime instead of OADate [12774]

$
0
0
Hello,

When I use ExcelReaderFactory.CreateOpenXmlReader() the date fields come as DateTime type and when I use CreateBinaryReader() the date fields come as Int type (OADate).

I've tried using the overloaded AsDataReader(bool convertToOADate) passing true and false, but nothing changed.

I'm using the following code:
```
DataSet result;
IExcelDataReader excelReader;
public void ReadExcel(string filename, Stream stream)
{
string extension = Path.GetExtension(filename);

if (extension.ToLower().Contains("xlsx"))
{
excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);
}
else
{
excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
}

excelReader.IsFirstRowAsColumnNames = true;
result = excelReader.AsDataSet();

excelReader.Close();
}
```

Is there a way to load data in OADate format when using OpenXml format?

Source code checked in, #87372

Commented Unassigned: OpenXmlReader reading DateTime instead of OADate [12774]

$
0
0
Hello,

When I use ExcelReaderFactory.CreateOpenXmlReader() the date fields come as DateTime type and when I use CreateBinaryReader() the date fields come as Int type (OADate).

I've tried using the overloaded AsDataReader(bool convertToOADate) passing true and false, but nothing changed.

I'm using the following code:
```
DataSet result;
IExcelDataReader excelReader;
public void ReadExcel(string filename, Stream stream)
{
string extension = Path.GetExtension(filename);

if (extension.ToLower().Contains("xlsx"))
{
excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);
}
else
{
excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
}

excelReader.IsFirstRowAsColumnNames = true;
result = excelReader.AsDataSet();

excelReader.Close();
}
```

Is there a way to load data in OADate format when using OpenXml format?
Comments: ** Comment from web user: Ian1971 **

The parameter is actually convertOADate and what it does is convert an OADate in an excel binary format to a datetime.

OADate does not apply to OpenXml dates as far as I know. The date is held in the xml as a date string not an OADate.

If you wanted to convert a DateTime to an OADate you would have to do that yourself.

Commented Unassigned: OpenXmlReader reading DateTime instead of OADate [12774]

$
0
0
Hello,

When I use ExcelReaderFactory.CreateOpenXmlReader() the date fields come as DateTime type and when I use CreateBinaryReader() the date fields come as Int type (OADate).

I've tried using the overloaded AsDataReader(bool convertToOADate) passing true and false, but nothing changed.

I'm using the following code:
```
DataSet result;
IExcelDataReader excelReader;
public void ReadExcel(string filename, Stream stream)
{
string extension = Path.GetExtension(filename);

if (extension.ToLower().Contains("xlsx"))
{
excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);
}
else
{
excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
}

excelReader.IsFirstRowAsColumnNames = true;
result = excelReader.AsDataSet();

excelReader.Close();
}
```

Is there a way to load data in OADate format when using OpenXml format?
Comments: ** Comment from web user: Corte **

When I open the .xlsx in WinZip and go to the sheet's xml I found the data stored as OADate.
I really don't know why this is happening.

The problem is conveting from string to DateTime. I just don't know how to convert it, because I don't know what format will be used (for example: in brazil date format is dd/mm/yyyy)

Created Unassigned: ExcelDataReader can't find ICSharpCode.SharpZipLib [12778]

$
0
0
Hi,

I'm getting
"Additional information: Could not load file or assembly 'ICSharpCode.SharpZipLib, Version=0.85.5.452, Culture=neutral, PublicKeyToken=1b03e6acf1164f73' or one of its dependencies. "

why does it look for this specific version?

Commented Unassigned: ExcelDataReader can't find ICSharpCode.SharpZipLib [12778]

$
0
0
Hi,

I'm getting
"Additional information: Could not load file or assembly 'ICSharpCode.SharpZipLib, Version=0.85.5.452, Culture=neutral, PublicKeyToken=1b03e6acf1164f73' or one of its dependencies. "

why does it look for this specific version?
Comments: ** Comment from web user: forki **

In https://exceldatareader.codeplex.com/SourceControl/latest#Excel/Excel.4.5.csproj and other csproj files you specify this version. Please remove this and rely on the nuget package.

Patch Uploaded: #15924

$
0
0

ktarbet has uploaded a patch.

Description:
ExcelBinaryReader.AsDataSet(true); can cause NullReferenceException

The patch checks the value parameter for null before attempting conversion to DateTime.

-- Function Patched --
private object ExcelBinaryReader.tryConvertOADateTime(value,XFormat)


Commented Unassigned: ExcelDataReader 2.1.2.0 Nuget Package is wrong [12759]

$
0
0
Seems like the downloaded package does contain Excel.dll in both net20 and net45 folders. Since I am using the excel data reader in a .Net 4.5 based project, I found out that it's not resolving the assemblies correctly as it tries to find a dll called Excel.4.5.dll.
Comments: ** Comment from web user: vertigo093i **

Sorry for troubling you guys.
This happened because when updating the package I've taken the original release binaries and just renamed the 4.5 assembly. I've thought that was enough. :-(

Commented Unassigned: Not work with ICSharpCode.SharpZipLib 0.86 [12561]

$
0
0
Subj, but in nuget discription writed that need SharpZipLib 0.86 or more. But by fact work only with 0.85.5 That cause many problem when use other assemblies, that work with 0.86
Comments: ** Comment from web user: vertigo093i **

When installing the package NuGet should have added binding redirects to a app/web.config. They allow ExcelDataReader to correctly work with the 0.86 version of the SharpZipLib.

Commented Unassigned: Excel Versions Supported? [12738]

$
0
0
Hi,

I would like to know which versions of Excel is supported? I tried importing a Microsoft Excel 5.0/95 Workbook and had an Array out of bounds error and also the column headers has lots of special characters..

Any idea what might be causing this?

Regards,
Vishal
Comments: ** Comment from web user: dmcgiv **

The descriptions states what versions are supported. You're version must not be supported.

"Lightweight and fast library written in C# for reading Microsoft Excel files __('97-2007__)"

Commented Unassigned: Not work with ICSharpCode.SharpZipLib 0.86 [12561]

$
0
0
Subj, but in nuget discription writed that need SharpZipLib 0.86 or more. But by fact work only with 0.85.5 That cause many problem when use other assemblies, that work with 0.86
Comments: ** Comment from web user: Ian1971 **

Would it be better if I just update ExcelDataReader to use 0.86?

Commented Unassigned: Not work with ICSharpCode.SharpZipLib 0.86 [12561]

$
0
0
Subj, but in nuget discription writed that need SharpZipLib 0.86 or more. But by fact work only with 0.85.5 That cause many problem when use other assemblies, that work with 0.86
Comments: ** Comment from web user: jabacrack **

2vertigo093i
Yes, NuGet do this, but Excel Data Reader still use old version, which is in its folder

Ian1971
Yes, I think this will be better solution. I do this by myself for my project, all work fine.

Viewing all 448 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>