GridWeb.ImportExcelFile throws exception "Object reference not set to an instance of an object"

Hi,

Thanks for reporting the problem.

I have logged your problem and comment in our database. We will fix it asap.

This issue has been logged as CELLSNET-28227.

Please also test it on latest version Aspose.Cells.GridWeb v2.5.3.2005 and let us know your feedback.

Hi,

The updateData() updates data asynchronously when using EnableAJAX.

The btnSave_Click postback event is fired early than updateData() on server side. So, we have to invoke updataData() synchronously on client side. The issue is resolved now.

Please modify ‘btnSave’ tag as:

ASP.NET


<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–>


<asp:LinkButton runat="server" ID="btnSave" style="display:none;" OnClick="btnSave_Click"></asp:LinkButton>


<input type="button" value="Save" onclick="UpdateGridData();">




And modify ‘UpdateGridData’ function as:

function UpdateGridData() {


var grid = GetGrid();


if (grid) {

var acp = grid.ajaxcallpath;


grid.ajaxcallpath = null; // disable EnableAJAX


grid.updateData(false);


grid.validateAll();


var btnSave = document.getElementById(“ctl00_mainContent_btnSave”);


btnSave.click();


grid.ajaxcallpath = acp; // restore EnableAJAX

} //if

}//Update

The issues you have found earlier (filed as 26523) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi,
It’s been long time since I post last. I’m currently using aspose.cells.gridweb licensed version 2.5.3.2001. Receiving some constant complains from our client:

  1. The page is too heavy due to the components script files even though the size of the excel is very small.
  2. Doesn’t works well in ajax mode and its buggy.
  3. Selecting one cell and then start editing, it doesn’t take the first key stroke as its for entering the cursor to the cell.

and few others…

I downloaded the latest trial version 2.7.6.2000. Is there any massive improvement on the latest build regarding the point mentioned above? If so I’m planning to buy the license ASAP.

Thanks.

Wahid

Hi,

Thanks for your posting.

We have fixed some of reported bugs which we will publish in a release notes when we will release a major version.

However, I will strongly recommend you to download and try the current latest version:
Aspose.Cells
for GridWeb v2.7.6.2003


Let us know your feedback.

wahid.choudhury:
Hi,
I'm now testing the new version you suggested. But I've one important query. GridWeb.ModifiedCells contains a collection of WebCell. Is there any way to get the corresponding sheet name of the modified webcell?

Thanks.
Wahid
Hi,

Please download and use the latest version: Aspose.Cells for GridWeb v2.7.7.2002

Please refer to this thread.
Is there any way to get the corresponding sheet name of the modified webcell?

For your newer issues, please create newer thread.

Hi,
The latest version doesn’t work as it crashes to load a simple excel file.

For “Sheet Name with modified cell (s)”, I didn’t get any solution following link you provided. I need this urgent. Can you help?

Thanks.
Wahid

Hi,

The sheet name should be active sheet name of a gridweb control e.g

GridWeb1.WebWorksheets.ActiveSheet.Name

Hi,
Thanks. Modified cells problem solved. Now I need a link to latest stable release of the component. Also please provide the latest acw_client folder with latest scripts. After having a quick look I’m going to buy the license.

Thanks.
Wahid

Hi,

That’s good to know your problem is resolved.

Please download the latest release from this link:
Aspose.Cells
for GridWeb v2.7.7.2002



It also contains the latest acw_client with latest script.

Hi,
I’m still facing following problem while trying to import the attached excel file:
Message: Exception type: System.InvalidOperationException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Exception message: Failed to compare two elements in the array.
Inner exception 1 type: System.ArgumentException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Inner exception 1 message: Object must be the same type as the enum. The type passed in was ‘System.String’; the enum type was ‘?.?’.
Stacktrace: at System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object value, IComparer comparer)
at System.Collections.SortedList.IndexOfKey(Object key)
at System.Collections.SortedList.get_Item(Object key)
at Aspose.Cells.GridWeb.Data.WebWorksheets.?(Boolean )
at ?.?.?(WebWorksheets )
at Aspose.Cells.GridWeb.Data.WebWorksheets.ImportExcelFile(String fileName)
at UsingAsposeGrid._Default.LoadDefaultGrid() in D:\Projects\My Projects\UsingAsposeGrid\UsingAsposeGrid\Default.aspx.cs:line 80
Class: UsingAsposeGrid._Default
Method: LoadDefaultGrid
LineNumber: 80
StackTrace: at mr.util.logging.InlineProfiler.GetExtendedPropertiesForException(Boolean appendStackTrace) in D:\Projects\My Projects\UsingAsposeGrid\mr.util\logging\InlineProfiler.cs:line 320
at mr.util.logging.InlineProfiler.WriteException(Exception exception, String[] categories) in D:\Projects\My Projects\UsingAsposeGrid\mr.util\logging\InlineProfiler.cs:line 200
at mr.util.logging.LogHelper.WriteException(Exception exception, String[] categories) in D:\Projects\My Projects\UsingAsposeGrid\mr.util\logging\LogHelper.cs:line 105
at UsingAsposeGrid._Default.LoadDefaultGrid() in D:\Projects\My Projects\UsingAsposeGrid\UsingAsposeGrid\Default.aspx.cs:line 80
at UsingAsposeGrid._Default.Page_Load(Object sender, EventArgs e) in D:\Projects\My Projects\UsingAsposeGrid\UsingAsposeGrid\Default.aspx.cs:line 36
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\usingasposegrid\d28813f0\b2fd3b43\App_Web_vvg9navh.0.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

Am I missing anything?
Thanks.
Wahid

Hi,

Thanks for your reporting a problem.

I was able to replicate this problem using the latest version.

We have logged this issue in our database. We will look into this issue and once the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSNET-40786.

Below is a code and screenshot for a reference.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\Book1.xlsx”;


this.GridWeb1.WebWorksheets.ImportExcelFile(filePath);


Screenshot:

Hi,


Please try our previous fix v2.7.7.2001, it works fine with your file and is stable version.

In the mean time, we will continue to test/evaluate the latest fix v2.7.7.2002 to fix your issue and other elements (already logged ticket(s)).

Thank you.

Hi,
Can you provide me the link to buy the license? The old license which I was using for GridWeb_Version_2.5.3.2001. And it worked for Aspose.Cells_Version_5.1.4.0 component also. Should the new license will work for the cells component also?

Thanks.
Wahid

Hi,

Thanks for your posting and using Aspose.

Please contact Aspose.Purchase for purchasing license.

If your license date has not expired, then you can use the new component without any problem.

License date expires after 1 year from the date of your purchase. You can check the license expiry date by opening your license in a notepad.

But if your license date has expired, you will have to renew your license subscription.

Hi,


"The old license which I was using for GridWeb_Version_2.5.3.2001. And it worked for Aspose.Cells_Version_5.1.4.0 component also. Should the new license will work for the cells component also"

Yes, Aspose.Cells for .NET is a complete package that includes Aspose.Cells library and Grid Controls (Desktop + Web). If you purchase or upgrade the new license e.g Aspose.Cells.lic, it will work for both Aspose.Cells.dll (library) and Grid controls (GridDesktop + GridWeb).

Thank you.

Hi,
GridWeb crashes for the attached file. Please fix.
Thanks.
Wahid

Hi,

I was able to replicate the problem using the latest version:
Aspose.Cells
for GridWeb v2.7.7.2002



We will look into it and fix the bug and update you asap.

This issue has been logged as CELLSNET-40798.

Hi,
Is the issue resolved? I don’t have access to the CELLSNET-40798.

Thanks.
Wahid

Same issue with the attached file. Please fix.

Thanks.
Wahid