Elizabeth
Elizabeth

Reputation: 66

Telerik Reports

Am trying to access telerik reports from a c# class. Am using the Telerik.Reporting.Report() method but haven't succeeded. Please if you can help me find a way to access these reports from c# classes i'll appreciate. Thanks.

Upvotes: 0

Views: 370

Answers (1)

novice_dev
novice_dev

Reputation: 714

First, create an object of the report in your class.

Report1 rpt = new Report1();

Next, create a new object of the Telerik.Reporting.Processing.ReportProcessor.

ReportProcessor reportProcessor = new ReportProcessor()

In my case, I want to email my report as a PDF. Therefore I do the following.

RenderingResult result = reportProcessor.RenderReport("PDF", rpt, null);
email(result.DocumentBytes)

Upvotes: 1

Related Questions