Good Evening All,
Hope you are keeping well in the current climate.
I have a form with a report viewer on that am i am trying to set the report that viewer will display at runtime. I have the following code to do this.
Dim
ReportViewer
As
New
FrmReportViewer
Dim
NotificationReport
As
New
rptNotificationPrintOut
Dim
strCommand
As
String
=
"SELECT tblNotifications.URN, tblNotifications.Sender, tblNotifications.Reciever, tblNotifications.Date_Sent, "
&
"tblNotifications.Time_Sent, tblNotifications.Title, tblNotifications.Details, tblNotifications.Notification_Type, tblusernotifications.status "
&
"FROM tblNotifications INNER JOIN tblUserNotifications On tblNotifications.URN = tblUserNotifications.Notification_ID WHERE "
&
"tblUserNotifications.User_ID = '"
& strUserID &
"'"
Dim
sqlReportDataSource
As
New
SqlDataSource(strCommand, strConnectionString)
NotificationReport.DataSource = sqlReportDataSource
Dim
DisplayReport
As
New
InstanceReportSource
DisplayReport.ReportDocument = NotificationReport
ReportViewer.ReportViewer1.ReportSource = DisplayReport
ReportViewer.Show()
This code is displaying the report viewer form however it is not loading and displaying the report.
Thanks in advanced for the assistance
Frosty