Hi,
I have connected up my business objects successfully to some reports constructed in the ReportViewer.
But when the ReportViewer renders the report- the date columns all come up as errors. It appears that the Reportviewer doesnt recognize them as dates ( ie mebbe because they are smartdates?)
Anyone else seen this behaviour and have ideas how to correct ?
Are you exposing your properties as type SmartDate?
That is not recommended, and is not the purpose of SmartDate. SmartDate should be used inside your object to expose a "date" property as a string.
That might be it.
In a class called ServiceRequestInfo, I have a date property defined as follows:
Public Property DateSubmitted() as SmartDate
Get
Return mDateSubmitted
End Get
Then I have another class called ServiceRequests which inherits this ServiceRequestInfo as ReadonlyListBase per your code examples.
The DataPortal_Fetch in the ServiceRequests Class has the dr.GetSmartDate(1)
I am assuming from your comments above that I should be exposing the above property as a string instead and then the DataPortal_Fetch as dr.Getstring(1)?
Its weird because the datagrid rendering of the data using ServiceRequests seem to be fine, but the reportviewer didnt seem to be.
Thank you for your response!
Not quite.
In Fetch you still retrieve SmartDate and populate mDateSubmitted which is of type SmartDate.
You change your Public Property to:
Public Overridable Property DateSubmitted() As String
That was it- now its working perfectly. Dates working properly in both grids and reportviewer reports.
Way cool!
Thanks Rocky and Joe!
Copyright (c) Marimer LLC