Parameterised SQL Reports in SharePoint

So, I’ve developed a parameterised report and surfaced it inside a SharePoint site using the Report Viewer Web Part.

Now the user has this ‘nice’ pane on the side of the report to supply the parameter value….

report_viewer_parameter_pane

How do I provide parameter values without requiring user intervention? Just follow these easy steps.

Put the page hosting my web part into edit mode:

edit_page

Next click on the edit button for the Report Viewer Web Part, we see the connect to option, but it’s disabled. :o(

edit_menu_no_connection

A connectable web part to provide the parameter(s) is needed…

Click on one of the Add a Web Part headers.

add_a_web_part

Luckily OOTB there are a bunch of Filter Web Parts which we can use for just this purpose! I chose to use the Query String (URL) Filter. 

add_web_parts_screen

Now open the tool pane.

query_string_filter_unconfigured

Configure the filter web part.

query_string_filter_configuration

The web part is now configured but not connected.

query_string_filter_configured

Now you need to connect the web parts, note that you can choose to connect the web parts from either end.

query_string_filter_connect

OR

edit_menu_with_connection

The connection between the web parts needs to be configured.

connection_configuration

Now the screen looks like this:

parameters_required

Once the courseCode query string parameter is supplied the report will be generated using that parameter value.

parameters_supplied

I hope this helps some one else out there.

Advertisements
This entry was posted in Deployment, Reporting Services, SharePoint. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s