I'm using: Report Designer Q3 2014 and I can not get run a report that I need to export a report directly to PDF, without the need to go through the web viewer. I'm in a WEB .NET (C#) application and all the examples does not run for one reason or other!!.
I need to pass three parameters to the report and I can not find a usefull example. I already see the article: "Exporting a report to PDF programmatically" but still not function.
For example I've used this code:
Telerik.Reporting.Processing.ReportProcessor reportProcessor =
new Telerik.Reporting.Processing.ReportProcessor();
// set any deviceInfo settings if necessary
System.Collections.Hashtable deviceInfo =
new System.Collections.Hashtable();
Telerik.Reporting.TypeReportSource typeReportSource =
new Telerik.Reporting.TypeReportSource();
// reportName is the Assembly Qualified Name of the report
typeReportSource.TypeName = reportName;
Telerik.Reporting.Processing.RenderingResult result =
reportProcessor.RenderReport("PDF", typeReportSource, deviceInfo);
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);
}
And in this case shows the next error:
Line 88: Telerik.Reporting.Processing.RenderingResult result = Line 89: reportProcessor.RenderReport("PDF", typeReportSource, deviceInfo);
Looks like is NULL de "deviceInfo"....
Please help!...any help would be appreciated
David