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)
-
0
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.
-
0
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(); }
-
0
Hi @nitinrpatel
You can simply return a File result, like we do here https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Core/Controllers/FileController.cs#L34