# How to Create a Report Book at Runtime

You can programmatically create a report book at runtime by using the Telerik Reporting API.

The following steps are required to create a report book at runtime:

1. Create an instance of the ReportBook class
2. Add the necessary ReportSources to its `ReportSources` collection.

Alternatively, you can derive from the ReportBook class and initialize the book in the constructor if you want to separate the report book implementation details from the rest of your code.

> note The [ReportBook](https://www.telerik.com/products/reporting/documentation/api/telerik.reporting.reportbook) is an [IReportDocument](https://www.telerik.com/products/reporting/documentation/api/telerik.reporting.ireportdocument). The latter exposes [ReportParameters property](https://www.telerik.com/products/reporting/documentation/api/telerik.reporting.ireportdocument#Telerik_Reporting_IReportDocument_ReportParameters) that is *obsolete* and the ReportBook doesn't implement it. Thus, the ReportBook doesn't have a collection of parameters.
>
> The [ReportSource](https://www.telerik.com/products/reporting/documentation/embedding-reports/report-sources#available-report-sources) with a ReportBook as report document exposes [ParameterCollection](https://www.telerik.com/products/reporting/documentation/api/telerik.reporting.parametercollection). The values from the collection will be distributed among the reports in the ReportBook as explained in the article [Report Book Parameters](https://www.telerik.com/products/reporting/documentation/designing-reports/report-book/report-book-parameters).

In the sample below we add two reports and a Table of Contents (TOC):

1. First is the 'WeekdayReport', which is a CS/VB class inheriting from Telerik.Reporting.Report. It is added as a `TypeReportSource` - check [Available ReportSources](https://www.telerik.com/products/reporting/documentation/embedding-reports/report-sources).
2. Second is the 'Glossary.trdp' report created with the Standalone Designer. It is added wrapped in a `UriReportSource`. You need to specify the relative or full path to the TRDP file:
3. (optional) Finally, we add the 'TocReport.trdp', which contains only a TOC section, as a [TocReportSource](https://www.telerik.com/products/reporting/documentation/api/telerik.reporting.reportbook#Telerik_Reporting_ReportBook_TocReportSource) of the ReportBook.

```C#
var reportBook = new ReportBook();

var weekdayReportSource = new TypeReportSource();
weekdayReportSource.TypeName = typeof(WeekdayReport).AssemblyQualifiedName;
reportBook.ReportSources.Add(weekdayReportSource);

var glossaryReportSource = new UriReportSource();
glossaryReportSource.Uri = "Reports\\Glossary.trdp";
reportBook.ReportSources.Add(glossaryReportSource);

//Optionally, add TOC, which is a new report that contains only TOC section
var tocReportSource = new UriReportSource();
tocReportSource.Uri = "Reports\\TocReport.trdp";
reportBook.TocReportSource = tocReportSource;
```

```VB.NET
Dim reportBook = New ReportBook()
Dim weekdayReportSource = New TypeReportSource()
weekdayReportSource.TypeName = GetType(WeekendReport).AssemblyQualifiedName
reportBook.ReportSources.Add(weekdayReportSource)

Dim glossaryReportSource = New UriReportSource()
glossaryReportSource.Uri = "Reports\Glossary.trdp"
reportBook.ReportSources.Add(glossaryReportSource)

      'Optionally, add TOC, which is a new report that contains only TOC section
      Dim tocReportSource = New UriReportSource()
      tocReportSource.Uri = "Reports\TocReport.trdp"
      reportBook.TocReportSource = tocReportSource
```
