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.

Mon Feb 26, 2018 12:07 pm

Hi,

I receive the following stack trace the second time I try to render a image of any XLSX file:
System.NullReferenceException: Object reference not set to and instance of an object.
at spr955.1(XlsWorksheet A_0, Dictionary'2 A_1)
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.ParseData(Dictionary'2 dictUpdatedSSTIndexes)
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.10()
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.ClearAll()
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.DisposeAll()
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.Close(Boolean SaveChanges, String Filename)
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.Finalize()


This will only occur after trying to render the attached file first. Any other XLSX file that I try to render after will cause this error to be throw.

The code being used to Render the image is as follows:
Code: Select all
Workbook workbook = new Workbook();
workbook.LoadFromStream(content);
Worksheet sheet = workbook.Worksheets[0];
var usedRange = sheet.Range;
return sheet.ToImage(usedRange.Row, usedRange.Column, usedRange.LastRow, usedRange.LastColumn);

please note the above code is within a try/catch

I have also tried wrapping this is a using block and manually disposing neither have had any affect.
Hope to here from you soon
Thanks
James
Attachments
TestFile.zip
This is the file that will cause the problem
(7.72 KiB) Downloaded 274 times

jgooch
 
Posts: 5
Joined: Mon Oct 09, 2017 10:55 am

Tue Feb 27, 2018 4:46 am

Dear James,

Thanks for your inquiry.
I tested your case with our latest Spire.XLS Pack Version:8.0, but didn't reproduce the issue you described. Please use this version to try again. Looking forward to your reply.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Tue Feb 27, 2018 10:46 am

Hi Nina,
I have dropped version 8.0 into the solution and it does appear to fix the problem,
however I am now having a problem with dependencies of the other Spire Office components that are within the solutions.

The components that the solutions is consuming are
Spire.Common
Spire.Doc
Spire.License
Spire.Pdf
Spire.Presentation
Spire.XLS

I have tried downloading the newest version of each of these, but it seems that Doc, Presentation and XLS all require different versions of Spire PDF.

Any advice in reconciling this would be greatly appreciated
Hope to Here from you soon
Thanks
James

jgooch
 
Posts: 5
Joined: Mon Oct 09, 2017 10:55 am

Wed Feb 28, 2018 1:48 am

Hello James,

Thanks for your feedback.
The components you downloaded are independent, and they can't be used together in a same project. To avoid the incompatible, please download the Spire.Office Platinum (DLL Only) Version:2.16.27 package, and add corrsponding dlls you need from it into your project and try again. If there is any problem, welcome to write to us again.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Wed Feb 28, 2018 1:25 pm

Hi Nina,

I have tried dropping the XLSX v8 into this package. This causes a dependency issue with pdf.

Please advise the best process around this
Thanks
James

jgooch
 
Posts: 5
Joined: Mon Oct 09, 2017 10:55 am

Thu Mar 01, 2018 2:57 am

Dear James,

Thanks for your feedback.
Please note that the Spire.Xls and Spire.Office are two independent products. You can't use their dlls together. In your case, just add all the dlls you want from Spire.Office package into your project.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Wed Mar 07, 2018 9:35 am

Hello,

Greetings from E-iceblue.
Has your issue been resolved?
Your feedback will be highly appreciated.

Best wishes,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Fri Mar 09, 2018 9:26 am

Hi Nina,

The issue has not been resolved, the Spire.Office package that we are using has a version of the Spire.XLS which contains the issue when processing the file.
As you have said we cannot just drop the Spire.XLS dll with the fix in, into the same project as the other spire office components.

For the moment we have put in a work around to avoid processing files which will potentially cause this issue,
and are waiting for a new release of Spire.Office which contains the Spire.XLS dll with the fix.

Thanks
James

jgooch
 
Posts: 5
Joined: Mon Oct 09, 2017 10:55 am

Fri Mar 09, 2018 10:21 am

Dear James,

Thanks for your feedback.
You might have confused the Spire.Xls dlls and Spire.Office dlls. For your situation, I suggest downloading the Spire.Office Platinum (DLL Only) Version:2.16.27 package again, and directly reference the following dlls from the package into your project. Please make sure that you have removed all old dlls before adding new ones. If there is still the issue, please provide a sample application which can replicate your issue with us. We will look into it and help you out.
Spire.Common.dll 1.2.782.14040
Spire.Doc.dll 6.2.2.4040
Spire.License.dll 1.3.6.40
Spire.Pdf.dll 4.2.4.3040
Spire.XLS.dll 8.0.0.14040
Spire.Presentation.dll 2.9.0.14040

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Wed Mar 14, 2018 12:18 pm

Hi Nina,

I have tried dropping in the new Spire Office Package into the solution.
The Problem mentioned in the original post is still occurring.
Please note it only appears when processing the file twice, without stopping the application

Look forward to hearing from you
Thanks
James

jgooch
 
Posts: 5
Joined: Mon Oct 09, 2017 10:55 am

Thu Mar 15, 2018 10:22 am

Hi,

Thanks for your reply.
Sorry that I still can't reproduce your issue on my side. To help us locate your issue accurately, please provide your whole application showing your issue to us (you could send it via email support@e-iceblue.com). Thanks in advance.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Mon Mar 19, 2018 7:39 am

Dear James,

How is the issue now? Could you please give us some feedback at your convenience? Thanks in advance.

Best regards,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.XLS

cron