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.
Syncfusion Feedback

NullReferenceException

Thread ID:

Created:

Updated:

Platform:

Replies:

73864 May 22,2008 09:06 PM Mar 15,2010 02:57 AM ASP.NET Web Forms (Classic) 7
loading
Tags: XlsIO
Sarah
Asked On May 22, 2008 09:06 PM

I have an app where I am experiencing random NullReferenceExceptions in the Finalize method of the ExcelEngine, as well as numerous other random and impossible to consistently reproduce Syncfusion exceptions.

I created some sample code which throws a NullReferenceException on the Workbook.Close.

When the ExcelEngine is moved to the class level alongside the workbook object, the problem goes away.

This is not exactly the same issue as I am experiencing but I thought it might be related.

I noticed in some of the Syncfusion sample code that they are declaring the ExcelEngine inside a function and then returning a workbook/worksheets from that function. I assume then that I should in theory be able to let my ExcelEngine go out of scope and still be able to use my Workbook and vice versa? I experience problems with my app regardless of whether I am calling Dispose methods and setting objects to nothing after use.

This is happening with version 6.2 and with the previous version.



SyncfusionBug.zip

Sarah
Replied On May 23, 2008 01:39 AM

I'll just add that I ran the sample code again several times this afternoon with the following results:

On one occasion the code worked.
On several other occasions I got the NullReferenceException again (seems to happen particularly when I set a breakpoint on the Workbook.Close)
On other occasions I got a variety of different errors.





Yavanaarasi G [Syncfusion]
Replied On May 26, 2008 07:44 AM

Hi Sarah,

Thank you for your interest in Syncfusion products.

I am able to see the issue that you have mentioned. But the issue is not because of XlSIO. The issue reproduced only with your sample. Your class file can be called wrongly. I have created a new sample with class file and called the function here no exception thrown. Please refer the sample in the below link:

http://websamples.syncfusion.com/samples/XlSIO.Web/6.2.0.40/F-73864/Syncfusionsample.zip

Please try to check your code and let me the issue still exists.

Regards,
G.Yavana



Sarah
Replied On May 27, 2008 02:49 AM

Thanks, but I am wondering why the name of my class would be relevant to Xlsio?

It seems you changed the case of the class and one of the functions? I tried changing this in my own sample project and it now works most but not all of the time. I also found I can change the class name back again and it will continue to work (most of the time).

The sample project you sent me is still giving me the same exceptions. Occasionally, it will also work for a while.

I think the renaming of the class is having some side effect which is temporarily causing the problem to go away, but I don't think it is the root cause of the problem. Also note that the classes in my real app have different names and still experience the problem.

Thanks




Yavanaarasi G [Syncfusion]
Replied On May 28, 2008 08:48 AM

Hi Sarah,

It seems like another forum that you are created regarding this issue. Could you please provide the stack trace for this issue also?

Regards,
G.Yavana


Sarah
Replied On May 28, 2008 08:27 PM

Details of the exception(s) in relation to this issue are attached. This is a seperate issue to my other post. Thanks




Error Details.zip

Yavanaarasi G [Syncfusion]
Replied On May 29, 2008 07:46 AM

Hi Sarah,

Thank you for providing the details.

We have forwarded the stack trace to our development team. Also please provide the sample image it will be helpful to reproduce the issue in our side.


Regards,
G.Yavana


JiSoo Hong
Replied On March 15, 2010 02:57 AM

Hi there,

VERSION: Syncfusion Essential Studio User Interface 2009 Vol 4 (V7.4.0.20)


I am trying to make an excel file using ExcelEngine.

In my computer (Win XP), it works FINE.
However, I got an exception error as attached through the WEB SERVER(WIN 2003 Server).

I copied the following files in the bin directory of WEB SERVER:
Syncfusion.Core.dll
Syncfusion.Compression.Base.dll
Syncfusion.xlsio.base.dll
Syncfusion.xlsio.Web.dll

Again, Syncfusion and MS Excel are not installed in the WEB SERVER. (Is it OK??)

The following is a sample code I tried.

============== source code =======
private void ExportExcel()
{
//A new instance of Excel Application is created
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;

//A new workbook object is created
IWorkbook myWorkbook = excelEngine.Excel.Workbooks.Add();
IWorksheet mySheet = myWorkbook.Worksheets[0];
mySheet.Name = "Weekly";


int i, j;
for (i = 1; i <= 20; i++)
{
for (j = 1; j <= 20; j++)
{
IRange xlRange = mySheet.Range[i, j];
xlRange.Value = string.Format("({0}, {1})", i, j);
}
}

string sXlFileName = "test.xls";
myWorkbook.SaveAs(sXlFileName, ExcelSaveType.SaveAsXLS, Response, ExcelDownloadType.PromptDialog);
}
===================================


Thanks in advance.
Hong



Result_60cbd4f6.zip

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.

Warning Icon 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.Close Icon

;