Wednesday, April 19, 2006

 

Allowing blanks in the parameters of a report

In the new version of the SharePoint extension for Reporting Services, I added a feature that may need some explanation. All reports that use the extension will automatically have a parameter called SiteUrl. This parameter can be used to override the site URL that is configured in the connection string. If you leave the parameter blank, the value from the connection string will still be used. One problem: by default, reports will not allow blanks in their parameters.

How to allow blanks for a parameter

To allow blanks for a parameter, open the report in Visual Studio and go to Report|Report Parameters dialog. This is the place where you can select the option "Allow blank value". You might also choose to hide the parameter if you don't want to bother the report users with this feature.


Why adding this parameter anyway?

Sometimes you want to report over data in one and only one team site. Think of a central site that is used to track current job applications. There, it is fine to have the URL of the site as part of the connection string. But in some cases, you want to have one report, but you want to use it on data from several sites. These will typically be sites that are created from a common Site Template.

In our organization, we create a standard teamsite to track information about the progress of projects. This teamsite includes numerous web parts that display a SSRS report using data from the current site. This means that these web parts will have to pass the URL of their source team site to the report server on the URL of the report. The most obvious way to do this is by having the extension automatically insert a parameter into the report to override the default site URL.

Labels:


Comments: Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?