Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
785
Won't export grid when sorted by column that contains null values
posted

I have a simple implimentation of a WebExcelExporter that exports data in a WebHierarchicalDataGrid.
It is a simple task list with values such as TaskTitle, TaskOwner, TaskStatus, & TaskDueDate.
When sorting using a column that does not contain any nulls, everything works fine.
If sorting with a column that contains some nulls, you get the following result:
Object reference not set to an instance of an object.
on this line of code:
this.WebExcelExporter1.Export(this.WebHierarchicalDataGrid1, wSheet);

If, for example, I am sorting by TaskStatus and some of the tasks do not have a value, the WebHierarchicalDataGrid knows how to handle this.... it creates a "group" that has a label something like this: "TaskStatus: (%number%)".
The TaskStatus groups that have a value for TaskStatus get a label something like this: "TaskStatus: Active (%number%)", or "TaskStatus: Pending (%number%)", etc...

when you click export, you get the "Object reference not set to an instance of an object." error.

Evidently, the WebHierarchicalDataGrid knows how to show all rows of data, creating a group for those rows that have a null value, but the exported doesn't know how to write them to an XLS?
Can the exporter not be programmed to create a group in the XLS like "TaskStatus: (%number%)"?