← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2622: Fixed issue with sorting in report table view

 

------------------------------------------------------------
revno: 2622
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-01-18 15:51:18 +0100
message:
  Fixed issue with sorting in report table view
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
  dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/orgunitdistribution/OrgUnitDistributionServiceTest.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2011-01-17 16:17:06 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2011-01-18 14:51:18 +0000
@@ -32,6 +32,8 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -293,7 +295,7 @@
      * Generated pretty-print names for crosstabulated columns in the report table,
      * where key is column name and value is pretty column name.
      */
-    private Map<String, String> prettyCrossTabColumns = new HashMap<String, String>();
+    private SortedMap<String, String> prettyCrossTabColumns = new TreeMap<String, String>();
     
     /**
      * Generated unique identifiers used to retrieve the corresponding value from the datavalue table. 
@@ -1338,7 +1340,7 @@
         return crossTabColumns;
     }
 
-    public Map<String, String> getPrettyCrossTabColumns()
+    public SortedMap<String, String> getPrettyCrossTabColumns()
     {
         return prettyCrossTabColumns;
     }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/orgunitdistribution/OrgUnitDistributionServiceTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/orgunitdistribution/OrgUnitDistributionServiceTest.java	2010-12-25 16:43:02 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/orgunitdistribution/OrgUnitDistributionServiceTest.java	2011-01-18 14:51:18 +0000
@@ -62,6 +62,6 @@
         Grid grid = distributionService.getOrganisationUnitDistribution( groupSet, unitA, false );
         assertNotNull( grid );
         assertEquals( 3, grid.getWidth() );
-        assertEquals( 2, grid.getHeight() );
+        assertEquals( 3, grid.getHeight() ); // Including total
     }   
 }