Creating Agile Project Reports with TFS and Crystal Reports - Part 3
page 4 of 5
by Eric Landes
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 24088/ 57

SQL Statements

To create the burndown chart from the TFS tables, we first need to construct a SQL statement that contains these key elements: the iteration number, a running total of the points completed per iteration, and the actual total of points. 

Since the purpose of the burndown chart is to help in project estimation, we want show the trend of work completed.  We also want to see work remaining in this chart.  In Crystal, we could create a formula to subtract the running total of points completed from total points. In the SQL used for this article we do the subtraction in the SQL statement instead (See Listing 1).

Listing 1

select      [System.TeamProject]
 
        , sum(wil.[Microsoft.VSTS.Common.RoughOrderOfMagnitude]) as 'Iteration Total'
        , wil.[Microsoft.VSTS.Common.Rank] as Iteration 
            , ((select sum(wil2.[Microsoft.VSTS.Common.RoughOrderOfMagnitude])
                        from dbo.WorkItemsLatestUsed wil2
                        where wil2.[System.WorkItemType] = 'Scenario'
                          AND wil2.[System.Reason] <> 'Removed'
                          AND wil2.[System.TeamProject] = wil.[System.TeamProject]) -
              (select sum(wil3.[Microsoft.VSTS.Common.RoughOrderOfMagnitude])
                        from dbo.WorkItemsLatestUsed wil3
                        where wil3.[System.WorkItemType] = 'Scenario'
                          AND wil3.[System.State] = 'Resolved'
                          AND wil3.[System.Reason] = 'Completed'
                          AND wil3.[Microsoft.VSTS.Common.Rank] <= wil.[Microsoft.VSTS.Common.Rank]
                          AND wil3.[System.TeamProject] = wil.[System.TeamProject])) As 'RunningTotal'
            , (select sum(wil2.[Microsoft.VSTS.Common.RoughOrderOfMagnitude])
                        from dbo.WorkItemsLatestUsed wil2
                        where wil2.[System.WorkItemType] = 'Scenario'
                          AND wil2.[System.Reason] <> 'Removed'
                          AND wil2.[System.TeamProject] = wil.[System.TeamProject]) as 'Total'
 
from dbo.WorkItemsLatestUsed wil
where wil.[System.WorkItemType] = 'Scenario'
  AND wil.[System.State] = 'Resolved'
  AND wil.[System.Reason] = 'Completed'
group by wil.[System.TeamProject], wil.[Microsoft.VSTS.Common.Rank]
order by wil.[System.TeamProject]

First add a Crystal Report to a Crystal Report project.  After selecting a cross-tab report (assuming we use the Crystal Wizard), we then create a new connection.  For that connection, using the SQL Native OLE DB connection driver, enter your server information and the database TfsWorkItemTracking.  Once your server is added, select Add Command under your servername.  Paste the query from code example 1 into the command window.

For the columns in the cross-tab, use the Iteration field. For the rows, use field Team Project.  Finally for "summary fields" use the field Running Total.  Then stepping through the wizard, we choose a bar graph.  We select a format from the options available in the styles section. 

Next, under chart options (right click on the chart to see this) choose the Title option to change the Title to BurnDown Chart.  Your chart is now ready to post in your war room!

Figure 1


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 



Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-05-18 6:33:46 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search