0

I'm looking for a library which will read all types of excel formats(eg:.xsl,.xlsx,.ods) I tried the The following code to read the spreadsheets.

     try
                        {
                            string extension = Path.GetExtension(File1.PostedFile.FileName);
                            switch (extension.ToLower())
                            {
     case ".xls":
                                    excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
                                    break;
                                case ".xlsx":
                                    excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);
                                    break;
                                case ".ods":
                                    excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream); 
                                    break;
                            }
                    }
                    catch (Exception ex)
                    {
                    }

It works fine for .xsl and .xlsx files but not working for openoffice .ods files. Can anyone confirm whether this supports openoffice or someother alternate which will fit to my requirement.

Tom Cruise
  • 1,395
  • 11
  • 30
  • 58

1 Answers1

2

Sorry but looking at the Project Description

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

For ODF files this might be interesting:

David Sdot
  • 2,343
  • 1
  • 20
  • 26