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.
- When a report is rendered in full-page view in SharePoint, the URL is displayed in the following format: https://<SharePoint_site>/_layouts/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/<SharePoint_Document_Library>/<Report_Name>.rdl.
- In SSRS 2008, you specify a report parameter name and value pair by explicitly specifying the prefix "rp:". Here is an example to add-on a parameter with name "Month" that accepts a string value: https://<SharePoint_site>/_layouts/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/<SharePoint_Document_Library>/<Report_Name>.rdl &rp:Month=January
- You can also specify a fixed set of ReportViewer parameters to alter full-page rendering experience. These ReportViewer parameters need to be explicitly prefixed by "rv: ". Here is an example of rendering the report with the parameters area collapsed: https://<SharePoint_site>/_layouts/ReportServer/RSViewerPage.aspx?rv:RelativeReportUrl=/<SharePoint_Document_Library>/<Report_Name>.rdl &rv:ParamMode=Collapsed&rp:Month=January
Examples: Here are examples using the Adventureworks sample reports assumed to be stored in SharePoint document library: https://<SharePoint_site>/Reports/ReportsLibrary
· Render the AdventureWorks "Employee Sales Summary" report for 'Syed Abbas' for 'January' / '2004' with ReportViewer Toolbar showing pagination only: https://<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: https://<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
Anonymous
June 30, 2009
How can you pass parameter values in the query string for hidden parameters? Is that possible?Anonymous
January 28, 2010
Where is the rp: prefix documented? I can't find it in the SQL 2008 documentation. Thanks.Anonymous
May 31, 2010
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 suggestionAnonymous
May 31, 2010
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 suggestionAnonymous
August 30, 2010
The comment has been removedAnonymous
September 01, 2010
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.Anonymous
February 22, 2011
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?Anonymous
April 06, 2011
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.comAnonymous
April 15, 2011
Is there a way to do this when SSRS 2008 R2 is in Native Mode?Anonymous
May 10, 2011
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?Anonymous
June 27, 2011
Thanks for writing such a useful informationAnonymous
July 14, 2011
@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 ChotaliaAnonymous
May 02, 2012
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” ThanksAnonymous
May 08, 2012
Thanx a lot Prash. This really saved me.Anonymous
July 03, 2012
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?Anonymous
May 14, 2013
It is very good and it helped me in my reportsAnonymous
November 19, 2014
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?