Passing URL report parameters to Reports in SharePoint Document Library in SSRS 2008 & R2


Passing URL report parameters directly to a report in a SharePoint Document Library is enabled in the SQL Server Reporting Services 2008 Integration with SharePoint Add-in.

Why? Key intent is to allow specifying non-default report parameter values when rendering of a report in full-page view in SharePoint.  

How do you use this feature? Simply add-on the URL report parameters onto the URL displayed in SharePoint when viewing a report in full page view. 

Examples: Here are examples using the Adventureworks sample reports assumed to be stored in SharePoint document library: http://<SharePoint_site>/Reports/ReportsLibrary

·         Render the AdventureWorks “Employee Sales Summary” report for ‘Syed Abbas’ for ‘January’ / ‘2004’ with ReportViewer Toolbar showing pagination only: http://<SharePoint_site>/Reports/_layouts/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/Reports/ReportsLibrary/Employee%20Sales%20Summary.rdl&rv:ToolBar=Navigation&rp:EmpID=288&rp:ReportMonth=1&rp:ReportYear=2004

·         Render the AdventureWorks ‘Product Catalog’ report with the Document Map Area collapsed and no Header Area: http://<SharePoint_site>/Reports/_layouts/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/Reports/ReportsLibrary/Product%20Catalog.rdl&rv:HeaderArea=None&rv:DocMapMode=Collapsed

ReportViewer parameters for controlling full-page report rendering

ReportViewer Parameter

Description

Values

rv:HeaderArea

Control how the ReportViewer web part’s header is displayed in full-page view.

Full, None.

Default: Full

rv:ToolBar

Control how the ReportViewer web part’s toolbar is displayed in full-page view.

Full, Navigation, None.

Default: Full

rv:ParamMode

Control how the ReportViewer web part’s header is displayed in full-page view.

Full, Collapsed, Hidden.

Default: Full

rv:AsyncRender

Control whether the report is rendered asynchronously or synchronously.

true, false.
Default: true

rv:DocMapAreaWidth

Control the display width in pixels of the ReportViewer web part’s Document Map area.

Non-negative integer

rv:DocMapMode

Control the display of the Document Map area of a report.

Displayed, Collapsed, Hidden.
Default: Dislayed

SQL Server Reporting Services 2008 R2

In the Report Viewer that ships with the SSRS 2008 R2 Add-in for SharePoint the following new Report Viewer parameters are added:

 

ReportViewer Parameter

Description

Values

rv:DockToolBar

Controls whether the ReportViewer web part’s toolbar is docked to the top or bottom.

Top, Bottom.

Default: Top

rv:ToolBarItemsDisplayMode

Controls turning of or on specific parts of the ReportViewer web part’s toolbar. This is an enumeration field  eg. For no Actions menu rv:ToolBarItemsDisplayMode= 63 (or 0x3F); For all of Actions menu only rv:ToolBarItemsDisplayMode= 960 (or 0x3C0)

Back= 1, (0x1)

Find= 2, (0x2)

Page Navigation=4, (0x4)

Refresh= 8, (0x8)

Zoom= 16, (0x10)

AtomFeed= 32, (0x20)

Actions Menu Print= 64, (0x40)

Actions Menu Export= 128, (0x80)

Actions Menu ReportBuilder= 256,(0x100)

Actions Menu Subscribe = 512, (0x200)

Default: -1

 


Comments (17)

  1. bhav27 says:

    How can you pass parameter values in the query string for hidden parameters? Is that possible?

  2. steve.hickle@druryhotels.com says:

    Where is the rp: prefix documented?  I can’t find it in the SQL 2008 documentation.  Thanks.

  3. test says:

    vm219:45488/_layouts/ReportServer/RSViewerPage.aspx?rv%3aRelativeReportUrl=%2fReports%2fStudyDetails.rdl&rv:ParamMode=Collapsed&rp:ID= Fields!ID.Value

    i am trying this but not working

    Fields!ID.Value   not working

    &rp:ID=1  this works

    any suggestion

  4. test says:

    vm219:45488/_layouts/ReportServer/RSViewerPage.aspx?rv%3aRelativeReportUrl=%2fReports%2fStudyDetails.rdl&rv:ParamMode=Collapsed&rp:ID= Fields!ID.Value

    i am trying this but not working

    Fields!ID.Value   not working

    &rp:ID=1  this works

    any suggestion

  5. Ojas says:

    @test – You cant supply parameter value as Fields!ID.Value. Imagine what would be the value of Fields!ID.Value when the URL is just hit (no db connection no query yet fired)

  6. Anzor says:

    I have SP2010 and SSRS in integrated mode. I can not find syntax to export report to word via URL. In non integrated environment I can use &rc:Format=WORD but it is not working in integrated environment.

  7. TheQuestioner says:

    Hi, is it possible to hide/unhide every single toolbar button?

    i need to show only few Export, like shown in this screen capture (dl.dropbox.com/…/Export-RP.png).

    Do you have any suggestions?

  8. Paul says:

    I think there is a bug if use "&rv:ParamMode=Collapsed", the RSViewerPage.aspx will collapse the parameter area, but when click to show  parameter area, just can see "Apply" button, cannot see the parameters select dropdownlists.

    If somebody of MS can read this post, please kindly contact with me, many thanks.

    paul9194637@gmail.com

  9. Mark says:

    Is there a way to do this when SSRS 2008 R2 is in Native Mode?

  10. Sorgfelt says:

    I wrote a report using a CAML query of a SharePoint list as the dataset, and would like to apply the filter parameters to it.  How can this be done?

  11. Rizwan says:

    Thanks for writing such a useful information

  12. Ashish Chotalia says:

    @TheQuestioner

    Just locate your "rsreportserver.config" from below path.

    C:Program FilesMicrosoft SQL Server"customName"Reporting ServicesReportServer

    once you find that file just go to <Render> and put visible="false". what ever option you want to hide from action menu.

    Thanks,

    Ashish Chotalia

  13. john says:

    Does any one know where i am making mistake to pass field value to url report parameter

    sharepoint.pce.uw.edu/…/RSViewerPage.aspx”Fields!ID.Value”

    Thanks

  14. Songezo says:

    Thanx a lot Prash. This really saved me.

  15. Is it possible to parse through a parameter and also export using a url? I want to have a hyperlink on my report to export it. I can create links and parse parameters by using 'rp:' and I can also export using the '&rs:Format=excel' close. However, together they don't work. I oinly export the file with the default parameters set.

    Is there a way I can solve this?

  16. Zaheer says:

    It is very good and it helped me in my reports

  17. Praveen says:

    I am using Report viewer control with SharePoint 2013 and Sql Server 2014 environment. We don't have Report server configured. We have enabled the Reporting service comes OOB with SharePoint 2013. How to use that service with Report Viewer control? What to mention in the ReportServerUrl?