Avoid NullReferenceException
Posted: Fri May 26, 2017 7:51 pm
Hello guys!
I got a report with two data sources:
- The former is codded on backend;
- The latter is created by me using SQL statement wich I call a SQL FUNCTION using two fields of the other data source as PARAMETERS (i've created the parameters on DataSource builder) to return data.
My problem is that due to business reasons, the backend data source sometimes can return nothing and then I get a NullReferenceException because of this:
The error when I run the report:
The error only occurs with datetime types, I think it's because the datetime is a construct type and not like an integer for example, that returns 0 when was not changed.
Thks.
I got a report with two data sources:
- The former is codded on backend;
- The latter is created by me using SQL statement wich I call a SQL FUNCTION using two fields of the other data source as PARAMETERS (i've created the parameters on DataSource builder) to return data.
My problem is that due to business reasons, the backend data source sometimes can return nothing and then I get a NullReferenceException because of this:
The error when I run the report:
The error only occurs with datetime types, I think it's because the datetime is a construct type and not like an integer for example, that returns 0 when was not changed.
Thks.