← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16977: PT ER col/row subtotals.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 16977 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-10-07 12:09:53 +0200
message:
  PT ER col/row subtotals.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml
  dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/eventreport/EventReport.hbm.xml
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/i18n/en.properties
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/core.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.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/eventreport/EventReport.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java	2014-09-13 10:41:05 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java	2014-10-07 10:08:29 +0000
@@ -120,9 +120,14 @@
     private boolean colTotals;
 
     /**
-     * Indicates rendering of sub-totals for the table.
-     */
-    private boolean subtotals;
+     * Indicates rendering of row sub-totals for the table.
+     */
+    private boolean rowSubTotals;
+
+    /**
+     * Indicates rendering of column sub-totals for the table.
+     */
+    private boolean colSubTotals;
 
     /**
      * Indicates count type.
@@ -337,16 +342,29 @@
     }
 
     @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    public boolean isSubtotals()
-    {
-        return subtotals;
-    }
-
-    public void setSubtotals( boolean subtotals )
-    {
-        this.subtotals = subtotals;
+    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    public boolean isRowSubTotals()
+    {
+        return rowSubTotals;
+    }
+
+    public void setRowSubTotals( boolean rowSubTotals )
+    {
+        this.rowSubTotals = rowSubTotals;
+    }    
+
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
+    public boolean isColSubTotals()
+    {
+        return colSubTotals;
+    }
+
+    public void setColSubTotals( boolean colSubTotals )
+    {
+        this.colSubTotals = colSubTotals;
     }
 
     @JsonProperty
@@ -443,7 +461,8 @@
             endDate = eventReport.getEndDate();
             rowTotals = eventReport.isRowTotals();
             colTotals = eventReport.isColTotals();
-            subtotals = eventReport.isSubtotals();
+            rowSubTotals = eventReport.isRowSubTotals();
+            colSubTotals = eventReport.isColSubTotals();
             hideEmptyRows = eventReport.isHideEmptyRows();
             countType = eventReport.getCountType();
             showHierarchy = eventReport.isShowHierarchy();

=== 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	2014-10-06 18:46:34 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2014-10-07 10:08:29 +0000
@@ -163,12 +163,12 @@
     /**
      * Indicates rendering of row sub-totals for the table.
      */
-    private boolean rowSubtotals;
+    private boolean rowSubTotals;
 
     /**
      * Indicates rendering of column sub-totals for the table.
      */
-    private boolean colSubtotals;
+    private boolean colSubTotals;
 
     /**
      * Indicates rendering of empty rows for the table.
@@ -912,27 +912,27 @@
     @JsonProperty
     @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
-    public boolean isRowSubtotals()
+    public boolean isRowSubTotals()
     {
-        return rowSubtotals;
+        return rowSubTotals;
     }
 
-    public void setRowSubtotals( boolean rowSubtotals )
+    public void setRowSubTotals( boolean rowSubTotals )
     {
-        this.rowSubtotals = rowSubtotals;
+        this.rowSubTotals = rowSubTotals;
     }    
 
     @JsonProperty
     @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
-    public boolean isColSubtotals()
+    public boolean isColSubTotals()
     {
-        return colSubtotals;
+        return colSubTotals;
     }
 
-    public void setColSubtotals( boolean colSubtotals )
+    public void setColSubTotals( boolean colSubTotals )
     {
-        this.colSubtotals = colSubtotals;
+        this.colSubTotals = colSubTotals;
     }
 
     @JsonProperty
@@ -1093,8 +1093,8 @@
             topLimit = reportTable.getTopLimit();
             rowTotals = reportTable.isRowTotals();
             colTotals = reportTable.isColTotals();
-            rowSubtotals = reportTable.isRowSubtotals();
-            colSubtotals = reportTable.isColSubtotals();
+            rowSubTotals = reportTable.isRowSubTotals();
+            colSubTotals = reportTable.isColSubTotals();
             hideEmptyRows = reportTable.isHideEmptyRows();
             showHierarchy = reportTable.isShowHierarchy();
             aggregationType = reportTable.getAggregationType();

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2014-10-06 18:46:34 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2014-10-07 10:08:29 +0000
@@ -513,6 +513,10 @@
         executeSql( "update eventreport set rowtotals = true where rowtotals is null" );        
         executeSql( "alter table eventreport drop column totals" );
 
+        // eventreport col/row subtotals
+        executeSql( "update eventreport set colsubtotals = subtotals where colsubtotals is null" );
+        executeSql( "update eventreport set rowsubtotals = subtotals where rowsubtotals is null" );
+
         // Move chart filters to chart_filters table
 
         executeSql( "insert into chart_filters (chartid, sort_order, filter) select chartid, 0, filter from chart" );

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml	2014-10-06 18:46:34 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml	2014-10-07 10:08:29 +0000
@@ -155,9 +155,9 @@
 	  
 	<property name="colTotals" />
 
-    <property name="rowSubtotals" />
+    <property name="rowSubTotals" />
 	  
-	<property name="colSubtotals" />
+	<property name="colSubTotals" />
 
     <property name="hideEmptyRows" />
 

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/eventreport/EventReport.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/eventreport/EventReport.hbm.xml	2014-09-09 12:20:09 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/eventreport/EventReport.hbm.xml	2014-10-07 10:08:29 +0000
@@ -116,7 +116,9 @@
 	  
 	<property name="colTotals" />
 
-    <property name="subtotals" />
+    <property name="rowSubTotals" />
+
+    <property name="colSubTotals" />
 
     <property name="hideEmptyRows" />
 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/i18n/en.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/i18n/en.properties	2014-09-16 00:11:41 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/i18n/en.properties	2014-10-07 10:08:29 +0000
@@ -167,3 +167,5 @@
 show_row_totals=Show row totals
 select_sub_units=Select sub-units
 you_do_not_have_access_to_all_items_in_this_favorite=You do not have access to all items in this favorite
+show_col_subtotals=Show column sub-totals
+show_row_subtotals=Show row sub-totals

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js	2014-10-06 20:42:13 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js	2014-10-07 10:08:29 +0000
@@ -1618,9 +1618,10 @@
     AggregateOptionsWindow = function() {
 		var showColTotals,
             showRowTotals,
-			showSubTotals,
+			showColSubTotals,
+            showRowSubTotals,
+			showDimensionLabels,
 			hideEmptyRows,
-			showDimensionLabels,
             limit,
             countType,
             aggregationType,
@@ -1639,6 +1640,7 @@
 			comboboxWidth = 280,
             comboBottomMargin = 1,
             checkboxBottomMargin = 2,
+            separatorTopMargin = 6,
 			window;
 
         showColTotals = Ext.create('Ext.form.field.Checkbox', {
@@ -1653,21 +1655,27 @@
 			checked: true
 		});
 
-		showSubTotals = Ext.create('Ext.form.field.Checkbox', {
-			boxLabel: NS.i18n.show_subtotals,
+		showColSubTotals = Ext.create('Ext.form.field.Checkbox', {
+			boxLabel: NS.i18n.show_col_subtotals,
+			style: 'margin-top:' + separatorTopMargin + 'px; margin-bottom:' + checkboxBottomMargin + 'px',
+			checked: true
+		});
+
+		showRowSubTotals = Ext.create('Ext.form.field.Checkbox', {
+			boxLabel: NS.i18n.show_row_subtotals,
 			style: 'margin-bottom:' + checkboxBottomMargin + 'px',
 			checked: true
 		});
 
+		showDimensionLabels = Ext.create('Ext.form.field.Checkbox', {
+			boxLabel: NS.i18n.show_dimension_labels,
+			style: 'margin-top:' + separatorTopMargin + 'px; margin-bottom:' + comboBottomMargin + 'px',
+			checked: true
+		});
+
 		hideEmptyRows = Ext.create('Ext.form.field.Checkbox', {
 			boxLabel: NS.i18n.hide_empty_rows,
 			style: 'margin-bottom:' + checkboxBottomMargin + 'px',
-            checked: true
-		});
-
-		showDimensionLabels = Ext.create('Ext.form.field.Checkbox', {
-			boxLabel: NS.i18n.show_dimension_labels,
-			style: 'margin-bottom:' + checkboxBottomMargin + 'px',
 		});
 
         limit = Ext.create('Ext.ux.container.LimitContainer', {
@@ -1675,7 +1683,8 @@
             sortOrder: 1,
             topLimit: 10,
             comboboxWidth: comboboxWidth,
-            comboBottomMargin: comboBottomMargin
+            comboBottomMargin: comboBottomMargin,
+            style: 'margin-top:' + separatorTopMargin + 'px'
         });
 
         countType = Ext.create('Ext.form.field.ComboBox', {
@@ -1770,11 +1779,12 @@
 			bodyStyle: 'border:0 none',
 			style: 'margin-left:14px',
 			items: [
-				showColTotals,
-                showRowTotals,
-				showSubTotals,
+                showColTotals,
+				showRowTotals,
+				showColSubTotals,
+                showRowSubTotals,
+                showDimensionLabels,
 				hideEmptyRows,
-                showDimensionLabels,
                 limit,
                 countType
                 //aggregationType
@@ -1802,7 +1812,7 @@
 
 		window = Ext.create('Ext.window.Window', {
 			title: NS.i18n.table_options,
-			bodyStyle: 'background-color:#fff; padding:3px',
+			bodyStyle: 'background-color:#fff; padding:2px',
 			closeAction: 'hide',
 			autoShow: true,
 			modal: true,
@@ -1810,9 +1820,11 @@
 			hideOnBlur: true,
 			getOptions: function() {
 				return {
-					showColTotals: showColTotals.getValue(),
 					showRowTotals: showRowTotals.getValue(),
-					showSubTotals: showSubTotals.getValue(),
+                    showColTotals: showColTotals.getValue(),
+					showColSubTotals: showColSubTotals.getValue(),
+                    showRowSubTotals: showRowSubTotals.getValue(),
+                    showDimensionLabels: showDimensionLabels.getValue(),
 					hideEmptyRows: hideEmptyRows.getValue(),
                     sortOrder: limit.getSortOrder(),
                     topLimit: limit.getTopLimit(),
@@ -1826,15 +1838,16 @@
 				};
 			},
 			setOptions: function(layout) {
+				showRowTotals.setValue(Ext.isBoolean(layout.showRowTotals) ? layout.showRowTotals : true);
 				showColTotals.setValue(Ext.isBoolean(layout.showColTotals) ? layout.showColTotals : true);
-				showRowTotals.setValue(Ext.isBoolean(layout.showRowTotals) ? layout.showRowTotals : true);
-				showSubTotals.setValue(Ext.isBoolean(layout.showSubTotals) ? layout.showSubTotals : true);
+				showColSubTotals.setValue(Ext.isBoolean(layout.showColSubTotals) ? layout.showColSubTotals : true);
+				showRowSubTotals.setValue(Ext.isBoolean(layout.showRowSubTotals) ? layout.showRowSubTotals : true);
+				showDimensionLabels.setValue(Ext.isBoolean(layout.showDimensionLabels) ? layout.showDimensionLabels : true);
 				hideEmptyRows.setValue(Ext.isBoolean(layout.hideEmptyRows) ? layout.hideEmptyRows : false);
 				limit.setValues(layout.sortOrder, layout.topLimit);
 				countType.setValue(Ext.isString(layout.countType) ? layout.countType : 'events');
                 //aggregationType.setValue(Ext.isString(layout.aggregationType) ? layout.aggregationType : 'default');
 				showHierarchy.setValue(Ext.isBoolean(layout.showHierarchy) ? layout.showHierarchy : false);
-				showDimensionLabels.setValue(Ext.isBoolean(layout.showDimensionLabels) ? layout.showDimensionLabels : true);
 				displayDensity.setValue(Ext.isString(layout.displayDensity) ? layout.displayDensity : 'normal');
 				fontSize.setValue(Ext.isString(layout.fontSize) ? layout.fontSize : 'normal');
 				digitGroupSeparator.setValue(Ext.isString(layout.digitGroupSeparator) ? layout.digitGroupSeparator : 'space');
@@ -1850,7 +1863,7 @@
 			items: [
 				{
 					bodyStyle: 'border:0 none; color:#222; font-size:12px; font-weight:bold',
-					style: 'margin-top:2px; margin-bottom:6px; margin-left:3px',
+					style: 'margin-top:4px; margin-bottom:6px; margin-left:5px',
 					html: NS.i18n.data
 				},
 				data,
@@ -1859,7 +1872,7 @@
 				},
 				{
 					bodyStyle: 'border:0 none; color:#222; font-size:12px; font-weight:bold',
-					style: 'margin-bottom:6px; margin-left:3px',
+					style: 'margin-bottom:6px; margin-left:5px',
 					html: NS.i18n.organisation_units
 				},
 				organisationUnits,
@@ -1868,7 +1881,7 @@
 				},
 				{
 					bodyStyle: 'border:0 none; color:#222; font-size:12px; font-weight:bold',
-					style: 'margin-bottom:6px; margin-left:3px',
+					style: 'margin-bottom:6px; margin-left:5px',
 					html: NS.i18n.style
 				},
 				style
@@ -1912,14 +1925,15 @@
 					//}
 
 					// cmp
-					w.showColTotals = showColTotals;
+                    w.showColTotals = showColTotals;
 					w.showRowTotals = showRowTotals;
-					w.showSubTotals = showSubTotals;
+					w.showColSubTotals = showColSubTotals
+					w.showRowSubTotals = showRowSubTotals;
+                    w.showDimensionLabels = showDimensionLabels;
 					w.hideEmptyRows = hideEmptyRows;
                     w.limit = limit;
 					w.countType = countType;
 					w.showHierarchy = showHierarchy;
-                    w.showDimensionLabels = showDimensionLabels;
 					w.displayDensity = displayDensity;
 					w.fontSize = fontSize;
 					w.digitGroupSeparator = digitGroupSeparator;
@@ -2215,8 +2229,11 @@
 				favorite.colTotals = favorite.showColTotals;
 				delete favorite.showColTotals;
 
-				favorite.subtotals = favorite.showSubTotals;
-				delete favorite.showSubTotals;
+				favorite.rowSubTotals = favorite.showRowSubTotals;
+				delete favorite.showRowSubTotals;
+
+				favorite.colSubTotals = favorite.showColSubTotals;
+				delete favorite.showColSubTotals;
 
 				delete favorite.type;
 				delete favorite.parentGraphMap;
@@ -6220,8 +6237,11 @@
 						config.showColTotals = config.colTotals;
 						delete config.colTotals;
 
-						config.showSubTotals = config.subtotals;
-						delete config.subtotals;
+						config.showColSubTotals = config.colSubTotals;
+						delete config.colSubTotals;
+
+						config.showRowSubTotals = config.rowSubTotals;
+						delete config.rowSubTotals;
 
 						if (config.startDate) {
 							config.startDate = config.startDate.substr(0,10);

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/core.js	2014-09-29 10:46:24 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/core.js	2014-10-07 10:08:29 +0000
@@ -300,7 +300,11 @@
 
 				// showColTotals: boolean (true)
 
-				// showSubTotals: boolean (true)
+				// showColSubTotals: boolean (true)
+
+				// showRowSubTotals: boolean (true)
+
+                // showDimensionLabels: boolean (false)
 
 				// hideEmptyRows: boolean (false)
 
@@ -310,8 +314,6 @@
 
 				// showHierarchy: boolean (false)
 
-                // showDimensionLabels: boolean (false)
-
 				// displayDensity: string ('normal') - 'compact', 'normal', 'comfortable'
 
 				// fontSize: string ('normal') - 'small', 'normal', 'large'
@@ -479,16 +481,17 @@
                     }
 
 					// properties
+					layout.showColTotals = Ext.isBoolean(config.colTotals) ? config.colTotals : (Ext.isBoolean(config.showColTotals) ? config.showColTotals : true);
 					layout.showRowTotals = Ext.isBoolean(config.rowTotals) ? config.rowTotals : (Ext.isBoolean(config.showRowTotals) ? config.showRowTotals : true);
-					layout.showColTotals = Ext.isBoolean(config.colTotals) ? config.colTotals : (Ext.isBoolean(config.showColTotals) ? config.showColTotals : true);
-					layout.showSubTotals = Ext.isBoolean(config.subtotals) ? config.subtotals : (Ext.isBoolean(config.showSubTotals) ? config.showSubTotals : true);
+					layout.showColSubTotals = Ext.isBoolean(config.colSubTotals) ? config.colSubTotals : (Ext.isBoolean(config.showColSubTotals) ? config.showColSubTotals : true);
+					layout.showRowSubTotals = Ext.isBoolean(config.rowSubTotals) ? config.rowSubTotals : (Ext.isBoolean(config.showRowSubTotals) ? config.showRowSubTotals : true);
+					layout.showDimensionLabels = Ext.isBoolean(config.showDimensionLabels) ? config.showDimensionLabels : (Ext.isBoolean(config.showDimensionLabels) ? config.showDimensionLabels : true);
 					layout.hideEmptyRows = Ext.isBoolean(config.hideEmptyRows) ? config.hideEmptyRows : false;
 					layout.countType = Ext.isString(config.countType) && !Ext.isEmpty(config.countType) ? config.countType : 'events';
                     layout.aggregationType = Ext.isString(config.aggregationType) ? config.aggregationType : 'default';
 
 					layout.showHierarchy = Ext.isBoolean(config.showHierarchy) ? config.showHierarchy : false;
 
-					layout.showDimensionLabels = Ext.isBoolean(config.showDimensionLabels) ? config.showDimensionLabels : (Ext.isBoolean(config.showDimensionLabels) ? config.showDimensionLabels : true);
 					layout.displayDensity = Ext.isString(config.displayDensity) && !Ext.isEmpty(config.displayDensity) ? config.displayDensity : 'normal';
 					layout.fontSize = Ext.isString(config.fontSize) && !Ext.isEmpty(config.fontSize) ? config.fontSize : 'normal';
 					layout.digitGroupSeparator = Ext.isString(config.digitGroupSeparator) && !Ext.isEmpty(config.digitGroupSeparator) ? config.digitGroupSeparator : 'space';
@@ -1163,7 +1166,7 @@
 				};
 
 				return function() {
-                    
+
 					// items
 					for (var i = 0, dim, header; i < dimensions.length; i++) {
 						dim = dimensions[i];
@@ -1203,7 +1206,7 @@
 
                                     if (dim.dimension === orgDim.dimension && dim.items && dim.items.length) {
                                         var items = [];
-                                        
+
                                         for (var k = 0, option; k < options.length; k++) {
                                             option = options[k];
 
@@ -2108,7 +2111,7 @@
 					htmlArray;
 
 				xResponse.sortableIdObjects = [];
-                
+
 				getRoundedHtmlValue = function(value, dec) {
 					dec = dec || 2;
 					return parseFloat(support.prototype.number.roundIf(value, 2)).toString();
@@ -2205,10 +2208,6 @@
 					return html;
 				};
 
-				doSubTotals = function(xAxis) {
-					return !!xLayout.showSubTotals && xAxis && xAxis.dims > 1;
-				};
-
 				doRowTotals = function() {
 					return !!xLayout.showRowTotals;
 				};
@@ -2217,6 +2216,14 @@
 					return !!xLayout.showColTotals;
 				};
 
+				doColSubTotals = function() {
+					return !!xLayout.showColSubTotals && xRowAxis && xRowAxis.dims > 1;
+				};
+
+				doRowSubTotals = function() {
+					return !!xLayout.showRowSubTotals && xColAxis && xColAxis.dims > 1;
+				};
+
 				doSortableColumnHeaders = function() {
 					return (xRowAxis && xRowAxis.dims === 1);
 				};
@@ -2254,7 +2261,7 @@
                             }));
                         }
                         else {
-                            if (xRowAxis && xRowAxis.dims) {                                
+                            if (xRowAxis && xRowAxis.dims) {
                                 for (var j = 0; j < xRowAxis.dims - 1; j++) {
                                     a.push(getEmptyNameTdConfig({
                                         cls: 'pivot-dim-label',
@@ -2265,7 +2272,7 @@
 
                             a.push(getEmptyNameTdConfig({
                                 cls: 'pivot-dim-label',
-                                htmlValue: dimConf.objectNameMap[xLayout.rowObjectNames[j]].name + ', ' + dimConf.objectNameMap[xLayout.columnObjectNames[i]].name
+                                htmlValue: dimConf.objectNameMap[xLayout.rowObjectNames[j]].name + ' / ' + dimConf.objectNameMap[xLayout.columnObjectNames[i]].name
                             }));
                         }
 
@@ -2310,7 +2317,7 @@
 
 							dimHtml.push(getTdHtml(obj, condoId));
 
-							if (i === 0 && spanCount === xColAxis.span[i] && doSubTotals(xColAxis) ) {
+							if (i === 0 && spanCount === xColAxis.span[i] && doRowSubTotals() ) {
 								dimHtml.push(getTdHtml({
 									type: 'dimensionSubtotal',
 									cls: 'pivot-dim-subtotal cursor-default',
@@ -2526,7 +2533,7 @@
 					xValueObjects = valueObjects;
 
 					// col subtotals
-					if (doSubTotals(xColAxis)) {
+					if (doRowSubTotals()) {
 						var tmpValueObjects = [];
 
 						for (var i = 0, row, rowSubTotal, colCount; i < xValueObjects.length; i++) {
@@ -2568,7 +2575,7 @@
 					}
 
 					// row subtotals
-					if (doSubTotals(xRowAxis)) {
+					if (doColSubTotals()) {
 						var tmpAxisAllObjects = [],
 							tmpValueObjects = [],
 							tmpTotalValueObjects = [],
@@ -2739,7 +2746,7 @@
 
 						xTotalColObjects = totalColObjects;
 
-						if (xColAxis && doSubTotals(xColAxis)) {
+						if (xColAxis && doRowSubTotals()) {
 							var tmp = [];
 
 							for (var i = 0, item, subTotal = 0, empty = [], colCount = 0; i < xTotalColObjects.length; i++) {
@@ -2867,7 +2874,7 @@
 
 			web.report.query.format = function(str) {
 				var n = parseFloat(str);
-                
+
                 // return string if
                 // - parsefloat(string) is not a number
                 // - string is just starting with a number
@@ -2887,14 +2894,14 @@
                     count = pager.page * pager.pageSize - pager.pageSize
 					tableCls = 'pivot',
 					html = '';
-                    
+
 				xResponse.sortableIdObjects = [];
 
 				tableCls += layout.displayDensity ? ' ' + layout.displayDensity : '';
 				tableCls += layout.fontSize ? ' ' + layout.fontSize : '';
 
 				html += '<table class="' + tableCls + '"><tr>';
-                html += '<td class="pivot-dim pivot-dim-subtotal">' + '#' + '</td>';                
+                html += '<td class="pivot-dim pivot-dim-subtotal">' + '#' + '</td>';
 
 				// get header indexes
 				for (var i = 0, header, uuid; i < dimensionHeaders.length; i++) {
@@ -2915,7 +2922,7 @@
 				for (var i = 0, row; i < rows.length; i++) {
 					row = rows[i];
 					html += '<tr>';
-                    html += '<td class="pivot-value align-right">' + (count + (i + 1)) + '</td>';                    
+                    html += '<td class="pivot-value align-right">' + (count + (i + 1)) + '</td>';
 
 					for (var j = 0, str, header, name; j < dimensionHeaders.length; j++) {
 						header = dimensionHeaders[j];

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2014-10-06 20:42:13 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2014-10-07 10:08:29 +0000
@@ -956,6 +956,12 @@
                 favorite.colTotals = favorite.showColTotals;
 				delete favorite.showColTotals;
 
+				favorite.rowSubTotals = favorite.showRowSubTotals;
+				delete favorite.showRowSubTotals;
+
+				favorite.colSubTotals = favorite.showColSubTotals;
+				delete favorite.showColSubTotals;
+
 				favorite.reportParams = {
 					paramReportingPeriod: favorite.reportingPeriod,
 					paramOrganisationUnit: favorite.organisationUnit,

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js	2014-10-06 18:46:34 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js	2014-10-07 10:08:29 +0000
@@ -481,8 +481,8 @@
 					// properties
 					layout.showColTotals = Ext.isBoolean(config.colTotals) ? config.colTotals : (Ext.isBoolean(config.showColTotals) ? config.showColTotals : true);
 					layout.showRowTotals = Ext.isBoolean(config.rowTotals) ? config.rowTotals : (Ext.isBoolean(config.showRowTotals) ? config.showRowTotals : true);
-					layout.showColSubTotals = Ext.isBoolean(config.subtotals) ? config.subtotals : (Ext.isBoolean(config.showColSubTotals) ? config.showColSubTotals : true);
-					layout.showRowSubTotals = Ext.isBoolean(config.subtotals) ? config.subtotals : (Ext.isBoolean(config.showRowSubTotals) ? config.showRowSubTotals : true);
+					layout.showColSubTotals = Ext.isBoolean(config.colSubTotals) ? config.colSubTotals : (Ext.isBoolean(config.showColSubTotals) ? config.showColSubTotals : true);
+					layout.showRowSubTotals = Ext.isBoolean(config.rowSubTotals) ? config.rowSubTotals : (Ext.isBoolean(config.showRowSubTotals) ? config.showRowSubTotals : true);
 					layout.showDimensionLabels = Ext.isBoolean(config.showDimensionLabels) ? config.showDimensionLabels : (Ext.isBoolean(config.showDimensionLabels) ? config.showDimensionLabels : true);
 					layout.hideEmptyRows = Ext.isBoolean(config.hideEmptyRows) ? config.hideEmptyRows : false;
                     layout.aggregationType = Ext.isString(config.aggregationType) ? config.aggregationType : 'default';
@@ -2190,6 +2190,14 @@
 					return html;
 				};
 
+                doColTotals = function() {
+					return !!xLayout.showColTotals;
+				};
+
+				doRowTotals = function() {
+					return !!xLayout.showRowTotals;
+				};
+
 				doColSubTotals = function() {
 					return !!xLayout.showColSubTotals && xRowAxis && xRowAxis.dims > 1;
 				};
@@ -2198,14 +2206,6 @@
 					return !!xLayout.showRowSubTotals && xColAxis && xColAxis.dims > 1;
 				};
 
-                doColTotals = function() {
-					return !!xLayout.showColTotals;
-				};
-
-				doRowTotals = function() {
-					return !!xLayout.showRowTotals;
-				};
-
 				doSortableColumnHeaders = function() {
 					return (xRowAxis && xRowAxis.dims === 1);
 				};