blogger counters

Monday, April 19, 2010

Report Parameters in Dashboards via URL Parameters

I had a recent question about how to customize the Burndown and Burnrate report to show both tasks and bugs. By default this report only shows tasks. Unfortunately, it’s not very easy to customize the report to change the default from task to both task and bug.

However, you can create a URL to the report that will set the default to both work item types. Here’s how. Let’s say you have a URL to your report that looks something like this:


The following rewrite of this URL will display the same report, but with both Task and Bug selected by default:

http://server/ReportServer/Pages/ReportViewer.aspx?%2fTfsReports%2fDefaultCollection%2fAgile%2fProject+Management%2fBurndown+and+Burn+Rate&WorkItemTypeParam=[Work Item].[System_WorkItemType].%26[Bug]&WorkItemTypeParam=[Work Item].[System_WorkItemType].%26[Task]

The parameter that controls the work items is called WorkItemTypeParam, and it expects values that are from the cube (see my post on Customizing Report Parameters for how to get the actual value to use). When you want to supply more than one value, as here, you need to repeat the parameter assignment once for each parameter value. I’ve highlighted the two instances of the parameter assignment above.

Note: You need to have the %26 in front of each work item type in order for this to work. Reporting Services is very picky—the value you send to a parameter has to match the parameter values exactly. The Burndown and Burnrate report has & characters (%26 when encoded) in front of [Bug], etc., which means that these are key values.

Friday, April 02, 2010

More about Linked Reports and Team Foundation Server

Here’s a common problem. Several teams are using the same TFS team project, which means they share a single set of reports. But each team has different parameters they use when they run a report. But you don’t want to have to enter the start and end date, etc. each time you open the report. What do you do?

There is a way to customize the default parameter values that are used when you first open a report, which I described in a previous post on customizing report parameters. But if you have multiple teams using the same report and they need different defaults, what do you do? You use linked reports.

Linked reports are essentially a new set of default parameter values that are linked to the original report. That means each team can create their own linked report that will have their own default values.

Here is a common example. Your team uses the Burndown and Burnrate report, but with iteration start and end dates that doesn’t match other teams’ dates, and you’re also using the area path to differentiate your work from other teams.

First you would create a linked report, and then change the default parameters for your new report:

  1. Click on the Properties tab for the report (just like in the previous section)
  2. Click on the Create Linked Report button on the Properties page
  3. Type in the name you want to use for this new linked report, and then click on the OK button
  4. Click on the Properties tab of this new linked report
  5. Click on the Parameters link on the left side to customize the parameter values that will be used for the linked report, and click on the Apply button to accept the new default values

This “new report” will look exactly like the original report, but it will have your own default values. From now on, you can simply open the report and it will render with the values you normally want to use.