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. Image for the cookie policy date
close icon

Grid Export to Excel Fails when Text Filter Enabled

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

7 Replies

VN Vignesh Natarajan Syncfusion Team 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. 
 
 
 



LL Levi Leonards 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


VN Vignesh Natarajan Syncfusion Team 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. 
 



LL Levi Leonards 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


VN Vignesh Natarajan Syncfusion Team 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. 



LL Levi Leonards 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


VN Vignesh Natarajan Syncfusion Team 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.  
 


Loader.
Live Chat Icon For mobile
Up arrow icon