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 Jan 20, 2023 9:53 am

Hi Support,

My web application encounter the "sprឹ' threw an exception" when we generate excel (Refer to the stack trace at bottom).

These are the troubleshooting I have done from my side:
- The issue happen once a while. User might able to generate excel for the first time, and they might get the error when then generate excel subsequently.
- I can generate excel again after I recycle app pool
- When the web application is not able to generate excel, I will host a duplicated web application in IIS. The duplicated web application able to generate excel while the original web application is not able to generate excel. (both web application are sharing the same app pool)

The Spire.XLS version is 11.12.2.5040.

Let me know if any information is needed from me


Code: Select all
12:12:01.430    System.TypeInitializationException: The type initializer for 'Spire.Xls.Core.Spreadsheet.XlsPageSetupBase' threw an exception. ---> System.TypeInitializationException: The type initializer for 'sprឹ' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
   at System.Drawing.SafeNativeMethods.Gdip.Initialize()
   at System.Drawing.SafeNativeMethods.Gdip..cctor()
   --- End of inner exception stack trace ---
   at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromScan0(Int32 width, Int32 height, Int32 stride, Int32 format, HandleRef scan0, IntPtr& bitmap)
   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
   at sprឹ..cctor()
   --- End of inner exception stack trace ---
   at Spire.Xls.Core.Spreadsheet.XlsPageSetupBase.PaperSizeEntry..ctor(Double width, Double height, MeasureUnits units)
   at Spire.Xls.Core.Spreadsheet.XlsPageSetupBase..cctor()
   --- End of inner exception stack trace ---
   at Spire.Xls.Core.Spreadsheet.XlsWorksheet.InitializeCollections()
   at Spire.Xls.Core.Spreadsheet.XlsWorksheetBase..ctor(Object A_0)
   at Spire.Xls.Core.Spreadsheet.XlsWorksheet..ctor(Object A_0)
   at Spire.Xls.Core.Spreadsheet.Collections.XlsWorksheetsCollection.Add(String sheetName)
   at Spire.Xls.Core.Spreadsheet.XlsWorkbook.ᜀ(Int32 A_0)
   at Spire.Xls.Core.Spreadsheet.XlsWorkbook..ctor(Object A_0)
   at Spire.Xls.Workbook..ctor()
   at PlanWorthFactor_WorkFlow.svrExtraction.GenerateCIMBBulkOutput(List`1 bulkDataList, String tempPath, String fileNamePrefix)
   at PlanWorthFactor_WorkFlow.svrExtraction.fnGACNewCIMBExtraction(WebResponse resp)

j2j2j2j2
 
Posts: 9
Joined: Tue May 25, 2021 6:58 am

Mon Jan 23, 2023 5:56 am

Hello,

Thanks for your inquiry.
At present, the latest version of our Spire.XLS is Spire.XLS Pack (Hotfix) Version: 13.1.1. Please use this version to test first. If the issue still exists after testing, please provide the following information for further investigation. You could attach them here or send them to us via email (support@e-iceblue.com). Thanks in advance.
1) Your complete test project (which can reproduce your issue).
2) Your test Environment, such as OS info (E.g., Windows 10 64 bit) and region setting (E.g., China, Chinese).


Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.XLS