0

I am running SSRS 2008 in SP2010. I want to set some report parameters through JavaScript. Is it possible if yes then how. Basically I read some values from the page itself and then set the report parameter.I am using default report viewer web part to view the reports.

  • @jameslove is the guy to answer this – Hugh Wood May 24 '13 at 9:21
  • Are you viewing the Reports via the Report Viewer Web Part? Or some other way? – James Love May 24 '13 at 9:22
  • Please see the edit.I am using report viewer web part. – V.B May 24 '13 at 9:25
1

Doing this via the Report Viewer Web Part might be quite tricky - as the way this web part sets the Report Parameter values is all done server-side. The closest you'd get to client side interactiveness is with Filter Web Parts.

However, you might be able to have something slightly more client side by loading the Report via an IFRAME.

Basically, you need to set the address of the IFRAME dynamically in your javascript, by pointing to

http:///_layouts/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/DocLibrary/ReportName.rdl&rp:YourFirstParam=Value&rp:YourSecondParam=Value

Note the rp: parameters, those are the ones you want to build up in your JavaScript to build the URL for the IFRAME. Note the syntax too, you'll need rp:= for each one.

  • I think if I am running my report on a Web Part page can I still use rp: to pass my parameter? I doubt this? – V.B May 24 '13 at 9:44
  • Nope, you'll basically render the IFRAME dynamically using JavaScript instead of the Report Viewer Web Part. The JavaScript suggestion replaces that web part. – James Love May 24 '13 at 9:47
  • Well this is my limitation. I can not do that.I need to do it on a web part page which already shows another page within a IFrame which is my target page. – V.B May 24 '13 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.