We inherited old Telerik 2011 code and our Telerik reports are failing with Telerik 2014 Q1. We have good reports generated from the earlier version. The SurveyID does have a valid integer but the Datasource is failing. The following has Bolded text being the failing code:
' Instantialte the report object and assign data sources to report and subreports
Dim Report1 As New Reporting.MstrRpt_LESD_Preview()
Dim SurveyID As New Int32
SurveyID = CInt(Session("LESD_SurveyID"))
Report1.DataSource = LESD.ConfigurePreviewReport(SurveyID)
CType(Report1.Items("detail").Items("SubReport1"), Telerik.Reporting.SubReport).Report.DataSource = LESD.ConfigurePreviewSubReportBase(SurveyID)
CType(Report1.Items("detail").Items("SubReport1"), Telerik.Reporting.SubReport).Parameters.Add("LESD_STE_CHECKED", chkIncludeSteInfo.Checked)
CType(Report1.Items("detail").Items("SubReport1"), Telerik.Reporting.SubReport).Parameters.Add("LESD_STE_NAME", rtbSteName.Text.Trim)
CType(Report1.Items("detail").Items("SubReport1"), Telerik.Reporting.SubReport).Parameters.Add("LESD_STE_PHONE", rtbStePhone.Text.Trim)
CType(Report1.Items("detail").Items("SubReport1"), Telerik.Reporting.SubReport).Parameters.Add("LESD_STE_EMAIL", rtbSteEmail.Text.Trim)
CType(Report1.Items("detail").Items("SubReport1"), Telerik.Reporting.SubReport).Parameters.Add("LESD_STE_COMPCODE", rtbSteCompCode.Text.Trim)
CType(Report1.Items("detail").Items("SubReport2"), Telerik.Reporting.SubReport).Report.DataSource = LESD.ConfigurePreviewSubReportNonBase(SurveyID)
Reporting_Utilities.ReportToPDF(HttpContext.Current, Report1)
End Sub
The excepton says:
System.NullReferenceException was unhandled by user code.
Additional information: Object reference not set to an instance of an object.
The SurveyID is an integer. It should select a report based on which integer was selected.
Any ideas as to why it is failing?
' Instantialte the report object and assign data sources to report and subreports
Dim Report1 As New Reporting.MstrRpt_LESD_Preview()
Dim SurveyID As New Int32
SurveyID = CInt(Session("LESD_SurveyID"))
Report1.DataSource = LESD.ConfigurePreviewReport(SurveyID)
CType(Report1.Items("detail").Items("SubReport1"), Telerik.Reporting.SubReport).Report.DataSource = LESD.ConfigurePreviewSubReportBase(SurveyID)
CType(Report1.Items("detail").Items("SubReport1"), Telerik.Reporting.SubReport).Parameters.Add("LESD_STE_CHECKED", chkIncludeSteInfo.Checked)
CType(Report1.Items("detail").Items("SubReport1"), Telerik.Reporting.SubReport).Parameters.Add("LESD_STE_NAME", rtbSteName.Text.Trim)
CType(Report1.Items("detail").Items("SubReport1"), Telerik.Reporting.SubReport).Parameters.Add("LESD_STE_PHONE", rtbStePhone.Text.Trim)
CType(Report1.Items("detail").Items("SubReport1"), Telerik.Reporting.SubReport).Parameters.Add("LESD_STE_EMAIL", rtbSteEmail.Text.Trim)
CType(Report1.Items("detail").Items("SubReport1"), Telerik.Reporting.SubReport).Parameters.Add("LESD_STE_COMPCODE", rtbSteCompCode.Text.Trim)
CType(Report1.Items("detail").Items("SubReport2"), Telerik.Reporting.SubReport).Report.DataSource = LESD.ConfigurePreviewSubReportNonBase(SurveyID)
Reporting_Utilities.ReportToPDF(HttpContext.Current, Report1)
End Sub
The excepton says:
System.NullReferenceException was unhandled by user code.
Additional information: Object reference not set to an instance of an object.
The SurveyID is an integer. It should select a report based on which integer was selected.
Any ideas as to why it is failing?