Customizing Report Parameters for Team Foundation Server 2010
Very often you’ll want to change the default settings for parameters in a report, but Reporting Services doesn’t have a user interface that allows you to select parameters, and then save them for use again. There is a way to customize the set of parameter values without learning how to author reports, but it’s a little involved. In this post, I’ll cover the following:
- Changing the default values that are used to render a report
- Creating multiple views on the same report, each with different default parameters
About Report Parameters
First a little bit of background on report parameters. Many of the TFS 2010 reports read from the Analysis Services database (or cube) that, by default, is called Tfs_Analysis (it was called TfsWarehouse in previous releases). Since this is a cube, and not a relational warehouse, default parameter values will look a little odd. As an example, this is what the default value might look like when you want to select “Iteration 1” in the iteration parameter:
[Work Item].[Iteration Hierarchy].[Iteration1].&[10]&[11]
Yikes, you say, how are you supposed to figure that out?
I’m not going to get into the details of why this is so complicated. If you’re interested, I wrote an MSDN article for TFS 2008 that will give you some idea about how this works, although the details have changed since then.
But there is a tool you can use to get this information: SQL Server Management Studio, which you can install from the SQL Server DVD. Alternatively, you can use a free program called MDX Studio, which is what I’ll use here as an example.
Finding the Default Value
The first step is to launch MDX Studio and connect to the TFS cube. You might need to find out the server and database from your TFS administrator, and also have them grant you read access (they need to add you to the TfsWarehouseDataReader role).
Finding an Iteration Value
- Launch MDX Studio, type the name of the Analysis Services machine into the Connect to Analysis Services dialog box, and then click on the Connect button. You should see a display something like this:
- In the Metadata section, scroll down so you can see Work Item and expand that item.
- Expand the Work Item.Iteration Hierarchy node.
- Expand the (All) and then All nodes, and then the collection node that contains your team project.
- Expand the node that contains your team project. You should see something like this:
- Finally, drag the iteration node (Iteration 1 in this example) into the Query area:
You can now copy this “ID” and use it in the following steps.
Setting Parameter Defaults
You’ll be using Report Manager to make these changes:
- Right click on the Reports node of your team project inside Visual Studio and select Show Report Site…:
- Click on the Properties tab at the top of the report:
- Click on the Parameters link:
At this point you’ll see a list of parameters, which should look something like this:
To change the default iteration, for example, you would paste the value you got from the previous step into the text box circled in red above, and then click on the Apply button.
Multiple Parameter Settings – Linked Reports
There are times where you’ll want to have several versions of the report, each with different parameter values. Reporting Services has a feature called Linked Reports that allows you to essentially create sets of parameters that will be applied to a single copy of the report, but appear as a new report.
Here is how you create a linked report:
- Click on the Properties tab for the report (just like in the previous section)
- Click on the Create Linked Report button on the Properties page
- Type in the name you want to use for this new linked report, and then click on the OK button
- Click on the Properties tab of this new linked report
- 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
10 Comments:
I downloaded:
Microsoft® Visual Studio® 2010 and Team Foundation Server® 2010 Beta 2for Microsoft® Virtual PC 2007 SP1 Image
When I go into the default installation of TFS project site in Sharepoint
(http://vs2010beta2/sites/DefaultCollection/IBuySpy/Dashboards/ProjectDashboard_wss.aspx)
I get this error on the webparts.
There are no accessible team projects in this Team Project Collection. Contact your Team Foundation Server administrator.
In the Team Server Admin Console - Team Project Collection - Team Projects tab the projects are there. This is the default installation. Any suggestions???
Unbelievable... that's crazy. I've been trying to figure that out for some time now with no luck. I wouldn't have figured that out on my own - thanks so much for your post!
There are several other posts that explain this, but yours was the one that made sense to me. I wonder when Microsoft will make this easier...
This should simply be a dropdown list in the properties page rather than having to manually enter this info. Plus, if you're doing scrum in short cycles (2-3 weeks) that means you have to do this every 2-3 weeks for EVERY report you're going to use... a major waste of time!
I followed the steps to customise the reports in tfs reports section as suggested, but it does not work.
I have a collection say A. Within the collection i have multiple projects. One of these projects has the following hirearchy, please guide.
6 \B \A\B
1 \B\Backlog \A\B
148 \B\Iteration1 \A\B
150 \B\Iteration2 \A\B
149 \B\Iteration3 \A\B
If I have to go to Iteration 1, i tired with folloiwng parameters, which never worked. I dd not change any thing else:
[Work Item].[Iteration Hierarchy].[Iteration1].&[6]&[148]
In reports section of the portal, when i change the parameter as above, the Area Parametere and the State parameter goes blank when I apply the changes. On the View page the Area parameter is editable bu the state parameter is not editable due to which the rports do not run. The reports are SQLreports and do not use OLAP.
Please guide.
Thanks
Big help. Thanks for the post.
I would suggest a slightly easier way to achieve this is to create a subscription to the report (e.g. the burndown) with your iteration parameters.
Have this subscription deliver an MHTML file to a shared folder and then modify your page viewer web part to view this file.
Using the subscription editor within Reporting Services you get a check list box drop down of iterations which you can select from, which makes life easier.
Just set the subscription interval to whatever refresh frequency you need.
Regards,
John
Hi John,
It's possible to obtain these values with an MDX query? For example, it's possible to obtain the area identificator given an area path like \Tailspin toys\Web development?
Thank you very much,
You can also get these values by opening the burndown, setting it as you want, and then clicking the "Export to data feed" orange button in the middle of the page next to the print button. Then you just have to just parse the values out if you open the data feed in something like notepad.
Good blog post
Post a Comment
<< Home