Index: /trunk/src/VBox/ValidationKit/testmanager/core/report.py
===================================================================
--- /trunk/src/VBox/ValidationKit/testmanager/core/report.py	(revision 61290)
+++ /trunk/src/VBox/ValidationKit/testmanager/core/report.py	(revision 61291)
@@ -373,7 +373,7 @@
         self.cHits              = 0;            # Sum number of hits in all periods and all reasons.
         self.cMaxHits           = 0;            # Max hits in a row.
-        self.cMinHits           = 0;            # Min hits in a row.
+        self.cMinHits           = 99999999;     # Min hits in a row.
         self.cMaxRows           = 0;            # Max number of rows in a period.
-        self.cMinRows           = 0;            # Min number of rows in a period.
+        self.cMinRows           = 99999999;     # Min number of rows in a period.
         self.diPeriodFirst      = {};           # The period number a reason was first seen (keyed by subject ID).
         self.diPeriodLast       = {};           # The period number a reason was last seen (keyed by subject ID).
@@ -392,13 +392,13 @@
         """ Worker for appendPeriod and recalcStats. """
         self.cHits += oPeriod.cHits;
-        if oPeriod.cHits > self.cMaxHits:
-            self.cMaxHits = oPeriod.cHits;
-        if oPeriod.cHits < self.cMinHits:
-            self.cMinHits = oPeriod.cHits;
-
-        if len(oPeriod.aoRows) > self.cMaxHits:
-            self.cMaxHits = len(oPeriod.aoRows);
-        if len(oPeriod.aoRows) < self.cMinHits:
-            self.cMinHits = len(oPeriod.aoRows);
+        if oPeriod.cMaxHits > self.cMaxHits:
+            self.cMaxHits = oPeriod.cMaxHits;
+        if oPeriod.cMinHits < self.cMinHits:
+            self.cMinHits = oPeriod.cMinHits;
+
+        if len(oPeriod.aoRows) > self.cMaxRows:
+            self.cMaxRows = len(oPeriod.aoRows);
+        if len(oPeriod.aoRows) < self.cMinRows:
+            self.cMinRows = len(oPeriod.aoRows);
 
     def recalcStats(self):
@@ -406,7 +406,7 @@
         self.cHits          = 0;
         self.cMaxHits       = 0;
-        self.cMinHits       = 0;
+        self.cMinHits       = 99999999;
         self.cMaxRows       = 0;
-        self.cMinRows       = 0;
+        self.cMinRows       = 99999999;
         self.diPeriodFirst  = {};
         self.diPeriodLast   = {};
@@ -474,8 +474,8 @@
         super(ReportPeriodSetWithTotalBase, self)._doStatsForPeriod(oPeriod);
         self.cTotal += oPeriod.cTotal;
-        if oPeriod.cTotal > self.cMaxTotal:
-            self.cMaxTotal = oPeriod.cTotal;
-        if oPeriod.cTotal < self.cMinTotal:
-            self.cMinTotal = oPeriod.cTotal;
+        if oPeriod.cMaxTotal > self.cMaxTotal:
+            self.cMaxTotal = oPeriod.cMaxTotal;
+        if oPeriod.cMinTotal < self.cMinTotal:
+            self.cMinTotal = oPeriod.cMinTotal;
 
         if oPeriod.uMaxPct > self.uMaxPct:
Index: /trunk/src/VBox/ValidationKit/testmanager/webui/wuireport.py
===================================================================
--- /trunk/src/VBox/ValidationKit/testmanager/webui/wuireport.py	(revision 61290)
+++ /trunk/src/VBox/ValidationKit/testmanager/webui/wuireport.py	(revision 61291)
@@ -264,5 +264,6 @@
         return u'<td align="center">%u</td>' % (oSet.dcHitsPerId[idKey],);
 
-    def _generateTableForSet(self, oSet, sColumnName, aidSorted = None, fWithTotals = True, cColsPerSeries = None):
+    def _generateTableForSet(self, oSet, sColumnName, aidSorted = None, iSortColumn = 0,
+                             fWithTotals = True, cColsPerSeries = None):
         """
         Turns the set into a table.
@@ -276,8 +277,10 @@
         # Header row.
         sHtml += u' <tr><thead><th></th><th>%s</th>' % (webutils.escapeElem(sColumnName),)
-        for oPeriod in reversed(oSet.aoPeriods):
-            sHtml += u'<th colspan="%d">%s</th>' % (cColsPerSeries, webutils.escapeElem(oPeriod.sDesc),);
+        for iPeriod, oPeriod in enumerate(reversed(oSet.aoPeriods)):
+            sHtml += u'<th colspan="%d">%s%s</th>' % ( cColsPerSeries, webutils.escapeElem(oPeriod.sDesc),
+                                                       '&#x25bc;' if iPeriod == iSortColumn else '');
         if fWithTotals:
-            sHtml += u'<th colspan="%d">Total</th>' % (cColsPerSeries,);
+            sHtml += u'<th colspan="%d">Total%s</th>' % (cColsPerSeries,
+                                                         '&#x25bc;' if iSortColumn == len(oSet.aoPeriods) else '');
         sHtml += u'</thead></td>\n';
 
@@ -308,5 +311,5 @@
     def _getSortedIds(self, oSet, fByTotal = None):
         """
-        Get default sorted subject IDs.
+        Get default sorted subject IDs and which column.
         """
 
@@ -319,4 +322,5 @@
                                   key = lambda idKey: oSet.dcHitsPerId[idKey] * 10000 / oSet.dcTotalPerId[idKey],
                                   reverse = True);
+            iColumn = len(oSet.aoPeriods);
         else:
             # Sort by NOW column.
@@ -327,5 +331,6 @@
                 else:               dTmp[idKey] = oRow.cHits * 10000 / max(1, oRow.cTotal);
             aidSortedRaw = sorted(dTmp, key = lambda idKey: dTmp[idKey], reverse = True);
-        return aidSortedRaw;
+            iColumn = 0;
+        return (aidSortedRaw, iColumn);
 
     def _generateGraph(self, oSet, sIdBase, aidSortedRaw):
@@ -410,5 +415,5 @@
         # Generate table and transition list. These are the most useful ones with the current graph machinery.
         #
-        sHtml  = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw);
+        sHtml  = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw, len(oSet.aoPeriods));
         sHtml += self._generateTransitionList(oSet);
 
@@ -485,7 +490,7 @@
         self._sTitle = 'Test Case Failures';
         oSet = self._oModel.getTestCaseFailures();
-        aidSortedRaw = self._getSortedIds(oSet);
-
-        sHtml  = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw);
+        (aidSortedRaw, iSortColumn) = self._getSortedIds(oSet);
+
+        sHtml  = self._generateTableForSet(oSet, 'Test Cases', aidSortedRaw, iSortColumn);
         sHtml += self._generateTransitionList(oSet);
         sHtml += self._generateGraph(oSet, 'testcase-graph', aidSortedRaw);
@@ -524,7 +529,7 @@
         self._sTitle = 'Test Case Variation Failures';
         oSet = self._oModel.getTestCaseVariationFailures();
-        aidSortedRaw = self._getSortedIds(oSet);
-
-        sHtml  = self._generateTableForSet(oSet, 'Test Case Variations', aidSortedRaw);
+        (aidSortedRaw, iSortColumn) = self._getSortedIds(oSet);
+
+        sHtml  = self._generateTableForSet(oSet, 'Test Case Variations', aidSortedRaw, iSortColumn);
         sHtml += self._generateTransitionList(oSet);
         sHtml += self._generateGraph(oSet, 'testcasearg-graph', aidSortedRaw);
@@ -556,7 +561,7 @@
         self._sTitle = 'Test Box Failures';
         oSet = self._oModel.getTestBoxFailures();
-        aidSortedRaw = self._getSortedIds(oSet);
-
-        sHtml  = self._generateTableForSet(oSet, 'Test Boxes', aidSortedRaw);
+        (aidSortedRaw, iSortColumn) = self._getSortedIds(oSet);
+
+        sHtml  = self._generateTableForSet(oSet, 'Test Boxes', aidSortedRaw, iSortColumn);
         sHtml += self._generateTransitionList(oSet);
         sHtml += self._generateGraph(oSet, 'testbox-graph', aidSortedRaw);
