Excel Reader return empty dataset

Jan 10, 2013 at 9:04 AM

Hi All,

I found this library by chance and decided to try it out but I met an issue. The dataset loaded from excel reader is empty. I'm pretty sure the stream is loaded though.

 

Dim stream As FileStream = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)

Dim excelReader As IExcelDataReader = ExcelReaderFactory.CreateBinaryReader(stream)

Dim ds As DataSet = excelReader.AsDataSet()

 

Can someone help me to solve this issue? Any help is appreciated.

Developer
Jan 10, 2013 at 9:41 AM
Are you trying to read and xls or xlsx?
Can you try running some of the unit tests in the project? These should all run ok.

Cheers
Ian


On Thu, Jan 10, 2013 at 10:04 AM, antonilim <notifications@codeplex.com> wrote:

From: antonilim

Hi All,

I found this library by chance and decided to try it out but I met an issue. The dataset loaded from excel reader is empty. I'm pretty sure the stream is loaded though.

Dim stream As FileStream = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)

Dim excelReader As IExcelDataReader = ExcelReaderFactory.CreateBinaryReader(stream)

Dim ds As DataSet = excelReader.AsDataSet()

Can someone help me to solve this issue? Any help is appreciated.

Read the full discussion online.

To add a post to this discussion, reply to this email (ExcelDataReader@discussions.codeplex.com)

To start a new discussion for this project, email ExcelDataReader@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Developer
Jan 10, 2013 at 10:58 AM

Alternatively, if unit tests work and you still can't read the document a unit test to show the failure and the file you are using would be very helpful in tracking it down.

Jan 11, 2013 at 12:30 AM
Ian1971 wrote:
Are you trying to read and xls or xlsx?
Can you try running some of the unit tests in the project? These should all run ok.
Cheers
Ian


On Thu, Jan 10, 2013 at 10:04 AM, antonilim <notifications@codeplex.com> wrote:

From: antonilim

.....

I am trying to read from a xls file, I suppose CreateBinaryReader is the right method to use? The unit tests are working fine, the stream object is loaded but the dataset is empty. I tried using another file and the result is same. 

Developer
Jan 11, 2013 at 11:17 AM
Are you able to attach a file or a file exhibiting this behaviour?


On Fri, Jan 11, 2013 at 1:30 AM, antonilim <notifications@codeplex.com> wrote:

From: antonilim

Ian1971 wrote:
Are you trying to read and xls or xlsx?
Can you try running some of the unit tests in the project? These should all run ok.
Cheers
Ian


On Thu, Jan 10, 2013 at 10:04 AM, antonilim <notifications@codeplex.com> wrote:

From: antonilim

.....

I am trying to read from a xls file, I suppose CreateBinaryReader is the right method to use? The unit tests are working fine, the stream object is loaded but the dataset is empty. I tried using another file and the result is same.

Read the full discussion online.

To add a post to this discussion, reply to this email (ExcelDataReader@discussions.codeplex.com)

To start a new discussion for this project, email ExcelDataReader@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Jan 11, 2013 at 10:19 PM

 

What created the xls file? I have just suffered and solved a very similar problem. Everything appeared to have worked, but the dataset was empty. It turned out that it couldn't cope with an xls file created by OpenOffice. The same content transfered to a MS Excel created xls was fine. Why was I using OpenOffice ... because I don't want to pay for Excel. Why am I using this library ... because I don't want to pay for Excel which is a pre-rec for using the interop classes.

OpenOffice xls files work fine in Excel and vice versa but are clearly not identical.

Developer
Jan 14, 2013 at 9:00 AM
Yes, I think there is an issue with xls files created by openoffice. I am looking into it, but it is a tricky one.


On Fri, Jan 11, 2013 at 11:19 PM, NeilRB <notifications@codeplex.com> wrote:

From: NeilRB

What created the xls file? I have just suffered and solved a very similar problem. Everything appeared to have worked, but the dataset was empty. It turned out that it couldn't cope with an xls file created by OpenOffice. The same content transfered to a MS Excel created xls was fine. Why was I using OpenOffice ... because I don't want to pay for Excel. Why am I using this library ... because I don't want to pay for Excel which is a pre-rec for using the interop classes.

OpenOffice xls files work fine in Excel and vice versa but are clearly not identical.

Read the full discussion online.

To add a post to this discussion, reply to this email (ExcelDataReader@discussions.codeplex.com)

To start a new discussion for this project, email ExcelDataReader@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Developer
Jan 17, 2013 at 11:27 AM

I have just checked in a change that enables reading of open office generated xls files. In particular exceldatareader was not properly supporting short streams using miniFAT (aka SSAT) in the compound document format. Once that hurdle was over it then turned out that the open office documents did't always have an INDEX record so I had to adjust exceldatareader to take account of documents that have no INDEX record.

Jan 25, 2013 at 10:10 PM

I used the latest code. I am still unable to read an xls file with no INDEX record. Although now it does return a datatable, but all the values are empty. Please provide a fix/solution for this.