I have a single report viewer that I use to show multiple reports. In each of the reports I have a text box called FooterTextBox which places text with the footer of the report at run time. I get errors in the Error List: 'FooterTextBox' is not a member of 'Telerik.Reporting.Report' of the VS 2010 IDE.
If I ignore the errors during build time the program runs fine and can change the footer text with no issues. However when I am building additional reports the build fails (in the preview) unless I comment out these lines ?
If Me.FooterTextbox.Text <> "" Then
myReport.FooterTextBox.Value = Me.FooterTextbox.Text
Else
myReport.FooterTextBox.Value = "Printed copies are uncontrolled documents."
End If
Report code:
Dim myReport As Telerik.Reporting.Report = Nothing
Select Case ReportDDL.SelectedItem.Value
Case "OSHAItembyPersonnelReport"
myReport = New OSHAItembyEmployeeReport
Exit Select
Case "OSHAItems"
myReport = New OSHAItems
Exit Select
Case "OSHAItemDue"
myReport = New OSHAItemDue
Exit Select
End Select
Me.ReportViewer1.Report = myReport
If Me.FooterTextbox.Text <> "" Then
myReport.FooterTextBox.Value = Me.FooterTextbox.Text
Else
myReport.FooterTextBox.Value = "Printed copies are uncontrolled documents."
End If
Me.ReportViewer1.RefreshReport()
Me.ReportViewer1.Report = myReport
If I ignore the errors during build time the program runs fine and can change the footer text with no issues. However when I am building additional reports the build fails (in the preview) unless I comment out these lines ?
If Me.FooterTextbox.Text <> "" Then
myReport.FooterTextBox.Value = Me.FooterTextbox.Text
Else
myReport.FooterTextBox.Value = "Printed copies are uncontrolled documents."
End If
Report code:
Dim myReport As Telerik.Reporting.Report = Nothing
Select Case ReportDDL.SelectedItem.Value
Case "OSHAItembyPersonnelReport"
myReport = New OSHAItembyEmployeeReport
Exit Select
Case "OSHAItems"
myReport = New OSHAItems
Exit Select
Case "OSHAItemDue"
myReport = New OSHAItemDue
Exit Select
End Select
Me.ReportViewer1.Report = myReport
If Me.FooterTextbox.Text <> "" Then
myReport.FooterTextBox.Value = Me.FooterTextbox.Text
Else
myReport.FooterTextBox.Value = "Printed copies are uncontrolled documents."
End If
Me.ReportViewer1.RefreshReport()
Me.ReportViewer1.Report = myReport