blogger counters

Wednesday, July 21, 2010

Using TfsRedirect to Display Reports in TFS 2010 Dashboards

You may have seen some reports show up in the TFS 2010 dashboards and wondered how we did a few things:

  • How does the dashboard locate the report?
  • How did we hide the parameter bar?
  • How did we hide the report’s head and footer?
  • How did we make the reports smaller?

I’ll answer each of these questions in sections below.

What I won’t do here is provide a walkthrough of setting up web parts to show reports. My friend Chris Adams already wrote a nice blog on this: Enhancing TFS 2010 Dashboards – Project Mgmt, Bugs, Builds, etc.

What is TfsRedirect?

Here’s the scenario. You had TFS create a dashboard site in SharePoint when you created your team project (or you added it later as described here). There are several items on this dashboard that point to other locations that are potentially on other servers:

  • Team Web Access
  • Process Guidance
  • Reports shown on the dashboard pages

TFS itself know where to find these assets. And the locations can change if, for example, the TFS administrator moves the reports to a different server.

Rather than hard-code the locations of these assets into the dashboard, the TFS team created a web page called TfsRedirect.aspx that knows where these different assets are located, and will redirect to that page.

This is what the URL looks like on the Agile dashboard that shows the Burndown graph:

/sites/DefaultCollection/wss/_layouts/TfsRedirect.aspx?tf:Type=Report&tf:ReportName=Dashboards/Burndown&tf:ShowToolbar=0&Width=381pt&Height=180pt

Yikes, you say! It’s actually not that bad once you break this into the different parts. The first part is basically the path to the TfsRedirect.aspx file. This is a relative path that is used to get to various pages on your site, followed by “_layouts/TfsRedirect.aspx” that refers to the actual location of this file.

After the question mark are a set of parameters. The parameters that begin with tf: are parameters to TfsRedirect itself. All other parameters will be passed on unchanged to the final URL that TfsRedirect builds, which in this case will be a URL to the report on Reporting Services.

TfsRedirect Parameters

The first parameter, tf:Type, determines the destination for the redirection, such as reports or process guidance. Here are the values support for tf:Type, which is a required parameter:

tf:Type Value Meaning
Report Displays a single report. See below for additional parameters.
ReportList Displays a list of reports, using SQL Reporting Services’ Report Manager page. This values is used by the Reports quick launch link on the dashboards to take you to Report Manager.
ProcessGuidance Display the process guidance defined for this team project. This is used by the Process Guidance quick launch link in the dashboards.
WebAccess Redirect to the Team Web Access web application. This is used by the Team Web Access link on the dashboards.

There are some other parameters that can be used in unusual cases:

Parameter Meaning
tf:ClearCache=1 (optional) You should never include this parameter in a web part. Instead, this is a parameter that a TFS administrator might after changing TFS settings, such as the location of reporting services, in order to have the web site retrieve the latest value right away.
tf:Test=1 (optional) You can add this parameter onto an existing TfsRedirect URL to display “debugging” information that can help a TFS administrator. This will display information such as the connected team project. It will also display the URL that TfsRedirect will use as the destination of the redirect.
tf:ProjectID (optional) Allows you to specify a team project that is different from the team project connected to the dashboard. This is the project’s GUID, and looks something like this:

     ProjectId={74893-374983-73489-473894237}

tf:Type=Report Parameters

Most of the extra parameters supported by TfsRedirect are used for the Report redirection type. Here are the parameters supported:

Parameter Meaning
tf:ReportName (required) The name of the report. If the report is inside a folder, you’ll need to put that folder in front of the name. For example, “Dashboards/Burndown.” In some cases you’ll see “%2f” substituted for the “/” character, but you don’t need to do this when calling TfsRedirect.
tf:ShowToolbar (optional) Set to 0 if you want to hide the report parameters bar and the toolbar. Setting this to 1, or leaving it out, will show both. The Agile and CMMI dashboards always set this to 0 for reports shown on the dashboard.

tf:Type=ProcessGuidance Parameters

There is only one optional parameter for process guidance:

Parameter Meaning
DocumentPath (optional) A file name or relative path that will be appended to the normal guidance URL. If you have problems getting this to work, you can use the tf:Test=1 parameter described above to see the full URL that TfsRedirect builds.

Reports that Support IsDashboard

We did some extra work to make some of the reports work on dashboards. This was done by adding some parameters to the report (you can set

OK, the final two questions are about how to display “dashboard” versions of the reports. We added “dashboard” support to some, but not all of the reports. Basically, if the dashboard has a parameter called IsDashboard, it has some support. Here are the parameters related to dashboard support:

Parameter Meaning
IsDashboard Set this to True to hide the header and footer of the report. For example, IsDashboard=true. In some cases, we have special dashboard versions of the report that don’t need this parameter, located in the Dashboards report folder.
Width If present, you can use this to set the width of a chart. For example, Width=381pt. The measure is important here, and Reporting services can be a little picky. Points (pt) are usually a good measure to use.
Height If present, sets the height of the chart in the report. The same rules apply as for Width.

Here are some of my previous blog posts that will help you with setting report parameters:

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home