Creating a Project Task Report

Problem

You want to create a report that shows the tasks in your project, their status and percentage complete.

Solution

Create an output template in Certinia Output Builder and base it on the project object.

To create the template:

  1. Click the Output Template tab.
  2. Click New.
  3. Enter a name for the report in the Output Template Name field.
  4. Enter the name of the type to which you want the template to belong in the Template Class field.
  5. Enter proj__c in the Object Name field
  6. Enter Project__c in the Related List field.
  7. Complete the remaining fields depending on your requirements. See Body.
  8. Click Save.
  9. Click New Output Template Body.
  10. Paste the sample template that follows into the Body field and modify it according to your requirements. For information about Output Template Body HTML tags, see Output Template Body HTML Definitions.
  11. Complete the remaining fields. See Body.
  12. Click Save.
  13. In the Output_History__c object add a custom lookup field as a lookup to the Project object.
  14. From Setup, click Create | Objects | Project.
  15. Scroll to the Custom Buttons and Links.
  16. Click New.
  17. Complete the Label and Name fields.
  18. Click Detail Page Button.
  19. Select Display in new window from the Behavior drop-down list.
  20. Paste the following in the large box beneath the Select Field Type drop-down list:

    /apex/ob1__OutputManager?id={! Project__c.Id}&class=YourTemplateClass

    Where YourTemplateClass is the name of the template class to which the report relates.

  21. Click Save.
  22. Add the Detail Page Button you created to the page layout of the Project object.
  23. Add the Output Histories related list to the page layout of the Project object.

Sample HTML Template

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en">
<head>
<meta name="" content="Sample HTML Template" />
<title></title>
</head>
<body>
<div><strong>Project Task Report for Project</strong></div>
<table align="center" border="1" cellpadding="3" cellspacing="0" class="zeroBorder" width="600">
<tr>
<td width="185"><strong>Project Task</strong></td>
<td width="50" align="right"><strong>Percentage Complete Points</strong></td>
<td width="50" align="right"><strong>Status</strong></td>
</tr>
<output_list object="pse__Project_Task__c" relation="pse__Project__c">
<filters>
<filter field="pse__Status__c" operator="not_equal" value="Draft" />
</filters>
<tr>
<td width="185"><ol_field name="Name"/></td>
<td width="50" align="right"><ol_field name="pse__Percent_Complete_Points__c" format="0"/></td>
<td width="50" align="right"><ol_field name="pse__Status__c" format="0"/></td>
</tr>
</output_list>
<aggregated_output_list object="pse__Project_Task__c" relation="pse__Project__c" >
<filters>
<filter field="pse__Status__c" operator="not_equal"
value="Complete" />
</filters>
<tr>
<td width="185>&nbsp;</td>
<td width="50" align="right"><strong>Percentage of all Project Tasks Complete</strong></td>
<td width="50" align="right"><math operator="*" format="decimals:1;">
<term1>
<math operator="/">
<term1><aol_field name="pse__Points_Complete__c" alias="tot2" aggregate_function="sum" type="number" format="decimals:2;"/></term1>
<term2><aol_field name="pse__Points__c" alias="tot1" aggregate_function="sum" type="number" format="decimals:2;"/></term2>
</math>
</term1>
<term2>100</term2>
</math></td>
</tr>
</aggregated_output_list>
</table>
</body>
</html>