← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2621: Issue with sorting in report tables. More to come

 

------------------------------------------------------------
revno: 2621
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-01-18 15:33:30 +0100
message:
  Issue with sorting in report tables. More to come
modified:
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/SaveTableAction.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-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/SaveTableAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/SaveTableAction.java	2011-01-06 09:03:29 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/SaveTableAction.java	2011-01-18 14:33:30 +0000
@@ -296,13 +296,34 @@
 
     private ReportTable getReportTable()
         throws Exception
-    {
-        List<DataElement> dataElements = getList( dataElementService.getDataElements( getIntegerCollection( selectedDataElements ) ) );        
-        List<Indicator> indicators = getList( indicatorService.getIndicators( getIntegerCollection( selectedIndicators ) ) );        
-        List<DataSet> dataSets = getList( dataSetService.getDataSets( getIntegerCollection( selectedDataSets ) ) );        
-        List<Period> periods = getList( periodService.getPeriodsByExternalIds( selectedPeriods ) );        
-        List<OrganisationUnit> units = getList( organisationUnitService.getOrganisationUnits( getIntegerCollection( selectedOrganisationUnits ) ) );
+    {    
+        List<Period> periods = getList( periodService.getPeriodsByExternalIds( selectedPeriods ) );
+        
+        List<DataElement> dataElements = new ArrayList<DataElement>();        
+        List<Indicator> indicators = new ArrayList<Indicator>();
+        List<DataSet> dataSets = new ArrayList<DataSet>();
+        List<OrganisationUnit> units = new ArrayList<OrganisationUnit>();
 
+        for ( Integer id : getIntegerCollection( selectedDataElements ) )
+        {
+            dataElements.add( dataElementService.getDataElement( id ) );
+        }
+        
+        for ( Integer id : getIntegerCollection( selectedIndicators ) )
+        {
+            indicators.add( indicatorService.getIndicator( id ) );
+        }
+        
+        for ( Integer id : getIntegerCollection( selectedDataSets ) )
+        {
+            dataSets.add( dataSetService.getDataSet( id ) );
+        }
+        
+        for ( Integer id : getIntegerCollection( selectedOrganisationUnits ) )
+        {
+            units.add( organisationUnitService.getOrganisationUnit( id ) );
+        }
+        
         DimensionSet dimensionSet = dimensionService.getDimensionSet( dimensionSetId );
         
         RelativePeriods relatives = new RelativePeriods( reportingMonth, monthsThisYear, quartersThisYear, thisYear, monthsLastYear, quartersLastYear, lastYear );