Hye,
I got problem with export report book to pdf.
here is my code
class TestPart : Report1
{
public TestPart()
{
this.DocumentMapText = "Sales By Region";
}
}Telerik.Reporting.ReportBook ourBook = new Telerik.Reporting.ReportBook();
var tocReportSource = new TypeReportSource();
tocReportSource.TypeName = typeof(ReportBookToc).AssemblyQualifiedName;
ourBook.TocReportSource = tocReportSource;
ourBook.ReportSources.Add(new TypeReportSource
{
TypeName = typeof(TestPart).AssemblyQualifiedName
});
Telerik.Reporting.Processing.ReportProcessor rProc = new Telerik.Reporting.Processing.ReportProcessor();
Telerik.Reporting.InstanceReportSource irs = new Telerik.Reporting.InstanceReportSource();
System.Collections.Hashtable dinfo = new System.Collections.Hashtable();
irs.ReportDocument = ourBook;
Telerik.Reporting.Processing.RenderingResult result = rProc.RenderReport("PDF", irs, dinfo);
string fileName = result.DocumentName + "." + result.Extension;
string path = System.IO.Path.GetTempPath();
string filePath = System.IO.Path.Combine(path, fileName);
using (System.IO.FileStream fs = new System.IO.FileStream(filePath, System.IO.FileMode.Create))
{
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
fs.Close();
}the problem is TOC is empty.
here is result