Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Thu Dec 04, 2014 12:23 pm

Hi,

I am evaluating Spire.xls to read xls, xlsx and csv files from stream for our ptoject. When i try to read CSV, it gives below error. It works fine for xls and xlsx. ANy hep is appreciated.

spr2718 was unhandled by user code.
An exception of type 'spr2718' occurred in Spire.XLS.dll but was not handled in user code

Additional information: Zip exception.Can't locate end of central directory record. Possible wrong file format or archive is corrupt.

private void Spiral(HttpPostedFileBase file)
{
var workbook = new Workbook();
if (file.FileName.Contains("xlsx"))
{
workbook.LoadFromStream(stream, ExcelVersion.Version2013);
}
else
{
workbook.LoadFromStream(file.InputStream);
}
Worksheet sheet = workbook.Worksheets[0];
DataTable dt = sheet.ExportDataTable();
}

kvbhargava
 
Posts: 1
Joined: Tue Nov 25, 2014 7:06 pm

Fri Dec 05, 2014 2:02 am

Dear kvbhargava,

Thanks for your inquiry.

I have reproduced this issue and posted it to our dev team, we will inform you if there is any update.
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Return to Spire.XLS