This code worked with Telerik 2011 but fails to work with Telerik 2014. It generates: "An exception of type 'System.NullReferenceException' occurred in Reporting.dll but was not handled in user code".
" Public Shared Sub ConfigureCslReport(ByRef Report1 As Telerik.Reporting.Report)
' Change the design-time connection string to the run-time connection string
CType(CType(Report1.Items("ReportFooterSection1").Items("SubReport1"), Telerik.Reporting.SubReport).Report.DataSource, Telerik.Reporting.SqlDataSource).ConnectionString = Reporter_Common.GetConnectionString("SHPR")
CType(CType(Report1.Items("ReportFooterSection1").Items("SubReport2"), Telerik.Reporting.SubReport).Report.DataSource, Telerik.Reporting.SqlDataSource).ConnectionString = Reporter_Common.GetConnectionString("SHPR")
CType(CType(Report1.Items("ReportFooterSection1").Items("SubReport3"), Telerik.Reporting.SubReport).Report.DataSource, Telerik.Reporting.SqlDataSource).ConnectionString = Reporter_Common.GetConnectionString("SHPR")
CType(CType(Report1.Items("ReportFooterSection1").Items("SubReport4"), Telerik.Reporting.SubReport).Report.DataSource, Telerik.Reporting.SqlDataSource).ConnectionString = Reporter_Common.GetConnectionString("SHPR")
End Sub"
Since 90% of the report works, why do these 4 SubReports in the Footer section fail? The "Reporter_Common.GetConnectionString("SHPR")" just returns the SQL connection to the database and is used without errors in the rest of the report.
Any ideas?
" Public Shared Sub ConfigureCslReport(ByRef Report1 As Telerik.Reporting.Report)
' Change the design-time connection string to the run-time connection string
CType(CType(Report1.Items("ReportFooterSection1").Items("SubReport1"), Telerik.Reporting.SubReport).Report.DataSource, Telerik.Reporting.SqlDataSource).ConnectionString = Reporter_Common.GetConnectionString("SHPR")
CType(CType(Report1.Items("ReportFooterSection1").Items("SubReport2"), Telerik.Reporting.SubReport).Report.DataSource, Telerik.Reporting.SqlDataSource).ConnectionString = Reporter_Common.GetConnectionString("SHPR")
CType(CType(Report1.Items("ReportFooterSection1").Items("SubReport3"), Telerik.Reporting.SubReport).Report.DataSource, Telerik.Reporting.SqlDataSource).ConnectionString = Reporter_Common.GetConnectionString("SHPR")
CType(CType(Report1.Items("ReportFooterSection1").Items("SubReport4"), Telerik.Reporting.SubReport).Report.DataSource, Telerik.Reporting.SqlDataSource).ConnectionString = Reporter_Common.GetConnectionString("SHPR")
End Sub"
Since 90% of the report works, why do these 4 SubReports in the Footer section fail? The "Reporter_Common.GetConnectionString("SHPR")" just returns the SQL connection to the database and is used without errors in the rest of the report.
Any ideas?