locked
programatically show pdf in web form from SQL Reporting Services?? RRS feed

  • Question

  • User-442518976 posted

    I can't use the SQL Reporting Services ReportViewer control for security reasons

    I'm using the SQL Reporting Services web service to get reports

    When the format of the report is HTML I insert the report in the middle of the page doing this

            result = rs.Render("/PublicList/ProductReceipt", "HTML4.0", null, null, parametersUsed, null, null, out encoding, out mimetype, out parametersUsed, out warnings, out streamids);
            string txt = System.Text.Encoding.GetEncoding("utf-8").GetString(result);
            Literal1.Text = txt;
    

    the important parts are the GetEncoding to convert the Byte[] of the html since a Byte[] is what is returned from SSRS

    but I'm at a loss for how to do something similar if the format of the report is PDF

    if the Byte[] contains a PDF how do I show it? I'm able to show the PDF using 

    Response.BinaryWrite(result); after setting the Response.ContentType to pdf but that displays the PDF as the ENTIRE page

    I have a Master page and the content page has other text and navigation buttons, etc I need to show the pdf in the middle of the page

    This is an ASP.NET 3.5 application

    any ideas?

    thanks

    mike

     

    Thursday, March 10, 2011 5:19 PM

Answers

  • User-1713050958 posted

    You can use embed tag to define area in which you need to put PDF on the page:

    <embed src="test.pdf" width="600" height="300">

     

     

    Hope this answer your question


    Please mark as answer if this solve your problem

    DevTechie.com

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 10, 2011 9:37 PM

All replies

  • User-1713050958 posted

    You can use embed tag to define area in which you need to put PDF on the page:

    <embed src="test.pdf" width="600" height="300">

     

     

    Hope this answer your question


    Please mark as answer if this solve your problem

    DevTechie.com

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 10, 2011 9:37 PM
  • User-525407762 posted

    Hi Mike, did "<embed src="test.pdf" width="600" height="300">" work for you to show pdf file in fixed area. We also want to acheive the same functionality if it works for you then we may try it too.

    Monday, March 14, 2011 2:08 AM