We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Cannot open excel file

Thread ID:

Created:

Updated:

Platform:

Replies:

104151 Jun 25,2012 07:29 PM Oct 31,2012 06:32 AM Windows Forms 6
loading
Tags: XlsIO
Jiwon
Asked On June 25, 2012 07:29 PM

Like below, I faced the exception.
 
--Code here
IWorkbook workbook = excelEngine.Excel.Workbooks.Open(stream, ExcelOpenType.Automatic);
--Exception
The type initializer for 'Syncfusion.Compression.Zip.ZipCrc32' threw an exception.
 
I referenced
 
Core
XlsIO.ClientProfile
XlsIO.Compression.Base
 
for partial-trust and also same as full-trust.
 
Thank you.
 
 

Mahajothi R [Syncfusion]
Replied On June 26, 2012 01:41 AM

Hi Jiwon,

 

Thank you for your interest in Syncfusion product.

 

We are not able to reproduce the issue at our side. We have created the sample and tried to reproduce the issue. Could you please modify the posted sample to reproduce the issue and revert us back the same, which helps us to further investigation on this.

 

Sample : OpenExcelFile.zip

 

We have used the following assemblies with the version 10.2.0.56.

 

Syncfusion.Compression.Base.dll

Syncfusion.Core.dll

Syncfusion.XlsIO.ClientProfile.dll

 

Could you please update us with your input template and the version of our Syncfusion product.

 

Please let us know if you need any clarifications.

 

 

Regards,

Mahajothi R.


Jiwon
Replied On July 3, 2012 01:26 AM

I faced that problem in another platform, Winform.
 
I uploaded test solution, and include Winform project.
If you just debug, you can see the exception as I told you.
 
One more curious thing is deployment.

Syncfusion.Core.dll

Syncfusion.Compression.Base.dll

Syncfusion.XlsIO.Base.dll              should be included.

When I refered to those, my test solution is not accepted.

Your reply was for ASP.NET, I want you to make sure.

 

Thank you.

 


SRTestExcelFileIO_f7c42308.zip

Jiwon
Replied On July 3, 2012 02:02 AM

My team member's computer is working as same chord.
 
One more thing for your help, I attach inner exception.
 
--
   at Syncfusion.Compression.Zip.ZipCrc32.ComputeCrc(Byte[] buffer, Int32 offset, Int32 length, UInt32 startCrc)
   at Syncfusion.Compression.Zip.ZipArchiveItem.CheckCrc(Byte[] arrData)
   at Syncfusion.Compression.Zip.ZipArchiveItem.DecompressDataOrdinary()
   at Syncfusion.Compression.Zip.ZipArchiveItem.DecompressData()
   at Syncfusion.Compression.Zip.ZipArchiveItem.get_DataStream()
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.ParseContentType()
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.ParseDocument(List`1& themeColors)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl.ParseExcel2007Stream(Stream stream, String password)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl.ParseStream(Stream stream, String password, ExcelVersion version, ExcelParseOptions options)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, Stream stream, ExcelParseOptions options, ExcelVersion version)
   at Syncfusion.XlsIO.Implementation.ApplicationImpl.CreateWorkbook(Object parent, Stream stream, ExcelVersion version, ExcelParseOptions options)
   at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream, ExcelVersion version, ExcelParseOptions options)
   at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream, ExcelOpenType openType, String fileName, ExcelVersion version, ExcelParseOptions
 
 
 

Mahajothi R [Syncfusion]
Replied On July 4, 2012 02:33 AM

Hi Jiwan,

 

Thank you for updating us with test solution. We have executed the updated test sample with our custom input template (.xlsx) file, we are not able to reproduce the issue. The reported exception may occur when trying to open the corrupted input excel file so could you please update us with your input template which will helps us to further investigate on this.

 

Deployment:

Your test sample (SRTestWinForm) created with the target version of .NET Framework Client Profile so it do not accept “Syncfusion.XlsIO.Base.dll” assembly. To add “Syncfusion.XlsIO.Base.dll” assembly need to change the project Target Framework.

 

Please let us know if you require any further clarifications.

 

Regards,

Mahajothi R.


Bijal
Replied On October 30, 2012 08:19 AM

Hi Mahajothi,

The sample code shared works perfectly to open .xlsx file.

But when in the same code, if I replace it to open my .xlsx, it fails to open. 

//create object for excel engine

ExcelEngine excelEngine = new ExcelEngine();

//Read input file

//Stream strm = File.OpenRead(@"C:\Users\bmandv1\Exprt\JIRA-3163-CSVtoExcel\OpenExcelFile1960395822\OpenExcelFile\InputFile\NorthwindTemplate.xlsx");

Stream strm = File.OpenRead(@"C:\Users\bmandv1\ExcelTemplate.xlsx");

//open excel workbook

IWorkbook book = excelEngine.Excel.Workbooks.Open(strm, ExcelOpenType.Automatic);

//close the workbook object

book.Close();

 

can you kindly help me with what is the issue with my .xlsx, not allowing to open.

I've attached my .xlsx file for your refernce.

 

Thanks

-Bijal



mytemplate_3_7993f9b3.zip

Mahajothi R [Syncfusion]
Replied On October 31, 2012 06:32 AM

Hi Jiwon,

Thank you for updating us with input template. The issue mentioned here is suspected to be a defect. Please create a new incident regarding the issue mentioned in Forum 104151 so that we can proceed further on this.

 

Please let us know if you require any further clarifications.

 

Regards,

Mahajothi.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;