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.

Fri Mar 08, 2019 9:51 am

I have project by NET.Core and publish by docker in Linux environment. But when it call Sheet.ToImage, it throws Exception "object reference not set to an instance of an object find object in exception c#".
This is detail exception:
"System.NullReferenceException: Object reference not set to an instance of an object.
at sprᬝ.ᜀ(String A_0, sprᬊ A_1, Int32 A_2)
at spr᪱.ᜀ(String A_0)
at spr᪫.ᜀ(spr᪱ A_0)
at spr᪬..ctor(spr᭿ A_0, Boolean A_1)
at spr⌱.ᝬ(sprⳚ A_0)
at spr⫑.᜖(sprⳢ A_0, Graphics A_1)
at spr⌵.ᜀ(Int32 A_0, ConverterSetting A_1)
at spr⌵.ᜀ(Int32 A_0, ConverterSetting A_1, Boolean A_2)
at spr⌶.ᜀ(Int32 A_0, Single A_1, Single A_2)
at Spire.Xls.Core.Spreadsheet.XlsWorkbook.ᜀ(Int32 A_0, Int32 A_1, Int32 A_2, Int32 A_3, Int32 A_4, Single A_5, Single A_6, Image& A_7, Stream& A_8)
at Spire.Xls.Core.Spreadsheet.XlsWorkbook.SaveAsImages(Int32 sheetIndex, Int32 firstRow, Int32 firstColumn, Int32 lastRow, Int32 lastColumn, Single dpiX, Single dpiY)
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.ToImage(Int32 firstRow, Int32 firstColumn, Int32 lastRow, Int32 lastColumn)
at Auvenir.Service.FileService.GenerateImageFromExcelAsync(IFormFile file)".
I use SpireXLS version 9.1.22

Thank you

thao.le
 
Posts: 6
Joined: Thu Jan 24, 2019 2:19 am

Fri Mar 08, 2019 10:41 am

Hi,

Thanks for your inquiry.
To help us investigate your issue quickly and accurately, please provide your input Excel file. You could send it to us 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 11, 2019 5:51 am

Hi Nina
I mail to provide my project and input excel. Please check your mail.
Thank you
Thao

thao.le
 
Posts: 6
Joined: Thu Jan 24, 2019 2:19 am

Tue Mar 12, 2019 6:16 am

Hi,

Thanks for your sharing.
Sorry currently we don’t have the Docker engine as yours. We need time to build one. I did a test on Linux environment firstly and didn’t face the exception. Did the issue occur when you directly run your code on Linux environment? Besides, please note that on Linux, you need to install Libgdiplus library independently. Please install the library on your side and check if the issue still happens when running with Docker. Please refer to the following documentation.
https://www.e-iceblue.com/Tutorials/Spire.Doc/Getting-Started/How-to-use-Spire.Doc-on-.NET-Core.html

Sincerely,
Nina
E-iceblue support team
User avatar

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

Return to Spire.XLS