New to Telerik ReportingStart a free 30-day trial

Warning After Adding Reports to ReportBook in Visual Studio

Environment

ProductProgress® Telerik® Reporting
VersionsR1 2017 and later
Report ItemReport Book

Description

As of the R1 2017 release, adding reports to the ReportBook.Reports collection is obsoleteAPI Breaking Changes.

To allow integration with Standalone Designer, ReportBook was updated to use ReportSource objects for adding the reports.

An updated approach includes adding the necessary ReportSources to the ReportBook.ReportSources collection.

Solution

Solution for adding reports to a ReportBook before the R1 2017 release.

C#
Telerik.Reporting.ReportBook reportBook = new ReportBook();
Telerik.Reporting.Report report = new Report1();
reportBook.Reports.Add(report);

Solution for adding reports to a ReportBook after the R1 2017 release.

C#
Telerik.Reporting.ReportBook reportBook = new ReportBook();
Telerik.Reporting.TypeReportSource typeReportSource = new TypeReportSource();
typeReportSource.TypeName = typeof(Report1).AssemblyQualifiedName;
reportBook.ReportSources.Add(typeReportSource);

See Also