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

Null Reference Exception when export treegrid to Pdf

Thread ID:

Created:

Updated:

Platform:

Replies:

127970 Dec 22,2016 08:47 AM UTC Jan 2,2017 11:50 AM UTC ASP.NET MVC 3
loading
Tags: TreeGrid
Mohamed Salah
Asked On December 22, 2016 08:47 AM UTC

Hi,
if parent data include 'ID, Name, child<>' and each child data include 'ID, Name , Details'.
Error appear Null Reference Exception 

Regards,
M.Salah

Jonesherine Stephen [Syncfusion]
Replied On December 23, 2016 09:31 AM UTC

Hi Salah, 
We regret for the inconvenience caused. 
We have analysed the reported issue with our sample. We are unable to reproduce the issue. Can you please revert us by modifying the sample based on your application along with the replication procedure? This would be helpful for us to serve you. 
Disclaimer: We have removed bin and obj folder in the given sample for some security reasons, we must include necessary dlls to export TreeGrid control which is available in Essential Studio installed location. 
Regards, 
Jone sherine P S 


Mohamed Salah
Replied On December 28, 2016 09:38 AM UTC

Hi, 
This is my sample. I wish that help you.
Regards,
M.Salah

Attachment: excelexport_5365b270.rar

Mahalakshmi Karthikeyan [Syncfusion]
Replied On January 2, 2017 11:50 AM UTC

Hi Salah, 
Sorry for the inconvenience caused. 
We have analyzed the given sample and came to know that the issue is because the child class didn’t have the definition for “subtasks” to specify its child. It is mandatory to define this property in both the parent and child classes to know its child count while exporting. Please find the below code example for details. 
public class child 
{ 
    //… 
    public List<child> subtasks { get; set; } 
} 
We have also modified the sample and you can find the sample from the following location. 
Regards, 
Mahalakshmi K. 


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

;