if (purpose == PLAIN_REPORT || purpose == LEAF_REPORT) {
out.print("<div class='hideIfCollapsed'>\n");
// create a table writer with appropriate renderers.
HTMLTableWriter tableWriter = createTableWriter(evModel, hideNames,
showTimingIcons);
// to draw the completed tasks table, remove the "task with timing
// icons" renderer if it happens to be in use.
HTMLTableWriter.CellRenderer taskRenderer = tableWriter
.getCellRenderer(EVTaskList.TASK_COLUMN);
tableWriter.setCellRenderer(EVTaskList.TASK_COLUMN,
EVReport.EV_CELL_RENDERER);
String completedTasksTooltip = encodeHTML(resources.format(
"Completed_Tasks.Header_Tip_FMT", lastWeek, effDateDisplay));
String completedTasksHeader;
if (reportingPeriodIncludesToday)
completedTasksHeader = resources
.getHTML("Completed_Tasks.Header");
else if (reportingPeriodPrecedesToday)
completedTasksHeader = resources
.getHTML("Completed_Tasks.Header_Last");
else
completedTasksHeader = completedTasksTooltip;
out.print("<h3 title='" + completedTasksTooltip + "'>"
+ completedTasksHeader + "</h3>\n");
if (!oneCompletedLastWeek)
interpOut("<p><i>${None}</i>\n");
else {
printCompletedTaskTableHeader(showTimeThisWeek, showAssignedTo,
showMilestones, showLabels);
double totalPlannedTime = 0;
double totalActualTime = 0;
double totalPlannedValue = 0;
for (int i = 0; i < taskListLen; i++) {
if (!completedLastWeek[i])
continue;
double taskPlannedTime =
parseTime(tasks.getValueAt(i, -EVTaskList.PLAN_TIME_COLUMN));
double taskActualTime =
parseTime(tasks.getValueAt(i, -EVTaskList.ACT_TIME_COLUMN));
double taskPlannedValue =
((Double)tasks.getValueAt(i,
-EVTaskList.PLAN_VALUE_COLUMN)).doubleValue();
totalPlannedTime += taskPlannedTime;
totalActualTime += taskActualTime;
totalPlannedValue += taskPlannedValue;
printCompletedLine(tableWriter, tasks, i,
showTimeThisWeek ? actualTimeThisWeek : null,
showAssignedTo, showMilestones, showLabels);
}
interpOut("<tr class='sortbottom'><td><b>${Completed_Tasks.Total}"
+ " </b></td><td class='timeFmt'>");
out.print(formatTime(totalPlannedTime) + "</td>");
out.print("<td class='timeFmt'>");
out.print(formatTime(totalActualTime) + "</td>");
if (showTimeThisWeek) {
out.print("<td class='timeFmt'>");
out.print(formatTime(completedTasksTimeThisWeek) + "</td>");
}
if (totalPlannedTime > 0) {
double totalPctSpent = totalActualTime/totalPlannedTime;
out.print("<td>" + EVSchedule.formatPercent(totalPctSpent)
+ "</td>");
} else {
out.print("<td> </td>");
}
// Empty td for assigned to, planned date, and labels columns
int noSumCol = 1 + numOptionalCols;
for (int i = 0; i < noSumCol ; ++i)
out.print("<td> </td>");
out.print("<td>" + EVSchedule.formatPercent(totalPlannedValue)
+ "</td></tr>\n");
out.println("</table>");
}
// put the "task with timing icons" renderer back in place if necessary
tableWriter.setCellRenderer(EVTaskList.TASK_COLUMN, taskRenderer);
String inProgressTooltip = encodeHTML(resources.format(
"Tasks_In_Progress.Header_Tip_FMT", effDateDisplay));
String inProgressHeader;
if (reportingPeriodIncludesToday || reportingPeriodPrecedesToday)