← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13418: Data set report, more flexible selection of dimensions

 

------------------------------------------------------------
revno: 13418
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-12-24 16:02:47 +0100
message:
  Data set report, more flexible selection of dimensions
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/datasetreport/DataSetReportService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/datasetreport/DataSetReportStore.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/datasetreport/impl/DefaultDataSetReportService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/datasetreport/jdbc/AnalyticsDataSetReportStore.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.js


--
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/datasetreport/DataSetReportService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datasetreport/DataSetReportService.java	2013-09-16 17:07:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datasetreport/DataSetReportService.java	2013-12-24 15:02:47 +0000
@@ -29,14 +29,13 @@
  */
 
 import java.util.List;
-import java.util.Set;
+import java.util.Map;
 
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.period.Period;
 
 /**
@@ -49,25 +48,27 @@
      * Generates html code for a custom data set report.
      * 
      * @param dataSet the data set.
+     * @param period the period.
      * @param unit the organisation unit.
-     * @param period the period.
+     * @param dimensions mapping between dimension identifiers and dimension option identifiers.
      * @param selectedUnitOnly indicates whether to use captured or aggregated data. 
      * @param format the i18n format.
      * @return
      */
-    String getCustomDataSetReport( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups, boolean selectedUnitOnly, I18nFormat format );
+    String getCustomDataSetReport( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions, boolean selectedUnitOnly, I18nFormat format );
 
     /**
      * Generates a list of Grids based on the HTML code for a custom data set report.
      * 
      * @param dataSet the data set.
+     * @param period the period.
      * @param unit the organisation unit.
-     * @param period the period.
+     * @param dimensions mapping between dimension identifiers and dimension option identifiers.
      * @param selectedUnitOnly indicates whether to use captured or aggregated data. 
      * @param format the i18n format.
      * @return a list of Grids.
      */
-    List<Grid> getCustomDataSetReportAsGrid( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups,
+    List<Grid> getCustomDataSetReportAsGrid( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions,
         boolean selectedUnitOnly, I18nFormat format );
     
     /**
@@ -75,26 +76,28 @@
      * in the data set. The data elements are grouped by their category combo.
      * 
      * @param dataSet the data set.
+     * @param period the period.
      * @param unit the organisation unit.
-     * @param period the period.
+     * @param dimensions mapping between dimension identifiers and dimension option identifiers.
      * @param selectedUnitOnly indicates whether to use captured or aggregated data. 
      * @param format the i18n format.
      * @param i18n the i18n object.
      * @return a list of Grids.
      */
-    List<Grid> getDefaultDataSetReport( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups,  boolean selectedUnitOnly, I18nFormat format, I18n i18n );
+    List<Grid> getDefaultDataSetReport( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions,  boolean selectedUnitOnly, I18nFormat format, I18n i18n );
     
     /**
      * Generates a list of Grids representing a data set report. The data elements
      * are grouped and sorted by their section in the data set.
      * 
      * @param dataSet the data set.
+     * @param period the period.
      * @param unit the organisation unit.
-     * @param period the period.
+     * @param dimensions mapping between dimension identifiers and dimension option identifiers.
      * @param selectedUnitOnly indicators whether to use captured or aggregated data. 
      * @param format the i18n format.
      * @param i18n the i18n object.
      * @return a Grid.
      */
-    List<Grid> getSectionDataSetReport( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups, boolean selectedUnitOnly, I18nFormat format, I18n i18n );
+    List<Grid> getSectionDataSetReport( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions, boolean selectedUnitOnly, I18nFormat format, I18n i18n );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datasetreport/DataSetReportStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datasetreport/DataSetReportStore.java	2013-08-23 15:56:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datasetreport/DataSetReportStore.java	2013-12-24 15:02:47 +0000
@@ -29,11 +29,9 @@
  */
 
 import java.util.Map;
-import java.util.Set;
 
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.period.Period;
 
 /**
@@ -43,11 +41,11 @@
 {
     final String SEPARATOR = "-";
     
-    Map<String, Double> getAggregatedValues( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups, boolean rawData );
+    Map<String, Double> getAggregatedValues( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions, boolean rawData );
 
-    Map<String, Double> getAggregatedSubTotals( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups );
-    
-    Map<String, Double> getAggregatedTotals( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups );
-    
-    Map<String, Double> getAggregatedIndicatorValues( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups );
+    Map<String, Double> getAggregatedSubTotals( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions );
+    
+    Map<String, Double> getAggregatedTotals( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions );
+    
+    Map<String, Double> getAggregatedIndicatorValues( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions );
 }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/datasetreport/impl/DefaultDataSetReportService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/datasetreport/impl/DefaultDataSetReportService.java	2013-12-19 18:12:57 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/datasetreport/impl/DefaultDataSetReportService.java	2013-12-24 15:02:47 +0000
@@ -39,7 +39,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.regex.Matcher;
 
 import org.hisp.dhis.common.Grid;
@@ -61,7 +60,6 @@
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.system.filter.AggregatableDataElementFilter;
 import org.hisp.dhis.system.grid.GridUtils;
@@ -104,22 +102,22 @@
     // DataSetReportService implementation
     // -------------------------------------------------------------------------
 
-    public String getCustomDataSetReport( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups,
+    public String getCustomDataSetReport( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions,
         boolean selectedUnitOnly, I18nFormat format )
     {
-        Map<String, Double> valueMap = dataSetReportStore.getAggregatedValues( dataSet, period, unit, groups, selectedUnitOnly );
-        
-        valueMap.putAll( dataSetReportStore.getAggregatedTotals( dataSet, period, unit, groups ) );
-        
-        Map<String, Double> indicatorValueMap = dataSetReportStore.getAggregatedIndicatorValues( dataSet, period, unit, groups );
+        Map<String, Double> valueMap = dataSetReportStore.getAggregatedValues( dataSet, period, unit, dimensions, selectedUnitOnly );
+        
+        valueMap.putAll( dataSetReportStore.getAggregatedTotals( dataSet, period, unit, dimensions ) );
+        
+        Map<String, Double> indicatorValueMap = dataSetReportStore.getAggregatedIndicatorValues( dataSet, period, unit, dimensions );
         
         return prepareReportContent( dataSet.getDataEntryForm(), valueMap, indicatorValueMap, format );
     }
     
-    public List<Grid> getCustomDataSetReportAsGrid( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups,
+    public List<Grid> getCustomDataSetReportAsGrid( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions,
         boolean selectedUnitOnly, I18nFormat format )
     {
-        String html = getCustomDataSetReport( dataSet, period, unit, groups, selectedUnitOnly, format );
+        String html = getCustomDataSetReport( dataSet, period, unit, dimensions, selectedUnitOnly, format );
         
         try
         {
@@ -131,15 +129,15 @@
         }
     }
 
-    public List<Grid> getSectionDataSetReport( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups,
+    public List<Grid> getSectionDataSetReport( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions,
         boolean selectedUnitOnly, I18nFormat format, I18n i18n )
     {
         List<Section> sections = new ArrayList<Section>( dataSet.getSections() );
         Collections.sort( sections, new SectionOrderComparator() );
 
-        Map<String, Double> valueMap = dataSetReportStore.getAggregatedValues( dataSet, period, unit, groups, selectedUnitOnly );
-        Map<String, Double> subTotalMap = dataSetReportStore.getAggregatedSubTotals( dataSet, period, unit, groups );
-        Map<String, Double> totalMap = dataSetReportStore.getAggregatedTotals( dataSet, period, unit, groups );
+        Map<String, Double> valueMap = dataSetReportStore.getAggregatedValues( dataSet, period, unit, dimensions, selectedUnitOnly );
+        Map<String, Double> subTotalMap = dataSetReportStore.getAggregatedSubTotals( dataSet, period, unit, dimensions );
+        Map<String, Double> totalMap = dataSetReportStore.getAggregatedTotals( dataSet, period, unit, dimensions );
 
         List<Grid> grids = new ArrayList<Grid>();
         
@@ -244,7 +242,7 @@
         return grids;
     }
 
-    public List<Grid> getDefaultDataSetReport( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups, 
+    public List<Grid> getDefaultDataSetReport( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions, 
         boolean selectedUnitOnly, I18nFormat format, I18n i18n )
     {
         ListMap<DataElementCategoryCombo, DataElement> map = new ListMap<DataElementCategoryCombo, DataElement>();
@@ -268,7 +266,7 @@
             temp.getSections().add( section );
         }
         
-        return getSectionDataSetReport( temp, period, unit, groups, selectedUnitOnly, format, i18n );
+        return getSectionDataSetReport( temp, period, unit, dimensions, selectedUnitOnly, format, i18n );
     }
     
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/datasetreport/jdbc/AnalyticsDataSetReportStore.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/datasetreport/jdbc/AnalyticsDataSetReportStore.java	2013-09-16 17:07:25 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/datasetreport/jdbc/AnalyticsDataSetReportStore.java	2013-12-24 15:02:47 +0000
@@ -28,16 +28,16 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.system.util.ListUtils.getList;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import java.util.Set;
 
 import org.hisp.dhis.analytics.AnalyticsService;
 import org.hisp.dhis.analytics.DataQueryParams;
-import org.hisp.dhis.common.DimensionType;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataset.DataSet;
@@ -45,7 +45,6 @@
 import org.hisp.dhis.datasetreport.DataSetReportStore;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.system.filter.AggregatableDataElementFilter;
 import org.hisp.dhis.system.util.FilterUtils;
@@ -69,7 +68,7 @@
 
     @Override
     public Map<String, Double> getAggregatedValues( DataSet dataSet, Period period, OrganisationUnit unit, 
-        Set<OrganisationUnitGroup> groups, boolean rawData )
+        Map<String, String> dimensions, boolean rawData )
     {
         List<DataElement> dataElements = new ArrayList<DataElement>( dataSet.getDataElements() );
         
@@ -87,11 +86,11 @@
         params.setOrganisationUnit( unit );
         params.enableCategoryOptionCombos();
         
-        if ( groups != null && !groups.isEmpty() )
+        if ( dimensions != null )
         {
-            for ( OrganisationUnitGroup group : groups )
+            for ( String dim : dimensions.keySet() )
             {
-                params.setFilter( group.getGroupSet().getUid(), DimensionType.ORGANISATIONUNIT_GROUPSET, group );
+                params.setFilters( analyticsService.getDimension( dim, getList( dimensions.get( dim ) ), null, null ) );
             }
         }
         
@@ -109,7 +108,7 @@
     }
 
     @Override
-    public Map<String, Double> getAggregatedSubTotals( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups )
+    public Map<String, Double> getAggregatedSubTotals( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions )
     {
         Map<String, Double> dataMap = new HashMap<String, Double>();
         
@@ -139,11 +138,11 @@
                 params.setOrganisationUnit( unit );
                 params.setCategory( category );            
 
-                if ( groups != null && !groups.isEmpty() )
+                if ( dimensions != null )
                 {
-                    for ( OrganisationUnitGroup group : groups )
+                    for ( String dim : dimensions.keySet() )
                     {
-                        params.setFilter( group.getGroupSet().getUid(), DimensionType.ORGANISATIONUNIT_GROUPSET, group );
+                        params.setFilters( analyticsService.getDimension( dim, getList( dimensions.get( dim ) ), null, null ) );
                     }
                 }
                 
@@ -161,7 +160,7 @@
     }
 
     @Override
-    public Map<String, Double> getAggregatedTotals( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups )
+    public Map<String, Double> getAggregatedTotals( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions )
     {
         List<DataElement> dataElements = new ArrayList<DataElement>( dataSet.getDataElements() );
 
@@ -178,11 +177,11 @@
         params.setPeriod( period );
         params.setOrganisationUnit( unit );
 
-        if ( groups != null && !groups.isEmpty() )
+        if ( dimensions != null )
         {
-            for ( OrganisationUnitGroup group : groups )
+            for ( String dim : dimensions.keySet() )
             {
-                params.setFilter( group.getGroupSet().getUid(), DimensionType.ORGANISATIONUNIT_GROUPSET, group );
+                params.setFilters( analyticsService.getDimension( dim, getList( dimensions.get( dim ) ), null, null ) );
             }
         }
         
@@ -200,7 +199,7 @@
     }
 
     @Override
-    public Map<String, Double> getAggregatedIndicatorValues( DataSet dataSet, Period period, OrganisationUnit unit, Set<OrganisationUnitGroup> groups )
+    public Map<String, Double> getAggregatedIndicatorValues( DataSet dataSet, Period period, OrganisationUnit unit, Map<String, String> dimensions )
     {
         List<Indicator> indicators = new ArrayList<Indicator>( dataSet.getIndicators() );
         
@@ -215,11 +214,11 @@
         params.setPeriod( period );
         params.setOrganisationUnit( unit );
 
-        if ( groups != null && !groups.isEmpty() )
+        if ( dimensions != null )
         {
-            for ( OrganisationUnitGroup group : groups )
+            for ( String dim : dimensions.keySet() )
             {
-                params.setFilter( group.getGroupSet().getUid(), DimensionType.ORGANISATIONUNIT_GROUPSET, group );
+                params.setFilters( analyticsService.getDimension( dim, getList( dimensions.get( dim ) ), null, null ) );
             }
         }
         

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ListUtils.java	2013-12-24 15:02:47 +0000
@@ -170,6 +170,24 @@
         
         return list;
     }
+
+    /**
+     * Returns a List with the given items.
+     * 
+     * @param items the items which should be included in the List.
+     * @return a List.
+     */
+    public static <T> List<T> getList( T... items )
+    {
+        List<T> list = new ArrayList<T>();
+        
+        for ( T item : items )
+        {
+            list.add( item );
+        }
+        
+        return list;
+    }
     
     /**
      * Removes empty strings from the given list. Empty includes null.

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java	2013-09-16 17:07:25 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/dataset/action/GenerateDataSetReportAction.java	2013-12-24 15:02:47 +0000
@@ -28,12 +28,14 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.analytics.DataQueryParams.DIMENSION_NAME_SEP;
 import static org.hisp.dhis.dataset.DataSet.TYPE_CUSTOM;
 import static org.hisp.dhis.dataset.DataSet.TYPE_SECTION;
 
 import java.util.ArrayList;
-import java.util.HashSet;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import javax.servlet.http.HttpServletResponse;
@@ -50,8 +52,6 @@
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
@@ -66,9 +66,7 @@
  */
 public class GenerateDataSetReportAction
     implements Action
-{
-    private static final String SEP = ";";
-    
+{    
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -101,13 +99,6 @@
         this.organisationUnitService = organisationUnitService;
     }
     
-    private OrganisationUnitGroupService organisationUnitGroupService;
-
-    public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService )
-    {
-        this.organisationUnitGroupService = organisationUnitGroupService;
-    }
-
     private PeriodService periodService;
     
     public void setPeriodService( PeriodService periodService )
@@ -157,11 +148,11 @@
         this.ou = ou;
     }
     
-    private String groups;    
+    private Set<String> dimension;
 
-    public void setGroups( String groups )
+    public void setDimension( Set<String> dimension )
     {
-        this.groups = groups;
+        this.dimension = dimension;
     }
 
     private boolean selectedUnitOnly;
@@ -259,19 +250,17 @@
      
         selectedOrgunit = organisationUnitService.getOrganisationUnit( ou );
 
-        Set<OrganisationUnitGroup> ouGroups = new HashSet<OrganisationUnitGroup>();
-            
-        if ( groups != null && groups.split( SEP ).length > 0 )
+        Map<String, String> dimensions = new HashMap<String, String>();
+        
+        if ( dimension != null )
         {
-            String[] groupIds = groups.split( SEP );
-            
-            for ( String groupId : groupIds )
-            {                
-                OrganisationUnitGroup group = organisationUnitGroupService.getOrganisationUnitGroup( groupId );
+            for ( String dim : dimension )
+            {
+                String[] dims = dim.split( DIMENSION_NAME_SEP );
                 
-                if ( group != null )
+                if ( dims.length == 2 && dims[0] != null && dims[1] != null )
                 {
-                    ouGroups.add( group );
+                    dimensions.put( dims[0], dims[1] );
                 }
             }
         }
@@ -284,20 +273,20 @@
         {
             if ( type != null )
             {
-                grids = dataSetReportService.getCustomDataSetReportAsGrid( selectedDataSet, selectedPeriod, selectedOrgunit, ouGroups, selectedUnitOnly, format );
+                grids = dataSetReportService.getCustomDataSetReportAsGrid( selectedDataSet, selectedPeriod, selectedOrgunit, dimensions, selectedUnitOnly, format );
             }
             else
             {
-                customDataEntryFormCode = dataSetReportService.getCustomDataSetReport( selectedDataSet, selectedPeriod, selectedOrgunit, ouGroups, selectedUnitOnly, format );
+                customDataEntryFormCode = dataSetReportService.getCustomDataSetReport( selectedDataSet, selectedPeriod, selectedOrgunit, dimensions, selectedUnitOnly, format );
             }
         }
         else if ( TYPE_SECTION.equals( dataSetType ) )
         {
-            grids = dataSetReportService.getSectionDataSetReport( selectedDataSet, selectedPeriod, selectedOrgunit, ouGroups, selectedUnitOnly, format, i18n );
+            grids = dataSetReportService.getSectionDataSetReport( selectedDataSet, selectedPeriod, selectedOrgunit, dimensions, selectedUnitOnly, format, i18n );
         }
         else
         {
-            grids = dataSetReportService.getDefaultDataSetReport( selectedDataSet, selectedPeriod, selectedOrgunit, ouGroups, selectedUnitOnly, format, i18n );
+            grids = dataSetReportService.getDefaultDataSetReport( selectedDataSet, selectedPeriod, selectedOrgunit, dimensions, selectedUnitOnly, format, i18n );
         }
         
         return type != null ? type : dataSetType;

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml	2013-08-27 12:32:13 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml	2013-12-24 15:02:47 +0000
@@ -106,7 +106,6 @@
     <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
 	<property name="registrationService" ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
     <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
-    <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
     <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
   </bean>
 

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.js	2013-12-24 13:05:37 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataSetReport.js	2013-12-24 15:02:47 +0000
@@ -19,20 +19,20 @@
         offset: dhis2.dsr.currentPeriodOffset
     };
     
-    var groups = "";
+    var dims = [];
     
     $( "[name='groupSet']" ).each( function( index, value ) {
+    	var dim = $( this ).data( "uid" );
     	var item = $( this ).val();
-    	if ( item )
+    	
+    	if ( dim && item )
     	{
-    		groups += item + ";";
+    		var dimQuery = dim + ":" + item;
+    		dims.push( dimQuery );
     	}
     } );
     
-    if ( groups )
-    {
-    	dataSetReport["groups"] = groups;
-    }
+    dataSetReport.dimension = dims;
     
     return dataSetReport;
 }
@@ -140,7 +140,15 @@
     delete dataSetReport.periodType;
     delete dataSetReport.offset;
     
-    $.get( 'generateDataSetReport.action', dataSetReport, function( data ) {
+    var url = "generateDataSetReport.action?ds=" + dataSetReport.ds +
+    	"&pe=" + dataSetReport.pe + "&ou=" + dataSetReport.ou +
+    	"&selectedUnitOnly=" + dataSetReport.selectedUnitOnly;
+    
+    $.each( dataSetReport.dimension, function( inx, val ) {
+    	url += "&dimension=" + val;
+    } );
+    
+    $.get( url, function( data ) {
     	$( '#content' ).html( data );
     	hideLoader();
     	showContent();