Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Telerik Report Viewer #8777


User avatar
0
nitinrpatel created

Hello, I Am Using ASP.NET MVC 5.x with AngularJS Verson. can any one guide me for telerik report viewer and download report code? currently i am able to save that report to specific path but i want to show in telerik viewer and also download that.


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @nitinrpatel

    Unfortunately we don't have experience with Telerik Report. Did you try anything to implement this ? If you faced a similar problem, we can try to help.

  • User Avatar
    0
    nitinrpatel created

    Hello, Can you guide me for download file code in service file. i am using thi code block for downliading file but getting error on "Response".

    		public void ExportPdf(Telerik.Reporting.Report report)
    		{
    			Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
    			Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
    			instanceReportSource.ReportDocument = report;
    
    			Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, null);
    
    			string fileName = result.DocumentName + "." + result.Extension;
    			string path = System.IO.Path.GetTempPath();
    			string filePath = System.IO.Path.Combine(path, fileName);
    
    			Response.Clear();
    			Response.ContentType = result.MimeType;
    			Response.Cache.SetCacheability(HttpCacheability.Private);
    			Response.Expires = -1;
    			Response.Buffer = true;
    
    			Response.AddHeader("Content-Disposition",
    								string.Format("{0};FileName=\"{1}\"",
    											  "attachment",
    											  fileName));
    
    			Response.BinaryWrite(result.DocumentBytes);
    			Response.End();
    		}
    
  • User Avatar
    0
    ismcagdas created
    Support Team