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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Export to Excel Fails when Text Filter Enabled

Thread ID:

Created:

Updated:

Platform:

Replies:

144234 Apr 25,2019 10:21 PM UTC May 6,2019 12:08 PM UTC ASP.NET Web Forms 7
loading
Tags: Grid
Levi Leonards
Asked On April 25, 2019 10:21 PM UTC

I have an Excel Style Grid that uses the Export to Excel Feature.
When I enable a text filter on one of the columns, I get an error.

Here is where the code fails:
    Dim dt As DataTable = data.Table
    exp.Export(DeficienciesGrid.Model, dt, ExportFilename, ExcelVersion.Excel97to2003, False, True, "flat-lime")

Here is the error I get. I can include more info as needed.
[Exception: Object reference not set to an instance of an object.]
   Syncfusion.JavaScript.Web.CommonDataBoundControl.RaisePostBackEvent(String EventArgument) +321
   Syncfusion.JavaScript.Web.CommonDataBoundControl.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String args) +5
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9884278
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639

Vignesh Natarajan [Syncfusion]
Replied On April 26, 2019 02:12 PM UTC

Hi Levi, 
 
Thanks for contacting Syncfusion Support. 
 
Query: “When I enable a text filter on one of the columns, I get an error. 
 
Before proceeding your query, we need some additional information to find the cause of the issue. So kindly share us the following details. 
 
  1. Complete Grid code example(both in server and client side).
  2. Are you facing the issue while applying the filter to string(text) column alone or all the available column?
  3. Screenshot/Video demo along with replication procedure to reproduce the issue at our end.
  4. Stringified model of the Grid on server side while on Exporting as like below screenshot and copy it into clipboard.
 
 
 
 
Regards, 
Vignesh Natarajan. 
 
 
 


Levi Leonards
Replied On April 26, 2019 04:47 PM UTC

Vignesh,
Here are the items you asked for:
1. Complete Grid code example(both in server and client side). 
(See Attached Zip file)

2. Are you facing the issue while applying the filter to string(text) column alone or all the available column?
The export only appears to fail when a column is filtered to exclude (not equal to) a text value. When there are no filters or when the filter is to include (equal to) a text value the export works. (See attached screenshots in zip)

3. Screenshot/Video demo along with replication procedure to reproduce the issue at our end.
See attached screenshots in zip

4. Stringified model of the Grid on server side while on Exporting as like below screenshot and copy it into clipboard.
Not sure exactly how to do that, but I made a csv of the exported Watch variable DeficienciesGrid.Model (In attached zip)



Attachment: Grid_Export_to_Excel_Error_5065501d.zip

Vignesh Natarajan [Syncfusion]
Replied On April 29, 2019 10:44 AM UTC

Hi Levi, 

Thanks for sharing the requested details. 

We have validated the reported issue by preparing a sample using your code example and we are unable to reproduce the reported issue at our end. For your convenience we have attached the sample, please refer the below link. 


After referring the sample if you still facing the issue please get back to us with the following details. 

  1. Share the Essential studio version. (xx.x.x.xx).
  2. Share the Export Grid model. Refer the below steps,
  1. Open the Grid model in text visualizer. Refer the below screenshot.
 
 
  1. Click the Text visualizer then the model will open in mew dialog. Refer the below screenshot,
 
 
  1. Copy the model and past it in text document and kindly send to us.
  1. If possible, reproduce the reported issue in the shared sample and revert back to us.

The provided details, will help us to resolve the reported issue as early as possible. 

Regards, 
Vignesh Natarajan. 
 


Levi Leonards
Replied On April 29, 2019 07:33 PM UTC

Thanks, I will look at your example.
Attached is the Stringified Grid Model as you instructed. I included one when an exception is thrown and one without.

The only difference in the grid model the filteredcolumns:
Exception Thrown:
     "filteredColumns":[{"field":"WO","operator":"notequals","predicate":"and","value":"OCEANEERING"}]
No Exception:
     "filteredColumns":[]

Attachment: Stringified_Grid_Models_f763aeab.zip

Vignesh Natarajan [Syncfusion]
Replied On April 30, 2019 11:59 AM UTC

Hi Levi, 

Thanks for sharing the Exporting model.  

We have created the sample based on the shared model but still we are unable to reproduce the reported issue at our end. Please refer the below link for sample, 


Still facing the issue, please get back to us with the below details. 

  1. Share the Essential studio version are you using. (XX.X.X.XX)
  2. Reproduce the reported issue in the shared sample Or share the issue reproducing hosted sample.

Regards, 
Vignesh Natarajan. 


Levi Leonards
Replied On May 2, 2019 07:09 PM UTC

I am using version 17.1451.0.38

I reviewed your sample project and I could not reproduce my error using the data set you provided so I began rebuilding my page into your project with different data sources.
I believe the issue may be related to the ODBC data source (Access mdb backend) where my data is coming from. When I used the ODBC database in your project, and enable a not equal filter I get the "Object reference not set to an instance of an object" exception when exporting to Excel.  Please see the attached project

Note that you will have to create a 32 Bit ODBC connection named EC_WEB_ODBC to the Access Database EC_WEB_ODBC.MDB located in the Project App_Data Folder.


Attachment: vbexport_ODBC_2fcafd7e.zip

Vignesh Natarajan [Syncfusion]
Replied On May 6, 2019 12:08 PM UTC

  
Hi Levi,   
  
Thanks for contacting Syncfusion support.   
  
Query: “enable a not equal filter I get the "Object reference not set to an instance of an object" exception when exporting to Excel  
  
We have created a new incident under your support category for your query. So kindly login into your account to view the incident.  
  
  
Regards,  
Vignesh Natarajan.  
 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon