Dear All,
I've been trying to search for mechanisms to call exporting of telerik report viewer externally using button.
I came across the following code but do not have much clue about how to pass in the input "reportToExport"? What exactly is the Assembly Qualified Name of the report? and where can I find it? Much appreciated any help. Thanks
void ExportToPDF(string reportToExport)
{
var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
var typeReportSource = new Telerik.Reporting.TypeReportSource();
// reportToExport is the Assembly Qualified Name of the report
typeReportSource.TypeName = reportToExport;
var result = reportProcessor.RenderReport("PDF", typeReportSource, null);
this.Response.Clear();
this.Response.ContentType = result.MimeType;
this.Response.Cache.SetCacheability(HttpCacheability.Private);
this.Response.Expires = -1;
this.Response.Buffer = true;
/* Uncomment to handle the file as attachment
Response.AddHeader("Content-Disposition",
string.Format("{0};FileName=\"{1}\"",
"attachment",
fileName));
*/
this.Response.BinaryWrite(result.DocumentBytes);
this.Response.End();
}
I've been trying to search for mechanisms to call exporting of telerik report viewer externally using button.
I came across the following code but do not have much clue about how to pass in the input "reportToExport"? What exactly is the Assembly Qualified Name of the report? and where can I find it? Much appreciated any help. Thanks
void ExportToPDF(string reportToExport)
{
var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
var typeReportSource = new Telerik.Reporting.TypeReportSource();
// reportToExport is the Assembly Qualified Name of the report
typeReportSource.TypeName = reportToExport;
var result = reportProcessor.RenderReport("PDF", typeReportSource, null);
this.Response.Clear();
this.Response.ContentType = result.MimeType;
this.Response.Cache.SetCacheability(HttpCacheability.Private);
this.Response.Expires = -1;
this.Response.Buffer = true;
/* Uncomment to handle the file as attachment
Response.AddHeader("Content-Disposition",
string.Format("{0};FileName=\"{1}\"",
"attachment",
fileName));
*/
this.Response.BinaryWrite(result.DocumentBytes);
this.Response.End();
}