No Report book TOC during export to pdf

1 Answer 73 Views
Report Book
faris
Top achievements
Rank 1
faris asked on 01 Sep 2021, 10:46 AM

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

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 06 Sep 2021, 06:00 AM

Hello Faris,

The problem is probably related to the PDF bookmarks are not generated in R2 2021(v15.1.21.512) bug. I would recommend upgrading to latest internal build 15.1.21.716. You may login to your Telerik account -> Downloads -> Progress Telerik Reporting -> Internal build tab -> download and install the MSI file.

Regards,
Neli
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tags
Report Book
Asked by
faris
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or