render report directly to PDF (or any other format)

  • I have a report that i want to render directly to PDF (rather than exporting to PDF from the report viewer).

    I have code that works, but so far I've only been able to get it to work from within the report using a Go to URL action. the steps i have to take is to render the report, and then execute the textbox action, which then renders the report in PDF format. (Keep in mind this was only my test method and not the final solution - i just wanted to make sure the code works.) The code i used is:

    =Globals!ReportServerUrl & "/Pages/ReportViewer.aspx?" & Globals!ReportFolder & "/ReportName&rs:Command=Render&rs:Format=PDF&rc:Parameters=False&Parameter1=" & Fields!Parameter1.Value & "&Parameter2=" & Parameters!Parameter2.Value

    i have 2 issues that i need to resolve:

    1. where do i place this code (i'm presuming in a custom code location) so i can render the entire report directly to PDF?

    2. this report will be called to by a front end asp.net (v 4.5) application. i thought by giving the web developer the above code he would be able to make it work, but he can't. this 2nd issue might be out of the scope of this question, but if you see anything in the code that you know needs to be revised please let me know.

    thanks so much!!

    Dana

    "Drats! Foiled again!"
  • if you have a developer that will be calling the report, then you may be able to use something like this:

    void(window.open('http://FQDN_OF_REPORTSERVER/REPORTPATH_AND_REPORTNAME&PARAMETER1NAME=PARAMETER1VALUE&Command=Render&rs:Format=PDF&rc:Parameters=false&rc:Toolbar=false',%20'WINDOWNAME','width=1025,height=600,location=no,toolbar=no,resizable=1,scrollbars=yes'))

    You can probably take the parameter stuff out, I thought I'd include it as a reference in case you need parameters later. I'm running into this same problem, except I don't have a programmer that can call a URL. So if anyone else has an idea on how to do it, I'm also wondering if this can be done straight from the reportserver/reportmanager.

  • Argh. that should have a

    in front of the void(window...

    apparently I failed cut and paste 101.

  • OK it wasn't me. Let me try this again...

    it should have a

    in front of the void(window...

  • Damnit!

    j a v a s c r i p t :

    (minus all the spaces)

  • Steven.Howes (11/15/2013)


    Damnit!

    j a v a s c r i p t :

    (minus all the spaces)

    thanks for the laugh first thing in the morning!! 😀

    i've used "void window.open" for a report in a pop up window, but i didn't try it with this. all the code i found for rendering to a different format didn't have it. i'll give it a try. thanks!

    Dana

    "Drats! Foiled again!"
  • hahaha...it did it to me too!! "javascript" didn't show up!

    Dana

    "Drats! Foiled again!"
  • I almost replied to say you needed to add that word that shall not be spoken... It's starting to feel like a "Knights that say NEE!" moment.

Viewing 8 posts - 1 through 7 (of 7 total)

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