One-click export to PDF

  • Hey guys,

    I'm trying to add a link to a report that downloads the report itself to PDF. I'm using the following expression in the action for the text box:

    =iif(Fields!Policy_Status.Value = "In-Force","Globals!ReportServerUrl" & "?/ReportFolder/ReportName&rs:Command=Render&policyno=" & Fields!Policy_No.Value & "&rs:Format=PDF",nothing)

    This works if the user has been granted access to SSRS explicitly, but if the user is accessing the reports through a ReportViewer control in a web app they get an access denied error (which makes sense).

    Has anyone tried implementing a similar process for rendering a report to PDF?

    I'm using SSRS 2012.

    Chris

  • I have done this using the ReportViewer control by spinning up an alternate Windows Identity in the background that has access to the SSRS Web Services (report server directly) but never through a link in a rendered report. Basically I have a button on a Web Form that says "Get PDF". We render all the parameters on the page too, however, using the Web Services to get those so possibly a totally different implementation than you.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Yeah it sounds a little different.

    I'm starting to think we'll have to create a custom security extension to facilitate this. It just sounds quite complicated.

  • Any reason why they cannot just use the standard Export dropdown available in the ReportViewer to get the PDF version?

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • "The client experience"

    To be honest, we may have to stick with that option.

  • Not sure if this answers you.

    I had a similar request to create a URL on an existing report to download open/render a report directly in pdf. My report had a parameter of year which had to come from the parent report.

    Both the parent and sub report were deployed to the same folder

    I used this as an action on the text/texbox - go to URL and set this as the URL expressions:

    ="http://ohtwi1sql002/ReportServer_BGCO/Pages/ReportViewer.aspx?%2fDEV+AND+QA%2fDirector+Scorecard%2fBGCO+Summary+pdf_print&rs:Format=PDF&year=" + Parameters!year.Value

    • This reply was modified 5 years, 8 months ago by  ttdeveloper.
    • This reply was modified 4 years, 4 months ago by  Dave Convery.
    • This reply was modified 4 years, 4 months ago by  Dave Convery.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply