Hi,
I'm trying to create a report, with an ObjectDataSource that has a couple Nullable<Datetime> fields. I'm attempting to use these in a textbox.
Here's an example of the sort of expression I'm using:
This report covers the period from {IIf(Fields.ReportConfiguration.StartDate is null, "the beginning of time", Fields.ReportConfiguration.StartDate.Date.ToString("D"))} to {IIf(Fields.ReportConfiguration.EndDate is null, "the end of time", Fields.ReportConfiguration.EndDate.Date.ToString("D"))}.
Both StartDate and EndDate are of type Nullable<DateTime>. If they have both have a value then it works correctly, but if either of them are null then I get an "Object reference not set to an instance of an object" error. Should this work, and if not, how do I do it?
I'm using 2013 Q2 SP1.
Thanks,
Richard
I'm trying to create a report, with an ObjectDataSource that has a couple Nullable<Datetime> fields. I'm attempting to use these in a textbox.
Here's an example of the sort of expression I'm using:
This report covers the period from {IIf(Fields.ReportConfiguration.StartDate is null, "the beginning of time", Fields.ReportConfiguration.StartDate.Date.ToString("D"))} to {IIf(Fields.ReportConfiguration.EndDate is null, "the end of time", Fields.ReportConfiguration.EndDate.Date.ToString("D"))}.
Both StartDate and EndDate are of type Nullable<DateTime>. If they have both have a value then it works correctly, but if either of them are null then I get an "Object reference not set to an instance of an object" error. Should this work, and if not, how do I do it?
I'm using 2013 Q2 SP1.
Thanks,
Richard