Generating Reports of the scheduled Project

TaskJuggler offers a number of report types. Probably the most popular ones are the HTML reports. You can advice TaskJuggler to generate one or more HTML pages that contain lists of your tasks, resources or accounts.

Before we start with the reports, we present you another macro. We like to add a navigation bar to each HTML page that holds a number of buttons. Each button changes the page to another report. This way we can create a navigation bar that holds links to all reports. Since we have created a macro, we can add the navigation bar to all reports without much hassle. The navigation bar is constructed with raw HTML tags. If you are not familiar with HTML this will look very strange to you. Don't worry, this is just a cool feature we would like to demonstrate. You can use TaskJuggler to it's full extend without having to learn HTML code.

The HTML code is injected into the reports using the rawhead attribute. This will put the HTML code close to the top of the HTML page right after the body started. As you can see here, string parameters of attributes can be enclosed in single quotes as well. This is handy, if the string itself needs to contain double quotes.


macro navbar [
rawhead
  '<p><center>
  <table border="2" cellpadding="10">
  <tr>
    <td class="default" style="font-size:120%" rowspan="2">
    <a href="Tasks-Overview.html">Tasks Overview</td>
    <td class="default" style="font-size:120%" rowspan="2">
    <a href="Tasks-Details.html">Tasks Details</td>
    <td class="default" style="font-size:120%" rowspan="2">
    <a href="Staff-Overview.html">Staff Overview</td>
    <td class="default" style="font-size:120%" rowspan="2">
    <a href="Staff-Details.html">Staff Details</td>
    <td class="default" style="font-size:120%" rowspan="2">
    <a href="Accounting.html">Accounting</td>
    <td class="default" style="font-size:120%" rowspan="2">
    <a href="acso.eps">GANTT Chart (Postscript)</td>
  </tr>
  </table>
  </center></p><br>'
]

Generating HTML Task Reports

As the first report, we would like to have a general overview of all tasks with their computed start and end dates. To visualize the dates a bit more, we also include a Gantt chart like bar graph. The property htmltaskreport defines exactly this, a list of all tasks in a table. The columns are flexible and can be specified with the column attribute. For this report we like to see the number, the name, the start and end date, a weekly calendar and the total effort in the table.


htmltaskreport "Tasks-Overview.html" {
  ${navbar}
  columns hierarchindex, name, duration, effort { title "Work"},
          start, end, weekly
  timeformat "%a %Y-%m-%d"
  barlabels empty
  headline "Accounting Software Project"
  caption "This table presents a management-level overview of the
    project. The values are days or man-days."
}

Since we don't like the default column title for the effort column we change it to "Work". Dates should be displayed as Sun 2003-09-29, so we use the attribute timeformat. For the overview page we don't like to have load values in the calendar. We just want to have the Gantt chart like bars that visualize the duration of the tasks. Since the load values are reported by default, we use the attribute barlabels to surpress them. With the headline attribute we can specify a headline for the report. To have a little more info included as well, we use the caption attribute. Both of these attributes are followed by the string to be included into the report.

Now we like to generate a report that contains a lot more details about the task. The weekly calendar is replaced by a daily calendar. The weekly calendar had a column for each week. The daily calendar features a column for each day. The column includes the load for the task for the week or day and a colored background in case the task is active that day or week.


htmltaskreport "Tasks-Details.html" {
  ${navbar}
  columns no, name, start, end, scenario, daily
  start 2002-03-01
  end 2002-04-01
  scenarios plan, delayed
  headline "Accounting Software Project - March 2002"
  caption "This table shows the load of each day for all the tasks.
    Additionally the resources used for each task are listed. Since the
    project start was delayed, the delayed schedule differs significantly
    from the original plan."
  hideresource 0
}

In order to limit the report to a reasonable size, we limit the daily calendar to the interval 2002-03-01 - 2002-04-01 with the start and end attributes. We also like to list all assigned resources right after each task. Normally resources are hidden in task reports but they can be enabled by using the hideresource attribute. The attribute is followed by a logical expression that specifies what resources to hide. The expression is evaluated for each resource and if the result is true (not 0) than the resource is hidden. Since we want to show all resources we put a 0 in, so it's false for all resources.

To add even more information to this report, we also turn on the reporting of values of the delayed scenario by using the scenarios attribute. This causes TaskJuggler to split the lines of the report into one for each scenario where appropriate and report the values underneath each other.

Generating HTML Resource Reports

The previous report listed the resources per task. Now we want to generate a report the lists all resources. It's again a report with a weekly calendar. This time we use the attribute loadunit to report the load in hours instead of days.


htmlresourcereport "Staff-Overview.html" {
  ${navbar}
  columns no, name, scenario, weekly, effort
  scenarios plan, delayed
  loadunit hours
  headline "Weekly working hours for the Accounting Software Project"
}

Now a similar report but with much more details. We want to include the tasks again, this time each resource should be followed by the tasks the resource is assigned to. In htmltaskreports resources are hidden by default while in htmlresourcereports tasks are hidden by default. To include tasks the attribute hidetask needs to be used. It is followed by a logical expression just like hideresource.


htmlresourcereport "Staff-Details.html" {
  ${navbar}
  columns name, daily, effort
  start 2002-03-01
  end 2002-04-01
  hidetask 0
  hideresource team
  sortresources nameup
  loadunit hours
  headline "Daily working hours for the Accounting Software Project -
  March 2002"
}

When specifying the resources we have grouped the resources into two teams by creating two pseudo resources that had the real employees as sub resources. We have attached the flag team to those pseudo resources. We now use this flag as logical expression for hideresource. So all resources that have this flag will be hidden in the report. For better readability we sort the resource list by name in ascending order. The attribute sortresources is taking care of this.

Generating HTML Account Reports

To conclude the HTML reports a report that shows how poorly the project is calculated is generated. The company won't get rich with this project. Due to the slip, it actually needs a loan from the bank to pay the salaries.


htmlaccountreport "Accounting.html" {
	${navbar}
  columns no, name, total, monthly 
	headline "P&L for the Accounting Software Project" 
	caption "The table shows the profit and loss analysis as well as the
	         cashflow situation of the Accounting Software Project."
  accumulate
	scenarios plan, delayed
}

The htmlaccountreport property produces similar reports as the above ones, but it lists accounts instead of tasks or resources. The total column shows the value of the account at the end of the reported time interval. The accumulate attribute puts the calendar in accumulation mode. The monthly columns list the value of the account at the end of the month. Normally the amount that has been added or subtracted from the account would be listed.

Generating XML Reports

Finally we generate an XML report that contains all info about the scheduled project. This report will be used by tjx2gantt to create a nice GANTT chart of our project. The file can also be read by tools like tjGUI or the KDE Konqueror plug-in. Since the Konqueror plug-in already uses the new, version 2 XML format, you have to comment out the version attribute.


xmlreport "AccountingSoftware.tjx" {
	#version 2
}