Hi Gurpreet,
Thank you for your interest in Syncfusion products.
We are not able to reproduce the reported exception at our side. We have created test sample and placed in the following link for your reference. Could you please update us with your input template and modified test sample, which will helps us to further investigate on this.
Sample : ZipException.zip
The reported exception may occur due to stream end position. Please try the below code.
Code snippet [C#]:
using (Stream fileStream = file.InputStream)
{
ExcelEngine engine = new ExcelEngine();
// set the stream position to zero
fileStream.Position = 0;
var wb = engine.Excel.Workbooks.Open(fileStream, ExcelOpenType.Automatic, ExcelParseOptions.Default);
var count = wb.ActiveSheet.Rows.Count();
}
Please let us know if you need any clarifications.
Regards,
Mahajothi R.
Hi,
I have tried the same, still, I am getting the same exception.
Please help.
Thanks,
Surya prakash R
Hi,
I have been getting the same exception since last Monday.
And it's occurring on a specific PC.
So I displayed StackTrace etc. and it looks like the image below.
using (ExcelEngine excelEngine = new ExcelEngine())
{
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2016;
try
{
IWorkbook workbook = application.Workbooks.Open(file);
}
catch (Exception ex)
{
ShowMessage(this, String.Format("Message:{0}StackTrace:{1}Source:{2}", ex.Message, ex.StackTrace, ex.Source), MessageBoxIcon.Exclamation);
}
}
I am using Ver. 19.1450.0.54, and Excel files are downloaded from Microsoft Forms.
Since those files contain personal information, I cannot upload here.
I'm working on a different PC now, so I don't get the exception, but is there any hint to avoid this exception on my previous PC?
If you need the file, please show me a safety way for sending it.
Thank you,
Ryoichi.
Hi Keerthi,
Thank you for your reply.
I'll send support staff a file soon.
Thank you,
Ryoichi.
Any resolution found? I too am receiving the same error on opening an Excel (.xlsx) file.
Hi Sharma,
I finally got it!
If you have gotten same exception, you should check file size or open the file by Excel.
It's just 0 byte or can't open.
I wish your resolve.
Thanks,
Ryoichi
Hi Ryoichi,
How can I resolve this 0 byte Excel issue?
Hi Nivas,
As mentioned earlier, even Microsoft Excel cannot open the file with size 0. Please check if this the same case at your end. If Microsoft Excel opens your file correctly, kindly share that Excel document to investigate from our side further.
Regards,
Ramya.
can we send the excel file in .net webapi in chunks and merge this chunks on client side if posssible so please share the implementation in api
Hi Chetan,
It is not possible to send the Excel document as chunks using XlsIO. This is not feasible in XlsIO.
Regards,
Mohan.