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.

null reference exception in ExportToCSV method

Thread ID:

Created:

Updated:

Platform:

Replies:

122130 Feb 18,2016 10:28 AM Feb 24,2016 04:03 AM WPF 5
loading
Tags: GridDataControl
Steve McWilliams
Asked On February 18, 2016 10:28 AM

I am trying to add button action to export contents of my dataGrid to a csv file.
In trying to follow simple code example I found, I get null reference exception.
I have added Syncfusion.GridConverter.Wpf, Syncfusion.XlsIO.Base and Syncfusion.XlsIO.Wpf references to project

Can you tell what is wrong from attached screen capture ?

Attachment: Capture_de5beedb.7z

Sowndaiyan Paulpandi [Syncfusion]
Replied On February 19, 2016 05:44 AM

Hi Steve,

Thanks for contacting Syncfusion Support.

We have prepared
the sample for converting the GridDataControl in the CSV file. This sample working fine without any exception from our side. We have attached our tested sample in the below location, please revert by modifying the attached sample based on your application along with the replication procedure and also could you please share the details about which Syncfusion Version you have used in your application?. It will be helpful for us to analyze further. 

Sample : http://www.syncfusion.com/downloads/support/forum/122130/ze/CSV_Export_Demo-1139533253



Regards,

Sowndaiyan


Steve McWilliams
Replied On February 19, 2016 11:27 AM

I use VisualStudio 2013, but I have an older version of Syncfusion (Essential Studio 10.3.0.43 ), which is probably the main problem.
I can't try upgrading until next week, but after that maybe everything will work OK.

Anyway, I got a XAML parsing exception trying to run your example directly.
Then I tried just revising my code to use the Command and CommandTarget on the exportEventsButton, as your sample does, but I could not get it to accept the <syncfusion.LayoutControl.GridView> element, even though I have Syncfusion.SampleLayout reference loaded.

I tried just executing the code in the ExportAllToCSV method in my button click method, but then I got the 'No entry point found' error shown in attached JPG.
In case it helps, I attached the relevant xaml and xaml.cs files I'm using.
 'runDataGrid' is name of GridDataControl and 'exportEventsButton' is the button, obviously. 

Attachment: ExportCSV_6643b6b7.7z

Farjana Parveen Ayubb [Syncfusion]
Replied On February 22, 2016 08:07 AM

Hi Steve,

Please let us know once you have upgraded from 10.3.0.43 to our latest version.

We have checked the reported issue “Exception throws while export to CSV” on our end with your XAML and CS files and in your current version(10.3.0.43). But GridDataControl is exported into CSV without any exception.

Please refer the below sample which we are tried to reproduce the issue,

Sample Location: Export_to_CSV


Please check this issue once your upgraded to our latest version and let us know if you still facing the same issue.

Regards,
Farjana Parveen A

Steve McWilliams
Replied On February 23, 2016 04:10 PM

I upgraded to latest version and now the Export function is working great.
Thanks for your help.

Sowndaiyan Paulpandi [Syncfusion]
Replied On February 24, 2016 04:03 AM

Hi Steve,

Thanks for the update.

Please let us know if you need further assistance.
Regards,
Sowndaiyan

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.

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.

;