Reputation: 825
I have created a web service that calls the reports I made using Telerik Reporting Tool. my web service is returning the URL of the Report Viewer that contains my reports. It is actually in PDF format, but as you can see in the picture the extension name is .aspx because that is basically the report viewer but what I want to do is to show the PDF without the Report viewer so that the extension name will be .pdf instead of .aspx, any suggestions on how I can implement that? thanks in advance :)
Upvotes: 1
Views: 3361
Reputation: 650
I don't have experience with Telerik Reporting Tools, but can you get the PDF files as byte[] array from the web service instead of the url? Then you could write the binary data into your response stream.
public void GetReport()
{
byte[] pdfBytes = yourWebService.GetReportBytes();
Response.OutputStream.Write(pdfBytes, 0, pdfBytes.Length);
Response.ContentType = "application/pdf";
Response.End();
}
Would this be a possible solution for you? Should work in both ASP.NET WebForms and MVC. Replace the yourWebService.GetReportBytes() part with whatever calls you have to make to Telerik Reporting side to get your report bytes.
Upvotes: 2