I have a report book which I create through C# code. I want to have a single TOC covering all the reports in the report book.
Following this (https://docs.telerik.com/reporting/designing-reports-reportbook-toc) I started creating a TOC but this article (https://docs.telerik.com/reporting/table-of-contents-report-book) says to add TocReportSource of ReportBook programmatically. But the problem is it doesn't have any example of how to do that. Can you add a sample code of how to achieve this..
//Report Book
var reportBook =
new
ReportBook();
//Cover Page
var coverPageReportSource =
new
InstanceReportSource();
var coverPagereport =
new
CoverPage(reportId)
{
DocumentName =
"Cover Page Report"
};
coverPageReportSource.ReportDocument = coverPagereport;
reportBook.ReportSources.Add(coverPageReportSource);
//TOC Page
var tocPageReportSource =
new
InstanceReportSource();
var tocPagereport =
new
FirstPage()
{
DocumentName =
"toc Page Report"
};
tocPageReportSource.ReportDocument = tocPagereport;
reportBook.ReportSources.Add(tocPageReportSource);
//Image Report
var imagesReportSource =
new
InstanceReportSource();
var imagesDatareport =
new
ImageReport()
{
DocumentName =
"Image Report"
};
imagesReportSource.ReportDocument = imagesDatareport;
reportBook.ReportSources.Add(imagesReportSource);
var instanceReportBookSource =
new
InstanceReportSource
{
ReportDocument = reportBook
};
var reportProcessor =
new
ReportProcessor();
var renderingResult = reportProcessor.RenderReport(
"PDF"
, instanceReportBookSource,
new
Hashtable());