← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3853: WIP: data element charts, still has some minor bugs..

 

------------------------------------------------------------
revno: 3853
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-06-07 18:12:23 +0200
message:
  WIP: data element charts, still has some minor bugs.. 
added:
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementModeForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementOrgunitOrPeriodForm.vm
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml
  dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/lists.js
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GenerateChartAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.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/resources/org/hisp/dhis/reporting/i18n_module.properties
  dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm


--
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/chart/Chart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2011-06-01 08:57:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2011-06-07 16:12:23 +0000
@@ -32,6 +32,7 @@
 import java.util.List;
 
 import org.hisp.dhis.common.ImportableObject;
+import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -47,11 +48,17 @@
 {
     private static final long serialVersionUID = 2570074075484545534L;
 
-    public static final String DIMENSION_PERIOD = "period";
-
-    public static final String DIMENSION_ORGANISATIONUNIT = "organisationUnit";
-
-    public static final String DIMENSION_INDICATOR = "indicator";
+    public static final String DIMENSION_PERIOD_INDICATOR = "period";
+
+    public static final String DIMENSION_ORGANISATIONUNIT_INDICATOR = "organisationUnit";
+
+    public static final String DIMENSION_INDICATOR_PERIOD = "indicator";
+
+    public static final String DIMENSION_PERIOD_DATAELEMENT = "period_dataElement";
+
+    public static final String DIMENSION_ORGANISATIONUNIT_DATAELEMENT = "organisationUnit_dataElement";
+
+    public static final String DIMENSION_DATAELEMENT_PERIOD = "dataElement_period";
 
     public static final String TYPE_BAR = "bar";
 
@@ -97,6 +104,8 @@
 
     private List<Indicator> indicators = new ArrayList<Indicator>();
 
+    private List<DataElement> dataElements = new ArrayList<DataElement>();
+
     private List<Period> periods = new ArrayList<Period>();
 
     private List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>();
@@ -395,6 +404,16 @@
         this.indicators = indicators;
     }
 
+    public void setDataElements( List<DataElement> dataElements )
+    {
+        this.dataElements = dataElements;
+    }
+
+    public List<DataElement> getDataElements()
+    {
+        return dataElements;
+    }
+
     public List<Period> getPeriods()
     {
         return periods;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java	2010-12-14 05:15:06 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java	2011-06-07 16:12:23 +0000
@@ -43,43 +43,42 @@
 
 /**
  * @author Lars Helge Overland
- * @version $Id$
  */
 public interface ChartService
 {
     String ID = ChartService.class.getName();
-    
+
     JFreeChart getJFreeChart( int id, I18nFormat format );
-    
-    JFreeChart getJFreeChart( List<Indicator> indicators, List<Period> periods, 
+
+    JFreeChart getJFreeChart( List<Indicator> indicators, List<DataElement> dataElements, List<Period> periods,
         List<OrganisationUnit> organisationUnits, String dimension, boolean regression, I18nFormat format );
-    
-    JFreeChart getJFreeChart( String title, PlotOrientation orientation, 
-        CategoryLabelPositions labelPositions, Map<String, Double> categoryValues );
-    
+
+    JFreeChart getJFreeChart( String title, PlotOrientation orientation, CategoryLabelPositions labelPositions,
+        Map<String, Double> categoryValues );
+
     JFreeChart getJFreeChartHistory( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo,
         Period lastPeriod, OrganisationUnit organisationUnit, int historyLength, I18nFormat format );
-    
+
     int saveChart( Chart chart );
 
     void saveOrUpdate( Chart chart );
-    
+
     Chart getChart( int id );
-    
+
     void deleteChart( Chart chart );
-    
+
     Collection<Chart> getAllCharts();
-    
+
     Chart getChartByTitle( String name );
-    
+
     Collection<Chart> getCharts( final Collection<Integer> identifiers );
-    
+
     Collection<Chart> getChartsBetween( int first, int max );
-    
+
     Collection<Chart> getChartsBetweenByName( String name, int first, int max );
-    
+
     int getChartCount();
-    
+
     int getChartCountByName( String name );
 
 }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-06-01 08:57:39 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-06-07 16:12:23 +0000
@@ -27,9 +27,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.hisp.dhis.chart.Chart.DIMENSION_INDICATOR;
-import static org.hisp.dhis.chart.Chart.DIMENSION_ORGANISATIONUNIT;
-import static org.hisp.dhis.chart.Chart.DIMENSION_PERIOD;
+import static org.hisp.dhis.chart.Chart.DIMENSION_INDICATOR_PERIOD;
+import static org.hisp.dhis.chart.Chart.DIMENSION_ORGANISATIONUNIT_INDICATOR;
+import static org.hisp.dhis.chart.Chart.DIMENSION_PERIOD_INDICATOR;
+import static org.hisp.dhis.chart.Chart.DIMENSION_DATAELEMENT_PERIOD;
+import static org.hisp.dhis.chart.Chart.DIMENSION_ORGANISATIONUNIT_DATAELEMENT;
+import static org.hisp.dhis.chart.Chart.DIMENSION_PERIOD_DATAELEMENT;
 import static org.hisp.dhis.chart.Chart.SIZE_NORMAL;
 import static org.hisp.dhis.chart.Chart.TYPE_BAR;
 import static org.hisp.dhis.chart.Chart.TYPE_BAR3D;
@@ -61,6 +64,7 @@
 import org.hisp.dhis.chart.Chart;
 import org.hisp.dhis.chart.ChartService;
 import org.hisp.dhis.chart.ChartStore;
+import org.hisp.dhis.common.NameableObject;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.datavalue.DataValue;
@@ -218,11 +222,20 @@
         return getJFreeChart( chart, true );
     }
 
-    public JFreeChart getJFreeChart( List<Indicator> indicators, List<Period> periods,
+    public JFreeChart getJFreeChart( List<Indicator> indicators, List<DataElement> dataElements, List<Period> periods,
         List<OrganisationUnit> organisationUnits, String dimension, boolean regression, I18nFormat format )
     {
         Chart chart = new Chart();
-        chart.setTitle( getTitle( indicators, periods, organisationUnits, format ) );
+
+        if ( indicators != null && indicators.size() > 0 )
+        {
+            chart.setTitle( getTitle( indicators.get( 0 ), periods, organisationUnits, format ) );
+        }
+        else if ( dataElements != null && dataElements.size() > 0 )
+        {
+            chart.setTitle( getTitle( dataElements.get( 0 ), periods, organisationUnits, format ) );
+        }
+
         chart.setType( TYPE_BAR );
         chart.setSize( SIZE_NORMAL );
         chart.setDimension( dimension );
@@ -231,6 +244,7 @@
         chart.setHorizontalPlotOrientation( false );
         chart.setRegression( regression );
         chart.setIndicators( indicators );
+        chart.setDataElements( dataElements );
         chart.setPeriods( periods );
         chart.setOrganisationUnits( organisationUnits );
         chart.setFormat( format );
@@ -528,7 +542,7 @@
 
             for ( int i = 0; i < dataSets[0].getColumnCount(); i++ )
             {
-                piePlot.setSectionPaint( dataSets[0].getColumnKey( i ), colors[ ( i % colors.length ) ] );
+                piePlot.setSectionPaint( dataSets[0].getColumnKey( i ), colors[(i % colors.length)] );
             }
 
             return multiplePieChart;
@@ -553,7 +567,7 @@
 
             plot.addRangeMarker( marker );
         }
-        
+
         if ( subTitle )
         {
             jFreeChart.addSubtitle( getSubTitle( chart, chart.getFormat() ) );
@@ -601,13 +615,37 @@
             Period selectedPeriod = chart.getAllPeriods().get( 0 );
             OrganisationUnit selectedOrganisationUnit = chart.getAllOrganisationUnits().get( 0 );
 
-            for ( Indicator indicator : chart.getIndicators() )
+            List<Indicator> indicators = chart.getIndicators();
+            List<DataElement> dataElements = chart.getDataElements();
+
+            boolean isIndicatorChart = chart.isDimension( DIMENSION_INDICATOR_PERIOD )
+                || chart.isDimension( DIMENSION_ORGANISATIONUNIT_INDICATOR )
+                || chart.isDimension( DIMENSION_PERIOD_INDICATOR );
+
+            boolean isDataElementChart = !isIndicatorChart;
+
+            int loopSize = isIndicatorChart ? indicators.size() : dataElements.size();
+
+            for ( int i = 0; i < loopSize; i++ )
             {
                 final SimpleRegression regression = new SimpleRegression();
 
                 int columnIndex = 0;
 
-                if ( chart.isDimension( DIMENSION_PERIOD ) || chart.isDimension( DIMENSION_INDICATOR ) )
+                String shortName = null;
+
+                if ( isIndicatorChart )
+                {
+                    shortName = indicators.get( i ).getShortName();
+                }
+                else if ( isDataElementChart )
+                {
+                    shortName = dataElements.get( i ).getShortName();
+                }
+
+                if ( chart.isDimension( DIMENSION_PERIOD_INDICATOR ) || chart.isDimension( DIMENSION_INDICATOR_PERIOD )
+                    || chart.isDimension( DIMENSION_PERIOD_DATAELEMENT )
+                    || chart.isDimension( DIMENSION_DATAELEMENT_PERIOD ) )
                 {
                     // ---------------------------------------------------------
                     // Regular dataset
@@ -615,21 +653,35 @@
 
                     for ( Period period : chart.getAllPeriods() )
                     {
-                        final Double value = aggregationStrategy.equals( AGGREGATION_STRATEGY_REAL_TIME ) ? aggregationService
-                            .getAggregatedIndicatorValue( indicator, period.getStartDate(), period.getEndDate(),
-                                selectedOrganisationUnit ) : aggregatedDataValueService.getAggregatedValue( indicator,
-                            period, selectedOrganisationUnit );
-
-                        if ( chart.isDimension( DIMENSION_PERIOD ) )
-                        {
-                            regularDataSet.addValue( value != null ? value : 0, indicator.getShortName(), chart
-                                .getFormat().formatPeriod( period ) );
+                        Double value = null;
+
+                        if ( isIndicatorChart )
+                        {
+                            value = aggregationStrategy.equals( AGGREGATION_STRATEGY_REAL_TIME ) ? aggregationService
+                                .getAggregatedIndicatorValue( indicators.get( i ), period.getStartDate(),
+                                    period.getEndDate(), selectedOrganisationUnit ) : aggregatedDataValueService
+                                .getAggregatedValue( indicators.get( i ), period, selectedOrganisationUnit );
+                        }
+                        else if ( isDataElementChart )
+                        {
+                            value = aggregationStrategy.equals( AGGREGATION_STRATEGY_REAL_TIME ) ? aggregationService
+                                .getAggregatedDataValue( dataElements.get( i ), null, period.getStartDate(),
+                                    period.getEndDate(), selectedOrganisationUnit ) : aggregatedDataValueService
+                                .getAggregatedValue( dataElements.get( i ), period, selectedOrganisationUnit );
+                        }
+
+                        if ( chart.isDimension( DIMENSION_PERIOD_INDICATOR )
+                            || chart.isDimension( DIMENSION_PERIOD_DATAELEMENT ) )
+                        {
+                            regularDataSet.addValue( value != null ? value : 0, shortName, chart.getFormat()
+                                .formatPeriod( period ) );
                         }
                         else
                         {
                             regularDataSet.addValue( value != null ? value : 0,
-                                chart.getFormat().formatPeriod( period ), indicator.getShortName() );
+                                chart.getFormat().formatPeriod( period ), shortName );
                         }
+
                         columnIndex++;
 
                         // Omit missing values and 0 from regression
@@ -656,14 +708,15 @@
 
                             if ( !Double.isNaN( value ) )
                             {
-                                regressionDataSet.addValue( value, TREND_PREFIX + indicator.getShortName(), chart
-                                    .getFormat().formatPeriod( period ) );
+                                regressionDataSet.addValue( value, TREND_PREFIX + shortName, chart.getFormat()
+                                    .formatPeriod( period ) );
 
                             }
                         }
                     }
                 }
-                else if ( chart.isDimension( DIMENSION_ORGANISATIONUNIT ) )
+                else if ( chart.isDimension( DIMENSION_ORGANISATIONUNIT_INDICATOR )
+                    || chart.isDimension( DIMENSION_ORGANISATIONUNIT_DATAELEMENT ) )
                 {
                     // ---------------------------------------------------------
                     // Regular dataset
@@ -671,13 +724,24 @@
 
                     for ( OrganisationUnit unit : chart.getAllOrganisationUnits() )
                     {
-                        final Double value = aggregationStrategy.equals( AGGREGATION_STRATEGY_REAL_TIME ) ? aggregationService
-                            .getAggregatedIndicatorValue( indicator, selectedPeriod.getStartDate(),
-                                selectedPeriod.getEndDate(), unit ) : aggregatedDataValueService.getAggregatedValue(
-                            indicator, selectedPeriod, unit );
-
-                        regularDataSet.addValue( value != null ? value : 0, indicator.getShortName(),
-                            unit.getShortName() );
+                        Double value = null;
+
+                        if ( isIndicatorChart )
+                        {
+                            value = aggregationStrategy.equals( AGGREGATION_STRATEGY_REAL_TIME ) ? aggregationService
+                                .getAggregatedIndicatorValue( indicators.get( i ), selectedPeriod.getStartDate(),
+                                    selectedPeriod.getEndDate(), unit ) : aggregatedDataValueService
+                                .getAggregatedValue( indicators.get( i ), selectedPeriod, unit );
+                        }
+                        else if ( isDataElementChart )
+                        {
+                            value = aggregationStrategy.equals( AGGREGATION_STRATEGY_REAL_TIME ) ? aggregationService
+                                .getAggregatedDataValue( dataElements.get( i ), null, selectedPeriod.getStartDate(),
+                                    selectedPeriod.getEndDate(), unit ) : aggregatedDataValueService
+                                .getAggregatedValue( dataElements.get( i ), selectedPeriod, unit );
+                        }
+
+                        regularDataSet.addValue( value != null ? value : 0, shortName, unit.getShortName() );
 
                         columnIndex++;
                     }
@@ -694,22 +758,22 @@
     /**
      * Returns a title based on the chart meta data.
      */
-    private String getTitle( List<Indicator> indicators, List<Period> periods,
+    private String getTitle( NameableObject nameableObject, List<Period> periods,
         List<OrganisationUnit> organisationUnits, I18nFormat format )
     {
         String title = "";
 
-        if ( indicators != null && indicators.size() == 1 )
+        if ( nameableObject != null )
         {
-            title += indicators.get( 0 ).getShortName() + TITLE_SEPARATOR;
+            title += nameableObject.getShortName() + TITLE_SEPARATOR;
         }
 
-        if ( periods != null && periods.size() == 1 )
+        if ( periods != null && periods.size() > 0 )
         {
             title += format.formatPeriod( periods.get( 0 ) ) + TITLE_SEPARATOR;
         }
 
-        if ( organisationUnits != null && organisationUnits.size() == 1 )
+        if ( organisationUnits != null && organisationUnits.size() > 0 )
         {
             title += organisationUnits.get( 0 ).getShortName() + TITLE_SEPARATOR;
         }
@@ -735,15 +799,15 @@
 
         subTitle.setFont( subTitleFont );
 
-        if ( chart.isDimension( DIMENSION_PERIOD ) && chart.getAllOrganisationUnits().size() > 0 )
+        if ( chart.isDimension( DIMENSION_PERIOD_INDICATOR ) && chart.getAllOrganisationUnits().size() > 0 )
         {
             subTitle.setText( chart.getAllOrganisationUnits().get( 0 ).getName() );
         }
-        else if ( chart.isDimension( DIMENSION_ORGANISATIONUNIT ) && chart.getAllPeriods().size() > 0 )
+        else if ( chart.isDimension( DIMENSION_ORGANISATIONUNIT_INDICATOR ) && chart.getAllPeriods().size() > 0 )
         {
             subTitle.setText( format.formatPeriod( chart.getAllPeriods().get( 0 ) ) );
         }
-        else if ( chart.isDimension( DIMENSION_INDICATOR ) && chart.getIndicators().size() > 0 )
+        else if ( chart.isDimension( DIMENSION_INDICATOR_PERIOD ) && chart.getIndicators().size() > 0 )
         {
             subTitle.setText( chart.getAllOrganisationUnits().get( 0 ).getName() );
         }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml	2011-05-28 21:25:46 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml	2011-06-07 16:12:23 +0000
@@ -41,6 +41,13 @@
       <many-to-many column="indicatorid" class="org.hisp.dhis.indicator.Indicator" foreign-key="fk_chart_indicators_indicatorid" />
     </list>
 
+    <list name="dataElements" table="chart_dataelements">
+      <cache usage="read-write" />
+      <key column="chartid" foreign-key="fk_chart_dataelements_chartid" />
+      <list-index column="sort_order" base="0" />
+      <many-to-many column="dataelementid" class="org.hisp.dhis.dataelement.DataElement" foreign-key="fk_chart_dataelements_dataelementid" />
+    </list>
+
     <list name="periods" table="chart_periods">
       <cache usage="read-write" />
       <key column="chartid" foreign-key="fk_chart_periods_chartid" />
@@ -52,7 +59,8 @@
       <cache usage="read-write" />
       <key column="chartid" foreign-key="fk_chart_organisationunits_chartid" />
       <list-index column="sort_order" base="0" />
-      <many-to-many column="organisationunitid" class="org.hisp.dhis.organisationunit.OrganisationUnit" foreign-key="fk_chart_organisationunits_organisationunitid" />
+      <many-to-many column="organisationunitid" class="org.hisp.dhis.organisationunit.OrganisationUnit"
+        foreign-key="fk_chart_organisationunits_organisationunitid" />
     </list>
 
     <component name="relatives">

=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java	2011-06-03 13:11:34 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java	2011-06-07 16:12:23 +0000
@@ -815,7 +815,7 @@
         Chart chart = new Chart();
 
         chart.setTitle( "Chart" + uniqueCharacter );
-        chart.setDimension( Chart.DIMENSION_PERIOD );
+        chart.setDimension( Chart.DIMENSION_PERIOD_INDICATOR );
         chart.setIndicators( indicators );
         chart.setPeriods( periods );
         chart.setOrganisationUnits( units );

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/lists.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/lists.js	2011-04-11 16:43:51 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/lists.js	2011-06-07 16:12:23 +0000
@@ -125,8 +125,7 @@
  * @param listId the id of the list.
  */
 function selectAllById( listId ) {
-    var list = document.getElementById( listId );
-    selectAll( list );
+    $('#' + listId).find('option').attr('selected', true);
 }
 
 /**
@@ -134,9 +133,7 @@
  * @param list the list.
  */
 function selectAll( list ) {
-    for ( var i = 0; i < list.options.length; i++ ) {
-        list.options[i].selected = true;
-    }
+    $(list).find('option').attr('selected', true);
 }
 
 /**

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GenerateChartAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GenerateChartAction.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GenerateChartAction.java	2011-06-07 16:12:23 +0000
@@ -27,10 +27,14 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.system.util.ConversionUtils.getIntegerCollection;
+
 import java.util.ArrayList;
 import java.util.List;
 
 import org.hisp.dhis.chart.ChartService;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorService;
@@ -46,7 +50,6 @@
  * Known usage of this class is the pivot table chart functionality.
  * 
  * @author Lars Helge Overland
- * @version $Id$
  */
 public class GenerateChartAction
     implements Action
@@ -68,7 +71,14 @@
     {
         this.indicatorService = indicatorService;
     }
-    
+
+    private DataElementService dataElementService;
+
+    public void setDataElementService( DataElementService dataElementService )
+    {
+        this.dataElementService = dataElementService;
+    }
+
     private PeriodService periodService;
 
     public void setPeriodService( PeriodService periodService )
@@ -101,6 +111,13 @@
         this.indicatorId = indicatorId;
     }
 
+    private List<String> dataElementsId;
+
+    public void setDataElementsId( List<String> dataElementsId )
+    {
+        this.dataElementsId = dataElementsId;
+    }
+
     private List<String> periodId;
 
     public void setPeriodId( List<String> periodId )
@@ -121,21 +138,21 @@
     {
         this.dimension = dimension;
     }
-    
+
     private boolean regression;
 
     public void setRegression( boolean regression )
     {
         this.regression = regression;
     }
-    
+
     private String chartWidth;
 
     public void setChartWidth( String chartWidth )
     {
         this.chartWidth = chartWidth;
     }
-    
+
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
@@ -160,7 +177,7 @@
     {
         return height;
     }
-    
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -169,32 +186,40 @@
         throws Exception
     {
         List<Indicator> indicators = new ArrayList<Indicator>();
-        
+
         for ( String id : indicatorId )
         {
             indicators.add( indicatorService.getIndicator( Integer.parseInt( id ) ) );
         }
-        
+
+        List<DataElement> dataElements = new ArrayList<DataElement>();
+
+        for ( Integer id : getIntegerCollection( dataElementsId ) )
+        {
+            dataElements.add( dataElementService.getDataElement( id ) );
+        }
+
         List<Period> periods = new ArrayList<Period>();
-        
+
         for ( String id : periodId )
         {
             periods.add( periodService.getPeriod( Integer.parseInt( id ) ) );
         }
-        
+
         List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>();
-        
+
         for ( String id : organisationUnitId )
         {
             organisationUnits.add( organisationUnitService.getOrganisationUnit( Integer.parseInt( id ) ) );
         }
-        
+
         width = chartWidth != null ? Integer.valueOf( chartWidth ) : 700;
-        
+
         height = 500;
-        
-        chart = chartService.getJFreeChart( indicators, periods, organisationUnits, dimension, regression, format );
-        
+
+        chart = chartService.getJFreeChart( indicators, dataElements, periods, organisationUnits, dimension,
+            regression, format );
+
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java	2011-01-13 15:44:09 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/GetChartOptionsAction.java	2011-06-07 16:12:23 +0000
@@ -35,6 +35,10 @@
 
 import org.hisp.dhis.chart.Chart;
 import org.hisp.dhis.chart.ChartService;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementGroup;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
@@ -55,7 +59,6 @@
 
 /**
  * @author Lars Helge Overland
- * @version $Id$
  */
 public class GetChartOptionsAction
     implements Action
@@ -78,6 +81,13 @@
         this.indicatorService = indicatorService;
     }
 
+    private DataElementService dataElementService;
+
+    public void setDataElementService( DataElementService dataElementService )
+    {
+        this.dataElementService = dataElementService;
+    }
+
     private PeriodService periodService;
 
     public void setPeriodService( PeriodService periodService )
@@ -91,28 +101,35 @@
     {
         this.organisationUnitService = organisationUnitService;
     }
-    
+
     private DisplayPropertyHandler displayPropertyHandler;
 
     public void setDisplayPropertyHandler( DisplayPropertyHandler displayPropertyHandler )
     {
         this.displayPropertyHandler = displayPropertyHandler;
     }
-    
+
     private Comparator<Indicator> indicatorComparator;
 
     public void setIndicatorComparator( Comparator<Indicator> indicatorComparator )
     {
         this.indicatorComparator = indicatorComparator;
     }
-    
+
+    private Comparator<DataElement> dataElementComparator;
+
+    public void setDataElementComparator( Comparator<DataElement> dataElementComparator )
+    {
+        this.dataElementComparator = dataElementComparator;
+    }
+
     private Comparator<OrganisationUnit> organisationUnitComparator;
 
     public void setOrganisationUnitComparator( Comparator<OrganisationUnit> organisationUnitComparator )
     {
         this.organisationUnitComparator = organisationUnitComparator;
     }
-    
+
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
@@ -123,7 +140,7 @@
     {
         this.id = id;
     }
-    
+
     private String dimension;
 
     public String getDimension()
@@ -134,8 +151,8 @@
     public void setDimension( String dimension )
     {
         this.dimension = dimension;
-    }    
-    
+    }
+
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
@@ -145,7 +162,7 @@
     public Chart getChart()
     {
         return chart;
-    }    
+    }
 
     private List<IndicatorGroup> indicatorGroups = new ArrayList<IndicatorGroup>();
 
@@ -153,7 +170,14 @@
     {
         return indicatorGroups;
     }
-    
+
+    private List<DataElementGroup> dataElementGroups = new ArrayList<DataElementGroup>();
+
+    public List<DataElementGroup> getDataElementGroups()
+    {
+        return dataElementGroups;
+    }
+
     private List<Indicator> availableIndicators;
 
     public List<Indicator> getAvailableIndicators()
@@ -161,13 +185,27 @@
         return availableIndicators;
     }
 
+    private List<DataElement> availableDataElements;
+
+    public List<DataElement> getAvailableDataElements()
+    {
+        return availableDataElements;
+    }
+
     private List<Indicator> selectedIndicators;
 
     public List<Indicator> getSelectedIndicators()
     {
         return selectedIndicators;
     }
-    
+
+    private List<DataElement> selectedDataElements;
+
+    public List<DataElement> getSelectedDataElements()
+    {
+        return selectedDataElements;
+    }
+
     private List<PeriodType> periodTypes = new ArrayList<PeriodType>();
 
     public List<PeriodType> getPeriodTypes()
@@ -181,28 +219,28 @@
     {
         return availablePeriods;
     }
-    
+
     private List<Period> selectedPeriods;
 
     public List<Period> getSelectedPeriods()
     {
         return selectedPeriods;
     }
-    
+
     private List<OrganisationUnitLevel> levels = new ArrayList<OrganisationUnitLevel>();
 
     public List<OrganisationUnitLevel> getLevels()
     {
         return levels;
     }
-    
+
     private List<OrganisationUnit> availableOrganisationUnits;
 
     public List<OrganisationUnit> getAvailableOrganisationUnits()
     {
         return availableOrganisationUnits;
     }
-    
+
     private List<OrganisationUnit> selectedOrganisationUnits;
 
     public List<OrganisationUnit> getSelectedOrganisationUnits()
@@ -217,45 +255,56 @@
     public String execute()
     {
         indicatorGroups = new ArrayList<IndicatorGroup>( indicatorService.getAllIndicatorGroups() );
-        
+
+        dataElementGroups = new ArrayList<DataElementGroup>( dataElementService.getAllDataElementGroups() );
+
         availableIndicators = new ArrayList<Indicator>( indicatorService.getAllIndicators() );
-        
+
+        availableDataElements = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
+
         periodTypes = new ArrayList<PeriodType>( periodService.getAllPeriodTypes() );
-        
+
         availablePeriods = new MonthlyPeriodType().generatePeriods( new Date() );
 
         levels = organisationUnitService.getOrganisationUnitLevels();
-        
+
         availableOrganisationUnits = new ArrayList<OrganisationUnit>( organisationUnitService.getAllOrganisationUnits() );
-        
+
         Collections.sort( indicatorGroups, new IndicatorGroupNameComparator() );
+        Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
         Collections.sort( availableIndicators, indicatorComparator );
+        Collections.sort( availableDataElements, dataElementComparator );
         Collections.sort( levels, new OrganisationUnitLevelComparator() );
-        Collections.sort( availableOrganisationUnits, organisationUnitComparator );   
+        Collections.sort( availableOrganisationUnits, organisationUnitComparator );
 
         Collections.reverse( availablePeriods );
         FilterUtils.filter( availablePeriods, new PastAndCurrentPeriodFilter() );
-        
+
         displayPropertyHandler.handle( availableIndicators );
+        displayPropertyHandler.handle( availableDataElements );
         displayPropertyHandler.handle( availableOrganisationUnits );
-        
+
         if ( id != null )
         {
             chart = chartService.getChart( id );
-            
+
             selectedIndicators = chart.getIndicators();
             availableIndicators.removeAll( selectedIndicators );
-            
+
+            selectedDataElements = chart.getDataElements();
+            availableDataElements.removeAll( selectedDataElements );
+
             selectedPeriods = chart.getPeriods();
             availablePeriods.removeAll( selectedPeriods );
-            
+
             selectedOrganisationUnits = chart.getOrganisationUnits();
             availableOrganisationUnits.removeAll( selectedOrganisationUnits );
-            
+
             displayPropertyHandler.handle( selectedIndicators );
+            displayPropertyHandler.handle( selectedDataElements );
             displayPropertyHandler.handle( selectedOrganisationUnits );
         }
-        
+
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java	2011-05-02 12:54:28 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java	2011-06-07 16:12:23 +0000
@@ -35,14 +35,16 @@
 
 import org.hisp.dhis.chart.Chart;
 import org.hisp.dhis.chart.ChartService;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.RelativePeriods;
 import org.hisp.dhis.period.comparator.AscendingPeriodComparator;
-import org.hisp.dhis.period.RelativePeriods;
 
 import com.opensymphony.xwork2.Action;
 
@@ -71,6 +73,13 @@
         this.indicatorService = indicatorService;
     }
 
+    private DataElementService dataElementService;
+
+    public void setDataElementService( DataElementService dataElementService )
+    {
+        this.dataElementService = dataElementService;
+    }
+
     private PeriodService periodService;
 
     public void setPeriodService( PeriodService periodService )
@@ -167,8 +176,9 @@
     }
 
     private String targetLineLabel;
-    
-    public void setTargetLineLabel( String targetLineLabel ) {
+
+    public void setTargetLineLabel( String targetLineLabel )
+    {
         this.targetLineLabel = targetLineLabel;
     }
 
@@ -186,6 +196,13 @@
         this.selectedIndicators = selectedIndicators;
     }
 
+    private List<String> selectedDataElements = new ArrayList<String>();
+
+    public void setSelectedDataElements( List<String> selectedDataElements )
+    {
+        this.selectedDataElements = selectedDataElements;
+    }
+
     private List<String> selectedPeriods = new ArrayList<String>();
 
     public void setSelectedPeriods( List<String> selectedPeriods )
@@ -258,6 +275,7 @@
         Chart chart = id == null ? new Chart() : chartService.getChart( id );
 
         List<Indicator> indicators = new ArrayList<Indicator>();
+        List<DataElement> dataElements = new ArrayList<DataElement>();
         List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>();
         List<Period> periods = new ArrayList<Period>( periodService.getPeriodsByExternalIds( selectedPeriods ) );
 
@@ -266,6 +284,11 @@
             indicators.add( indicatorService.getIndicator( id ) );
         }
 
+        for ( Integer id : getIntegerCollection( selectedDataElements ) )
+        {
+            dataElements.add( dataElementService.getDataElement( id ) );
+        }
+
         for ( Integer id : getIntegerCollection( selectedOrganisationUnits ) )
         {
             organisationUnits.add( organisationUnitService.getOrganisationUnit( id ) );
@@ -286,6 +309,7 @@
         chart.setTargetLineLabel( targetLineLabel );
         chart.setUserOrganisationUnit( userOrganisationUnit );
         chart.setIndicators( indicators );
+        chart.setDataElements( dataElements );
         chart.setPeriods( periods );
         chart.setOrganisationUnits( organisationUnits );
 

=== 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	2011-05-30 20:54:54 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml	2011-06-07 16:12:23 +0000
@@ -1,465 +1,325 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans";
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-       xsi:schemaLocation="
+<beans xmlns="http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+  xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd";>
-    
-  <bean id="org.hisp.dhis.reporting.action.NoAction"
-    class="org.hisp.dhis.reporting.action.NoAction"/>
+
+  <bean id="org.hisp.dhis.reporting.action.NoAction" class="org.hisp.dhis.reporting.action.NoAction" />
   
   <!-- Document -->
-  
-  <bean id="org.hisp.dhis.reporting.document.action.SaveDocumentAction"
-    class="org.hisp.dhis.reporting.document.action.SaveDocumentAction"
-    scope="prototype">
-	<property name="locationManager" ref="locationManager"/>
-    <property name="documentService"
-      ref="org.hisp.dhis.document.DocumentService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.document.action.GetDocumentAction"
-    class="org.hisp.dhis.reporting.document.action.GetDocumentAction"
-    scope="prototype">
-    <property name="documentService"
-      ref="org.hisp.dhis.document.DocumentService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.document.action.RemoveDocumentAction"
-    class="org.hisp.dhis.reporting.document.action.RemoveDocumentAction"
-    scope="prototype">
-	<property name="locationManager" ref="locationManager"/>
-    <property name="documentService"
-      ref="org.hisp.dhis.document.DocumentService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.document.action.GetAllDocumentsAction"
-    class="org.hisp.dhis.reporting.document.action.GetAllDocumentsAction"
-    scope="prototype">
-    <property name="documentService"
-      ref="org.hisp.dhis.document.DocumentService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.document.action.ValidateDocumentAction"
-    class="org.hisp.dhis.reporting.document.action.ValidateDocumentAction"
-    scope="prototype">
-    <property name="documentService"
-      ref="org.hisp.dhis.document.DocumentService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.document.action.AddDocumentToDashboardAction"
-    class="org.hisp.dhis.reporting.document.action.AddDocumentToDashboardAction"
-    scope="prototype">
-    <property name="currentUserService"
-      ref="org.hisp.dhis.user.CurrentUserService"/>
-    <property name="dashboardService"
-      ref="org.hisp.dhis.dashboard.DashboardService"/>
-    <property name="documentService"
-      ref="org.hisp.dhis.document.DocumentService"/>
+
+  <bean id="org.hisp.dhis.reporting.document.action.SaveDocumentAction" class="org.hisp.dhis.reporting.document.action.SaveDocumentAction"
+    scope="prototype">
+    <property name="locationManager" ref="locationManager" />
+    <property name="documentService" ref="org.hisp.dhis.document.DocumentService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.document.action.GetDocumentAction" class="org.hisp.dhis.reporting.document.action.GetDocumentAction"
+    scope="prototype">
+    <property name="documentService" ref="org.hisp.dhis.document.DocumentService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.document.action.RemoveDocumentAction" class="org.hisp.dhis.reporting.document.action.RemoveDocumentAction"
+    scope="prototype">
+    <property name="locationManager" ref="locationManager" />
+    <property name="documentService" ref="org.hisp.dhis.document.DocumentService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.document.action.GetAllDocumentsAction" class="org.hisp.dhis.reporting.document.action.GetAllDocumentsAction"
+    scope="prototype">
+    <property name="documentService" ref="org.hisp.dhis.document.DocumentService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.document.action.ValidateDocumentAction" class="org.hisp.dhis.reporting.document.action.ValidateDocumentAction"
+    scope="prototype">
+    <property name="documentService" ref="org.hisp.dhis.document.DocumentService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.document.action.AddDocumentToDashboardAction" class="org.hisp.dhis.reporting.document.action.AddDocumentToDashboardAction"
+    scope="prototype">
+    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+    <property name="dashboardService" ref="org.hisp.dhis.dashboard.DashboardService" />
+    <property name="documentService" ref="org.hisp.dhis.document.DocumentService" />
   </bean>
   
   <!-- Charts -->
-  
-  <bean id="org.hisp.dhis.reporting.chart.action.GenerateChartAction"
-    class="org.hisp.dhis.reporting.chart.action.GenerateChartAction"
-    scope="prototype">
-    <property name="chartService"
-      ref="org.hisp.dhis.chart.ChartService"/>
-    <property name="indicatorService"
-      ref="org.hisp.dhis.indicator.IndicatorService"/>
-    <property name="periodService"
-      ref="org.hisp.dhis.period.PeriodService"/>
-    <property name="organisationUnitService"
-      ref="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
-  </bean>    
-    
-  <bean id="org.hisp.dhis.reporting.chart.action.ViewChartAction"
-    class="org.hisp.dhis.reporting.chart.action.ViewChartAction"
-    scope="prototype">
-    <property name="chartService"
-      ref="org.hisp.dhis.chart.ChartService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.chart.action.GetAllChartsAction"
-    class="org.hisp.dhis.reporting.chart.action.GetAllChartsAction"
-    scope="prototype">
-    <property name="chartService"
-      ref="org.hisp.dhis.chart.ChartService"/>
-  </bean>  
-  
-  <bean id="org.hisp.dhis.reporting.chart.action.GetChartAction"
-    class="org.hisp.dhis.reporting.chart.action.GetChartAction"
-    scope="prototype">
-    <property name="chartService"
-      ref="org.hisp.dhis.chart.ChartService"/>
-  </bean>  
-  
-  <bean id="org.hisp.dhis.reporting.chart.action.GetChartOptionsAction"
-    class="org.hisp.dhis.reporting.chart.action.GetChartOptionsAction"
-    scope="prototype">
-    <property name="chartService"
-      ref="org.hisp.dhis.chart.ChartService"/>
-    <property name="indicatorService"
-      ref="org.hisp.dhis.indicator.IndicatorService"/>
-    <property name="periodService"
-      ref="org.hisp.dhis.period.PeriodService"/>
-    <property name="organisationUnitService"
-      ref="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.chart.action.RemoveChartAction"
-    class="org.hisp.dhis.reporting.chart.action.RemoveChartAction"
-    scope="prototype">
-    <property name="chartService"
-      ref="org.hisp.dhis.chart.ChartService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.chart.action.SaveChartAction"
-    class="org.hisp.dhis.reporting.chart.action.SaveChartAction"
-    scope="prototype">
-    <property name="chartService"
-      ref="org.hisp.dhis.chart.ChartService"/>
-    <property name="indicatorService"
-      ref="org.hisp.dhis.indicator.IndicatorService"/>
-    <property name="periodService"
-      ref="org.hisp.dhis.period.PeriodService"/>
-    <property name="organisationUnitService"
-      ref="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.chart.action.ValidateChartAction"
-    class="org.hisp.dhis.reporting.chart.action.ValidateChartAction"
-    scope="prototype">
-    <property name="chartService"
-      ref="org.hisp.dhis.chart.ChartService"/>
+
+  <bean id="org.hisp.dhis.reporting.chart.action.GenerateChartAction" class="org.hisp.dhis.reporting.chart.action.GenerateChartAction"
+    scope="prototype">
+    <property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
+    <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+    <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.chart.action.ViewChartAction" class="org.hisp.dhis.reporting.chart.action.ViewChartAction"
+    scope="prototype">
+    <property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.chart.action.GetAllChartsAction" class="org.hisp.dhis.reporting.chart.action.GetAllChartsAction"
+    scope="prototype">
+    <property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.chart.action.GetChartAction" class="org.hisp.dhis.reporting.chart.action.GetChartAction"
+    scope="prototype">
+    <property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.chart.action.GetChartOptionsAction" class="org.hisp.dhis.reporting.chart.action.GetChartOptionsAction"
+    scope="prototype">
+    <property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
+    <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+    <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.chart.action.RemoveChartAction" class="org.hisp.dhis.reporting.chart.action.RemoveChartAction"
+    scope="prototype">
+    <property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.chart.action.SaveChartAction" class="org.hisp.dhis.reporting.chart.action.SaveChartAction"
+    scope="prototype">
+    <property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
+    <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+    <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.chart.action.ValidateChartAction" class="org.hisp.dhis.reporting.chart.action.ValidateChartAction"
+    scope="prototype">
+    <property name="chartService" ref="org.hisp.dhis.chart.ChartService" />
   </bean>  
   
   <!-- TableCreator -->
-  
-  <bean id="org.hisp.dhis.reporting.tablecreator.action.GetTableOptionsAction"
-    class="org.hisp.dhis.reporting.tablecreator.action.GetTableOptionsAction"
-    scope="prototype">
-    <property name="reportTableService"
-      ref="org.hisp.dhis.reporttable.ReportTableService"/>
-    <property name="dataElementService"
-      ref="org.hisp.dhis.dataelement.DataElementService"/>
-	<property name="categoryService"
-	  ref="org.hisp.dhis.dataelement.DataElementCategoryService"/>
-    <property name="indicatorService"
-      ref="org.hisp.dhis.indicator.IndicatorService"/>
-    <property name="periodService"
-      ref="org.hisp.dhis.period.PeriodService"/>
-    <property name="organisationUnitService"
-      ref="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
-    <property name="dataSetService"
-      ref="org.hisp.dhis.dataset.DataSetService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.tablecreator.action.SaveTableAction"
-    class="org.hisp.dhis.reporting.tablecreator.action.SaveTableAction"
-    scope="prototype">
-    <property name="reportTableService"
-      ref="org.hisp.dhis.reporttable.ReportTableService"/>
-    <property name="dataElementService"
-      ref="org.hisp.dhis.dataelement.DataElementService"/>
-    <property name="categoryService"
-      ref="org.hisp.dhis.dataelement.DataElementCategoryService"/>
-    <property name="indicatorService"
-      ref="org.hisp.dhis.indicator.IndicatorService"/>
-    <property name="periodService"
-      ref="org.hisp.dhis.period.PeriodService"/>
-    <property name="organisationUnitService"
-      ref="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
-    <property name="dataSetService"
-      ref="org.hisp.dhis.dataset.DataSetService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.tablecreator.action.CreateTableAction"
-    class="org.hisp.dhis.reporting.tablecreator.action.CreateTableAction"
-    scope="prototype">
-        <property name="processCoordinator"
-      ref="processCoordinator"/>
-    <property name="currentUserService"
-      ref="org.hisp.dhis.user.CurrentUserService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.tablecreator.action.GetReportParamsAction"
-    class="org.hisp.dhis.reporting.tablecreator.action.GetReportParamsAction"
-    scope="prototype">
-    <property name="reportTableService"
-      ref="org.hisp.dhis.reporttable.ReportTableService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.tablecreator.action.GetAllTablesAction"
-    class="org.hisp.dhis.reporting.tablecreator.action.GetAllTablesAction"
-    scope="prototype">
-    <property name="reportTableService"
-      ref="org.hisp.dhis.reporttable.ReportTableService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.tablecreator.action.RemoveTableAction"
-    class="org.hisp.dhis.reporting.tablecreator.action.RemoveTableAction"
-    scope="prototype">
-    <property name="reportTableService"
-      ref="org.hisp.dhis.reporttable.ReportTableService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.tablecreator.action.GetTableAction"
-    class="org.hisp.dhis.reporting.tablecreator.action.GetTableAction"
-    scope="prototype">
-    <property name="reportTableService"
-      ref="org.hisp.dhis.reporttable.ReportTableService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.tablecreator.action.GetStatusAction"
-    class="org.hisp.dhis.reporting.tablecreator.action.GetStatusAction"
-    scope="prototype">
-    <property name="processCoordinator"
-      ref="processCoordinator"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.tablecreator.action.ValidateTableAction"
-    class="org.hisp.dhis.reporting.tablecreator.action.ValidateTableAction"
-    scope="prototype">
-    <property name="reportTableService"
-      ref="org.hisp.dhis.reporttable.ReportTableService"/>
-  </bean>
-    
-  <bean id="org.hisp.dhis.reporting.tablecreator.action.AddReportTableToDashboardAction"
-    class="org.hisp.dhis.reporting.tablecreator.action.AddReportTableToDashboardAction"
-    scope="prototype">
-    <property name="currentUserService"
-      ref="org.hisp.dhis.user.CurrentUserService"/>
-    <property name="dashboardService"
-      ref="org.hisp.dhis.dashboard.DashboardService"/>
-    <property name="reportTableService"
-      ref="org.hisp.dhis.reporttable.ReportTableService"/>
-  </bean>
-    
-  <bean id="org.hisp.dhis.reporting.tablecreator.action.ExportTableAction"
-    class="org.hisp.dhis.reporting.tablecreator.action.ExportTableAction"
-    scope="prototype">
-    <property name="reportTableService"
-      ref="org.hisp.dhis.reporttable.ReportTableService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.tablecreator.action.GetCategoryComboDataElementsAction"
-    class="org.hisp.dhis.reporting.tablecreator.action.GetCategoryComboDataElementsAction"
-    scope="prototype">
-    <property name="categoryService"
-      ref="org.hisp.dhis.dataelement.DataElementCategoryService"/>
-    <property name="dataElementService"
-      ref="org.hisp.dhis.dataelement.DataElementService"/>
+
+  <bean id="org.hisp.dhis.reporting.tablecreator.action.GetTableOptionsAction" class="org.hisp.dhis.reporting.tablecreator.action.GetTableOptionsAction"
+    scope="prototype">
+    <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
+    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+    <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+    <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.tablecreator.action.SaveTableAction" class="org.hisp.dhis.reporting.tablecreator.action.SaveTableAction"
+    scope="prototype">
+    <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
+    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+    <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+    <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.tablecreator.action.CreateTableAction" class="org.hisp.dhis.reporting.tablecreator.action.CreateTableAction"
+    scope="prototype">
+    <property name="processCoordinator" ref="processCoordinator" />
+    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.tablecreator.action.GetReportParamsAction" class="org.hisp.dhis.reporting.tablecreator.action.GetReportParamsAction"
+    scope="prototype">
+    <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.tablecreator.action.GetAllTablesAction" class="org.hisp.dhis.reporting.tablecreator.action.GetAllTablesAction"
+    scope="prototype">
+    <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.tablecreator.action.RemoveTableAction" class="org.hisp.dhis.reporting.tablecreator.action.RemoveTableAction"
+    scope="prototype">
+    <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.tablecreator.action.GetTableAction" class="org.hisp.dhis.reporting.tablecreator.action.GetTableAction"
+    scope="prototype">
+    <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.tablecreator.action.GetStatusAction" class="org.hisp.dhis.reporting.tablecreator.action.GetStatusAction"
+    scope="prototype">
+    <property name="processCoordinator" ref="processCoordinator" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.tablecreator.action.ValidateTableAction" class="org.hisp.dhis.reporting.tablecreator.action.ValidateTableAction"
+    scope="prototype">
+    <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.tablecreator.action.AddReportTableToDashboardAction" class="org.hisp.dhis.reporting.tablecreator.action.AddReportTableToDashboardAction"
+    scope="prototype">
+    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+    <property name="dashboardService" ref="org.hisp.dhis.dashboard.DashboardService" />
+    <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.tablecreator.action.ExportTableAction" class="org.hisp.dhis.reporting.tablecreator.action.ExportTableAction"
+    scope="prototype">
+    <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.tablecreator.action.GetCategoryComboDataElementsAction" class="org.hisp.dhis.reporting.tablecreator.action.GetCategoryComboDataElementsAction"
+    scope="prototype">
+    <property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
   </bean>
     
   <!-- ReportViewer -->
-  
-  <bean id="org.hisp.dhis.reporting.reportviewer.action.AddReportAction"
-    class="org.hisp.dhis.reporting.reportviewer.action.AddReportAction"
-    scope="prototype">
-    <property name="reportService"
-      ref="org.hisp.dhis.report.ReportService"/>
-    <property name="reportTableService"
-      ref="org.hisp.dhis.reporttable.ReportTableService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.reportviewer.action.GetReportOptionsAction"
-    class="org.hisp.dhis.reporting.reportviewer.action.GetReportOptionsAction"
-    scope="prototype">
-    <property name="reportService"
-      ref="org.hisp.dhis.report.ReportService"/>
-    <property name="reportTableService"
-      ref="org.hisp.dhis.reporttable.ReportTableService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.reportviewer.action.GetAllReportsAction"
-    class="org.hisp.dhis.reporting.reportviewer.action.GetAllReportsAction"
-    scope="prototype">
-    <property name="reportService"
-      ref="org.hisp.dhis.report.ReportService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.reportviewer.action.GetReportAction"
-    class="org.hisp.dhis.reporting.reportviewer.action.GetReportAction"
-    scope="prototype">
-    <property name="reportService"
-      ref="org.hisp.dhis.report.ReportService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.reportviewer.action.RemoveReportAction"
-    class="org.hisp.dhis.reporting.reportviewer.action.RemoveReportAction"
-    scope="prototype">
-    <property name="reportService"
-      ref="org.hisp.dhis.report.ReportService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.reportviewer.action.AddReportToDashboardAction"
-    class="org.hisp.dhis.reporting.reportviewer.action.AddReportToDashboardAction"
-    scope="prototype">
-    <property name="currentUserService"
-      ref="org.hisp.dhis.user.CurrentUserService"/>
-    <property name="dashboardService"
-      ref="org.hisp.dhis.dashboard.DashboardService"/>
-    <property name="reportService"
-      ref="org.hisp.dhis.report.ReportService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.reportviewer.action.RenderReportAction"
-    class="org.hisp.dhis.reporting.reportviewer.action.RenderReportAction"
-    scope="prototype">
-	<property name="reportService" 
-	  ref="org.hisp.dhis.report.ReportService"/>
-	<property name="reportTableService"
-	  ref="org.hisp.dhis.reporttable.ReportTableService"/>
-    <property name="statementManager"
-      ref="statementManager"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.reportviewer.action.GetReportDesignAction"
-    class="org.hisp.dhis.reporting.reportviewer.action.GetReportDesignAction"
-    scope="prototype">
-	<property name="reportService" 
-	  ref="org.hisp.dhis.report.ReportService"/>
+
+  <bean id="org.hisp.dhis.reporting.reportviewer.action.AddReportAction" class="org.hisp.dhis.reporting.reportviewer.action.AddReportAction"
+    scope="prototype">
+    <property name="reportService" ref="org.hisp.dhis.report.ReportService" />
+    <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.reportviewer.action.GetReportOptionsAction" class="org.hisp.dhis.reporting.reportviewer.action.GetReportOptionsAction"
+    scope="prototype">
+    <property name="reportService" ref="org.hisp.dhis.report.ReportService" />
+    <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.reportviewer.action.GetAllReportsAction" class="org.hisp.dhis.reporting.reportviewer.action.GetAllReportsAction"
+    scope="prototype">
+    <property name="reportService" ref="org.hisp.dhis.report.ReportService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.reportviewer.action.GetReportAction" class="org.hisp.dhis.reporting.reportviewer.action.GetReportAction"
+    scope="prototype">
+    <property name="reportService" ref="org.hisp.dhis.report.ReportService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.reportviewer.action.RemoveReportAction" class="org.hisp.dhis.reporting.reportviewer.action.RemoveReportAction"
+    scope="prototype">
+    <property name="reportService" ref="org.hisp.dhis.report.ReportService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.reportviewer.action.AddReportToDashboardAction" class="org.hisp.dhis.reporting.reportviewer.action.AddReportToDashboardAction"
+    scope="prototype">
+    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+    <property name="dashboardService" ref="org.hisp.dhis.dashboard.DashboardService" />
+    <property name="reportService" ref="org.hisp.dhis.report.ReportService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.reportviewer.action.RenderReportAction" class="org.hisp.dhis.reporting.reportviewer.action.RenderReportAction"
+    scope="prototype">
+    <property name="reportService" ref="org.hisp.dhis.report.ReportService" />
+    <property name="reportTableService" ref="org.hisp.dhis.reporttable.ReportTableService" />
+    <property name="statementManager" ref="statementManager" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.reportviewer.action.GetReportDesignAction" class="org.hisp.dhis.reporting.reportviewer.action.GetReportDesignAction"
+    scope="prototype">
+    <property name="reportService" ref="org.hisp.dhis.report.ReportService" />
   </bean>
   
   <!-- PivotTable -->
-  
-  <bean id="org.hisp.dhis.reporting.pivottable.action.GetPivotTableOptionsAction"
-    class="org.hisp.dhis.reporting.pivottable.action.GetPivotTableOptionsAction"
+
+  <bean id="org.hisp.dhis.reporting.pivottable.action.GetPivotTableOptionsAction" class="org.hisp.dhis.reporting.pivottable.action.GetPivotTableOptionsAction"
     scope="prototype">
-    <property name="indicatorService"
-      ref="org.hisp.dhis.indicator.IndicatorService"/>
-    <property name="dataElementService"
-      ref="org.hisp.dhis.dataelement.DataElementService"/>
+    <property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
+    <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
   </bean>
-  
-  <bean id="org.hisp.dhis.reporting.pivottable.action.GetPivotTableAction"
-    class="org.hisp.dhis.reporting.pivottable.action.GetPivotTableAction"
+
+  <bean id="org.hisp.dhis.reporting.pivottable.action.GetPivotTableAction" class="org.hisp.dhis.reporting.pivottable.action.GetPivotTableAction"
     scope="prototype">
-    <property name="pivotTableService"
-      ref="org.hisp.dhis.pivottable.PivotTableService"/>
+    <property name="pivotTableService" ref="org.hisp.dhis.pivottable.PivotTableService" />
   </bean>
     
   <!-- DataSet Report -->
-	
-  <bean id="org.hisp.dhis.reporting.dataset.action.GetDataSetReportOptionsAction"
-	class="org.hisp.dhis.reporting.dataset.action.GetDataSetReportOptionsAction">
-	<property name="dataSetService"
-	  ref="org.hisp.dhis.dataset.DataSetService"/>
+
+  <bean id="org.hisp.dhis.reporting.dataset.action.GetDataSetReportOptionsAction" class="org.hisp.dhis.reporting.dataset.action.GetDataSetReportOptionsAction">
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
   </bean>
-    
-  <bean id="org.hisp.dhis.reporting.dataset.action.GenerateDataSetReportAction" 
-    class="org.hisp.dhis.reporting.dataset.action.GenerateDataSetReportAction" 
+
+  <bean id="org.hisp.dhis.reporting.dataset.action.GenerateDataSetReportAction" class="org.hisp.dhis.reporting.dataset.action.GenerateDataSetReportAction"
     scope="prototype">
-    <property name="selectionTreeManager"
-      ref="org.hisp.dhis.oust.manager.SelectionTreeManager"/>
-	<property name="dataSetReportService"
-	  ref="org.hisp.dhis.datasetreport.DataSetReportService"/>
-    <property name="dataSetService"
-      ref="org.hisp.dhis.dataset.DataSetService"/>
-	<property name="periodService"
-	  ref="org.hisp.dhis.period.PeriodService"/>
+    <property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
+    <property name="dataSetReportService" ref="org.hisp.dhis.datasetreport.DataSetReportService" />
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+    <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
   </bean>
   	
   <!-- Data completeness -->
-  
-  <bean id="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessOptionsAction"
-    class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessOptionsAction"
+
+  <bean id="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessOptionsAction" class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessOptionsAction"
     scope="prototype">
-    <property name="dataSetService"
-      ref="org.hisp.dhis.dataset.DataSetService"/>
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
   </bean>
-  
-  <bean id="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessAction"
-    class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessAction"
+
+  <bean id="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessAction" class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessAction"
     scope="prototype">
-    <property name="serviceProvider"
-      ref="dataCompletenessServiceProvider"/>
-    <property name="dataSetService"
-      ref="org.hisp.dhis.dataset.DataSetService"/>
-	<property name="periodService"
-	  ref="org.hisp.dhis.period.PeriodService"/>
-	<property name="selectionTreeManager"
-      ref="org.hisp.dhis.oust.manager.SelectionTreeManager"/>
+    <property name="serviceProvider" ref="dataCompletenessServiceProvider" />
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+    <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+    <property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
   </bean>
       
   <!-- Tallysheet -->
-  
-  <bean id="org.hisp.dhis.reporting.tallysheet.action.SelectTallySheetAction"
-    class="org.hisp.dhis.reporting.tallysheet.action.SelectTallySheetAction"
-    scope="prototype">
-    <property name="dataSetService" 
-      ref="org.hisp.dhis.dataset.DataSetService" />
-  </bean>
-
-  <bean id="org.hisp.dhis.reporting.tallysheet.action.ViewTallySheetAction"
-    class="org.hisp.dhis.reporting.tallysheet.action.ViewTallySheetAction"
-    scope="prototype">
-    <property name="tallySheetService"
-      ref="org.hisp.dhis.tallysheet.TallySheetService"/>
-    <property name="selectionTreeManager"
-      ref="org.hisp.dhis.oust.manager.SelectionTreeManager"/>
-    <property name="dataSetService"
-      ref="org.hisp.dhis.dataset.DataSetService"/>           
-  </bean>
-   
-  <bean id="org.hisp.dhis.reporting.tallysheet.action.GenerateTallySheetAction"
-    class="org.hisp.dhis.reporting.tallysheet.action.GenerateTallySheetAction"
-    scope="prototype">
-    <property name="tallySheetPdfService"
-      ref="org.hisp.dhis.tallysheet.TallySheetPdfService"/>
+
+  <bean id="org.hisp.dhis.reporting.tallysheet.action.SelectTallySheetAction" class="org.hisp.dhis.reporting.tallysheet.action.SelectTallySheetAction"
+    scope="prototype">
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.tallysheet.action.ViewTallySheetAction" class="org.hisp.dhis.reporting.tallysheet.action.ViewTallySheetAction"
+    scope="prototype">
+    <property name="tallySheetService" ref="org.hisp.dhis.tallysheet.TallySheetService" />
+    <property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.tallysheet.action.GenerateTallySheetAction" class="org.hisp.dhis.reporting.tallysheet.action.GenerateTallySheetAction"
+    scope="prototype">
+    <property name="tallySheetPdfService" ref="org.hisp.dhis.tallysheet.TallySheetPdfService" />
   </bean>
   
   <!-- Organisation Unit Distribution -->
-  
-  <bean id="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionAction"
-  	class="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionAction"
-  	scope="prototype">
-    <property name="organisationUnitGroupService"
-      ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService"/>
-    <property name="distributionService"
-      ref="org.hisp.dhis.orgunitdistribution.OrgUnitDistributionService"/>
-    <property name="selectionTreeManager"
-      ref="org.hisp.dhis.oust.manager.SelectionTreeManager"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionChartAction"
-  	class="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionChartAction"
-  	scope="prototype">
-    <property name="organisationUnitGroupService"
-      ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService"/>
-    <property name="distributionService"
-      ref="org.hisp.dhis.orgunitdistribution.OrgUnitDistributionService"/>
-    <property name="selectionTreeManager"
-      ref="org.hisp.dhis.oust.manager.SelectionTreeManager"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionOptionsAction"
-  	class="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionOptionsAction"
-  	scope="prototype">
-    <property name="organisationUnitGroupService"
-      ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService"/>
+
+  <bean id="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionAction" class="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionAction"
+    scope="prototype">
+    <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+    <property name="distributionService" ref="org.hisp.dhis.orgunitdistribution.OrgUnitDistributionService" />
+    <property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionChartAction" class="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionChartAction"
+    scope="prototype">
+    <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+    <property name="distributionService" ref="org.hisp.dhis.orgunitdistribution.OrgUnitDistributionService" />
+    <property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
+  </bean>
+
+  <bean id="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionOptionsAction" class="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionOptionsAction"
+    scope="prototype">
+    <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
   </bean>
   
   <!-- Scheduling -->
-  
-  <bean id="org.hisp.dhis.reporting.scheduling.action.ScheduleTasksAction"
-    class="org.hisp.dhis.reporting.scheduling.action.ScheduleTasksAction"
+
+  <bean id="org.hisp.dhis.reporting.scheduling.action.ScheduleTasksAction" class="org.hisp.dhis.reporting.scheduling.action.ScheduleTasksAction"
     scope="prototype">
-	<property name="systemSettingManager" ref="org.hisp.dhis.options.SystemSettingManager"/>
-	<property name="schedulingManager" ref="org.hisp.dhis.scheduling.SchedulingManager"/>
+    <property name="systemSettingManager" ref="org.hisp.dhis.options.SystemSettingManager" />
+    <property name="schedulingManager" ref="org.hisp.dhis.scheduling.SchedulingManager" />
   </bean>
   
   <!-- Export -->
-  
-  <bean id="org.hisp.dhis.reporting.exp.ExportDataMartAction"
-	class="org.hisp.dhis.reporting.exp.ExportDataMartAction"
-	scope="prototype">
-	<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
-	<property name="exportPivotViewService" ref="org.hisp.dhis.importexport.synchronous.ExportPivotViewService" />
+
+  <bean id="org.hisp.dhis.reporting.exp.ExportDataMartAction" class="org.hisp.dhis.reporting.exp.ExportDataMartAction"
+    scope="prototype">
+    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+    <property name="exportPivotViewService" ref="org.hisp.dhis.importexport.synchronous.ExportPivotViewService" />
   </bean>
 
-  <bean id="org.hisp.dhis.reporting.exp.MetaDataExportAction"
-    class="org.hisp.dhis.reporting.exp.MetaDataExportAction"
+  <bean id="org.hisp.dhis.reporting.exp.MetaDataExportAction" class="org.hisp.dhis.reporting.exp.MetaDataExportAction"
     scope="prototype">
     <property name="serviceProvider" ref="exportServiceProvider" />
   </bean>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties	2011-06-01 11:39:43 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties	2011-06-07 16:12:23 +0000
@@ -26,7 +26,9 @@
 manage_report_table= Manage report table
 available_indicators= Available indicators
 select_indicatorgroup_all= Select indicator group / View all
+select_dataelementgroup_all= Select data element group / View all
 selected_indicators= Selected indicators
+selected_dataelements= Selected data elements
 available_organisationunits= Available organisation units
 select_organisationunit_level_all = Select organsation unit level / View all
 select_period_type_all = Select period type / View all
@@ -166,10 +168,15 @@
 add_organisation_unit_chart= Add organisation unit chart
 add_indicator_chart = Add indicator chart
 period_by_indicator_chart = Period by indicator chart
+period_by_dataelement_chart = Period by data element chart
 indicator_by_period_chart= Indicator by period chart
+dataelement_by_period_chart= Data element by period chart
 indicator_by_organisation_unit_chart= Indicator by organisation unit chart
+dataelement_by_organisation_unit_chart= Data element by organisation unit chart
 create_indicator_by_period_chart= Create indicator by period chart
+create_dataelement_by_period_chart= Create data element by period chart
 create_indicator_by_organisation_unit_chart= Create indicator by organisation unit chart
+create_dataelement_by_organisation_unit_chart= Create data element by organisation unit chart
 dimension= Dimension
 category_option_combos= Category Option Combinations
 hide_legend= Hide legend
@@ -189,6 +196,8 @@
 title= Title
 value_y_available_indicators= Value (Y) - Available indicators
 value_y_selected_indicators= Value (Y) - Selected indicators
+value_y_available_dataelements= Value (Y) - Available data elements
+value_y_selected_dataelements= Value (Y) - Selected data elements
 category_x_available_organisationunits= Category (X) - Available organisation units
 category_x_selected_organisationunits= Category (X) - Selected organisation units
 category_x_available_periods= Category (X) - Available periods
@@ -197,6 +206,7 @@
 filter_available_periods= Filter - Available periods
 pivot_table= Pivot Table
 indicator_group= Indicator group
+dataelement_group= Data element group
 start_date= Start date
 end_date= End date
 period_type= Period type
@@ -300,8 +310,11 @@
 intro_orgunit_distribution_report = Browse the organisation unit distribution report based on the organisation unit group sets and its groups.
 orgunit_distribution_report = Organisation Unit Distribution Report
 create_period_by_indicator_chart = Create period by indicator chart
+create_period_by_dataelement_chart = Create period by data element chart
 value_x_selected_indicators = Value (X) - Selected indicators
 value_x_available_indicators = Value (X) - Available indicators
+value_x_selected_dataelements = Value (X) - Selected data elements
+value_x_available_dataelements = Value (X) - Available data elements
 category_y_selected_periods = Value (Y) - Selected periods
 category_y_available_periods = Value (Y) - Available periods
 get_current_design = Get current design

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml	2011-05-31 11:18:52 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml	2011-06-07 16:12:23 +0000
@@ -4,10 +4,10 @@
 "http://struts.apache.org/dtds/struts-2.0.dtd";>
 <struts>
 
-  <include file="dhis-web-commons.xml"/>
-  	
+  <include file="dhis-web-commons.xml" />
+
   <package name="dhis-web-reporting" extends="dhis-web-commons" namespace="/dhis-web-reporting">
-    
+
     <action name="index" class="org.hisp.dhis.reporting.action.NoAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-reporting/index.vm</param>
@@ -15,27 +15,27 @@
     </action>
     
     <!-- Document -->
-    
+
     <action name="saveDocument" class="org.hisp.dhis.reporting.document.action.SaveDocumentAction">
-      <result name="success" type="redirect">displayViewDocumentForm.action</result>      
-      <interceptor-ref name="fileUploadStack"/>
+      <result name="success" type="redirect">displayViewDocumentForm.action</result>
+      <interceptor-ref name="fileUploadStack" />
       <param name="requiredAuthorities">F_DOCUMENT_ADD</param>
     </action>
-    
+
     <action name="removeDocument" class="org.hisp.dhis.reporting.document.action.RemoveDocumentAction">
       <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
       <param name="requiredAuthorities">F_DOCUMENT_DELETE</param>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
-    
+
     <action name="displayViewDocumentForm" class="org.hisp.dhis.reporting.document.action.GetAllDocumentsAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-reporting/viewDocumentForm.vm</param>
       <param name="menu">/dhis-web-reporting/menu.vm</param>
       <param name="javascripts">javascript/document.js</param>
-	  <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
+      <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
     </action>
-    
+
     <action name="displayAddDocumentForm" class="org.hisp.dhis.reporting.document.action.GetDocumentAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-reporting/addDocumentForm.vm</param>
@@ -43,60 +43,60 @@
       <param name="javascripts">javascript/document.js</param>
       <param name="requiredAuthorities">F_DOCUMENT_ADD</param>
     </action>
-    
+
     <action name="validateDocument" class="org.hisp.dhis.reporting.document.action.ValidateDocumentAction">
       <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
       <result name="input" type="velocity-json">/dhis-web-commons/ajax/jsonResponseInput.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
-    
+
     <action name="addDocumentToDashboard" class="org.hisp.dhis.reporting.document.action.AddDocumentToDashboardAction">
       <result name="success" type="velocity-xml">/dhis-web-reporting/responseSuccess.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
     
     <!-- Chart -->
-        
+
     <action name="saveChart" class="org.hisp.dhis.reporting.chart.action.SaveChartAction">
       <result name="success" type="redirect">displayViewChartForm.action</result>
-      <param name="requiredAuthorities">F_CHART_ADD</param>     
+      <param name="requiredAuthorities">F_CHART_ADD</param>
     </action>
-    
+
     <action name="removeChart" class="org.hisp.dhis.reporting.chart.action.RemoveChartAction">
       <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
       <param name="requiredAuthorities">F_CHART_DELETE</param>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
-    
+
     <action name="displayAddChartForm" class="org.hisp.dhis.reporting.chart.action.GetChartOptionsAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-reporting/addChartForm.vm</param>
       <param name="menu">/dhis-web-reporting/menu.vm</param>
       <param name="javascripts">javascript/lists.js,javascript/chart.js</param>
-      <param name="requiredAuthorities">F_CHART_ADD</param>      
+      <param name="requiredAuthorities">F_CHART_ADD</param>
     </action>
-    
+
     <action name="displayViewChartForm" class="org.hisp.dhis.reporting.chart.action.GetAllChartsAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-reporting/viewChartForm.vm</param>
       <param name="menu">/dhis-web-reporting/menu.vm</param>
       <param name="javascripts">javascript/chart.js</param>
-	  <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
+      <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
     </action>
-    
+
     <action name="viewChart" class="org.hisp.dhis.reporting.chart.action.ViewChartAction">
       <result name="success" type="chart"></result>
     </action>
-    
+
     <action name="generateChart" class="org.hisp.dhis.reporting.chart.action.GenerateChartAction">
       <result name="success" type="chart"></result>
-    </action>    
-    
+    </action>
+
     <action name="getChart" class="org.hisp.dhis.reporting.chart.action.GetChartAction">
       <result name="success" type="velocity-xml">/dhis-web-reporting/responseChart.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
-    
+
     <action name="validateChart" class="org.hisp.dhis.reporting.chart.action.ValidateChartAction">
       <result name="success" type="velocity-xml">/dhis-web-reporting/responseSuccess.vm</result>
       <result name="input" type="velocity-xml">/dhis-web-reporting/responseInput.vm</result>
@@ -104,33 +104,33 @@
     </action>
     
     <!-- Report -->
-    
+
     <action name="displayAddReportForm" class="org.hisp.dhis.reporting.reportviewer.action.GetReportOptionsAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-reporting/addReportForm.vm</param>
       <param name="menu">/dhis-web-reporting/menu.vm</param>
       <param name="javascripts">javascript/report.js</param>
-      <param name="requiredAuthorities">F_REPORT_ADD</param> 	  
+      <param name="requiredAuthorities">F_REPORT_ADD</param>
     </action>
-    
+
     <action name="addReport" class="org.hisp.dhis.reporting.reportviewer.action.AddReportAction">
       <result name="success" type="redirect">displayViewReportForm.action</result>
-      <result name="error" type="redirect">displayAddReportForm.action</result>	  
-      <interceptor-ref name="fileUploadStack"/>
+      <result name="error" type="redirect">displayAddReportForm.action</result>
+      <interceptor-ref name="fileUploadStack" />
       <param name="requiredAuthorities">F_REPORT_ADD</param>
     </action>
-    
+
     <action name="removeReport" class="org.hisp.dhis.reporting.reportviewer.action.RemoveReportAction">
       <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
-	  <param name="requiredAuthorities">F_REPORT_DELETE</param>
+      <param name="requiredAuthorities">F_REPORT_DELETE</param>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
-    
+
     <action name="createReportTable" class="org.hisp.dhis.reporting.tablecreator.action.CreateTableAction">
       <result name="success" type="redirect">displayViewReportForm.action</result>
       <param name="requiredAuthorities">F_REPORT_VIEW</param>
     </action>
-        
+
     <action name="displayViewReportForm" class="org.hisp.dhis.reporting.reportviewer.action.GetAllReportsAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="menuTreeHeight">420</param>
@@ -138,48 +138,48 @@
       <param name="menu">/dhis-web-reporting/menu.vm</param>
       <param name="javascripts">javascript/report.js</param>
       <param name="requiredAuthorities">F_REPORT_VIEW</param>
-	  <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
+      <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
     </action>
-        
+
     <action name="addReportToDashboard" class="org.hisp.dhis.reporting.reportviewer.action.AddReportToDashboardAction">
       <result name="success" type="velocity-xml">/dhis-web-reporting/responseSuccess.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
-    
+
     <action name="renderReport" class="org.hisp.dhis.reporting.reportviewer.action.RenderReportAction">
-      <result name="success" type="outputStreamResult"/>
+      <result name="success" type="outputStreamResult" />
     </action>
-    
+
     <action name="getReportDesign" class="org.hisp.dhis.reporting.reportviewer.action.GetReportDesignAction">
-      <result name="success" type="outputStreamResult"/>
+      <result name="success" type="outputStreamResult" />
     </action>
     
     <!-- ReportTable -->
-    
-    <action name="displayManageTableForm" class="org.hisp.dhis.reporting.tablecreator.action.GetAllTablesAction">      
+
+    <action name="displayManageTableForm" class="org.hisp.dhis.reporting.tablecreator.action.GetAllTablesAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-reporting/viewTableForm.vm</param>
       <param name="menu">/dhis-web-reporting/menu.vm</param>
       <param name="javascripts">javascript/table.js</param>
-	  <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
+      <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
     </action>
-    
+
     <action name="removeTable" class="org.hisp.dhis.reporting.tablecreator.action.RemoveTableAction">
       <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
       <param name="requiredAuthorities">F_REPORTTABLE_DELETE</param>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
-    
+
     <action name="saveTable" class="org.hisp.dhis.reporting.tablecreator.action.SaveTableAction">
       <result name="success" type="redirect">displayManageTableForm.action</result>
-	    <param name="requiredAuthorities">F_REPORTTABLE_ADD</param>
+      <param name="requiredAuthorities">F_REPORTTABLE_ADD</param>
     </action>
-    
+
     <action name="createTable" class="org.hisp.dhis.reporting.tablecreator.action.CreateTableAction">
       <result name="success" type="velocity-xml">/dhis-web-reporting/responseSuccess.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
-    
+
     <action name="getReportParams" class="org.hisp.dhis.reporting.tablecreator.action.GetReportParamsAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-reporting/inputReportParamsForm.vm</param>
@@ -187,7 +187,7 @@
       <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/generateReport.js</param>
       <param name="requiredAuthorities">F_REPORT_VIEW</param>
     </action>
-    
+
     <action name="displayAddTableForm" class="org.hisp.dhis.reporting.tablecreator.action.GetTableOptionsAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-reporting/addTableForm.vm</param>
@@ -195,95 +195,95 @@
       <param name="javascripts">javascript/table.js,javascript/lists.js</param>
       <param name="requiredAuthorities">F_REPORTTABLE_ADD</param>
     </action>
-    
+
     <action name="getTable" class="org.hisp.dhis.reporting.tablecreator.action.GetTableAction">
       <result name="success" type="velocity-xml">/dhis-web-reporting/responseTable.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
-    
+
     <action name="getStatus" class="org.hisp.dhis.reporting.tablecreator.action.GetStatusAction">
       <result name="success" type="velocity-xml">/dhis-web-reporting/responseStatus.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
-    
+
     <action name="validateTable" class="org.hisp.dhis.reporting.tablecreator.action.ValidateTableAction">
       <result name="success" type="velocity-xml">/dhis-web-reporting/responseSuccess.vm</result>
       <result name="input" type="velocity-xml">/dhis-web-reporting/responseInput.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
-    
+
     <action name="addReportTableToDashboard" class="org.hisp.dhis.reporting.tablecreator.action.AddReportTableToDashboardAction">
       <result name="success" type="velocity-xml">/dhis-web-reporting/responseSuccess.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
-            
+
     <action name="exportTable" class="org.hisp.dhis.reporting.tablecreator.action.ExportTableAction">
-      <result name="csv" type="gridCsvResult"/>
-      <result name="xls" type="gridXlsResult"/>
-      <result name="pdf" type="gridPdfResult"/>
-      <result name="jasper" type="gridJasperResult"/>
-      <result name="jrxml" type="gridJrxmlResult"/>
+      <result name="csv" type="gridCsvResult" />
+      <result name="xls" type="gridXlsResult" />
+      <result name="pdf" type="gridPdfResult" />
+      <result name="jasper" type="gridJasperResult" />
+      <result name="jrxml" type="gridJrxmlResult" />
       <result name="html" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-reporting/reportTableGrid.vm</param>
-      <param name="menu">/dhis-web-reporting/menu.vm</param>   
-      <param name="javascripts">javascript/generateReport.js</param>   
+      <param name="menu">/dhis-web-reporting/menu.vm</param>
+      <param name="javascripts">javascript/generateReport.js</param>
     </action>
-    
+
     <action name="getCategoryComboDataElements" class="org.hisp.dhis.reporting.tablecreator.action.GetCategoryComboDataElementsAction">
       <result name="success" type="velocity-xml">../dhis-web-commons/ajax/xmlDataElements.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
     
     <!-- PivotTable -->
-    
+
     <action name="displayPivotTableForm" class="org.hisp.dhis.reporting.pivottable.action.GetPivotTableOptionsAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-reporting/viewPivotTableForm.vm</param>
       <param name="menu">/dhis-web-reporting/menu.vm</param>
       <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/pivot.js,javascript/criteria.js</param>
-      <interceptor-ref name="organisationUnitTreeStack"/>
+      <interceptor-ref name="organisationUnitTreeStack" />
     </action>
-    
+
     <action name="getPivotTable" class="org.hisp.dhis.reporting.pivottable.action.GetPivotTableAction">
       <result name="success" type="velocity-json">/dhis-web-reporting/responsePivotTable.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
     </action>
         
     <!-- Data Completeness -->
-    
+
     <action name="displayViewDataCompletenessForm" class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessOptionsAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-reporting/viewDataCompletenessForm.vm</param>
       <param name="menu">/dhis-web-reporting/menu.vm</param>
       <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/dataCompleteness.js</param>
     </action>
-    
+
     <action name="getDataCompleteness" class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessAction">
       <result name="input" type="redirect">displayViewDataCompletenessForm.action</result>
-      <result name="csv" type="gridCsvResult"/>
-      <result name="xls" type="gridXlsResult"/>
-      <result name="pdf" type="gridPdfResult"/>
+      <result name="csv" type="gridCsvResult" />
+      <result name="xls" type="gridXlsResult" />
+      <result name="pdf" type="gridPdfResult" />
       <result name="html" type="velocity">/dhis-web-commons/ajax/htmlGrid.vm</result>
     </action> 
     
     <!-- DataSet Report -->
-    
-    <action name="showDataSetReportForm" class="org.hisp.dhis.reporting.dataset.action.GetDataSetReportOptionsAction">      
+
+    <action name="showDataSetReportForm" class="org.hisp.dhis.reporting.dataset.action.GetDataSetReportOptionsAction">
       <result name="success" type="velocity">/main.vm</result>
-      <param name="menuTreeHeight">420</param>	  
+      <param name="menuTreeHeight">420</param>
       <param name="page">/dhis-web-reporting/dataSetReportForm.vm</param>
       <param name="menu">/dhis-web-reporting/menu.vm</param>
       <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/dataSetReport.js</param>
-      <interceptor-ref name="organisationUnitTreeStack"/>       
-    </action>	   
-        
-	<action name="generateDataSetReport" class="org.hisp.dhis.reporting.dataset.action.GenerateDataSetReportAction">
-      <result name="xls" type="gridXlsResult"/>
-      <result name="pdf" type="gridPdfResult"/>
-	  <result name="success" type="velocity">/main.vm</result> <!-- Page param set in action -->
-	  <param name="menu">/dhis-web-reporting/menu.vm</param>	
-      <param name="javascripts">javascript/dataSetReport.js</param>  
-	</action>
+      <interceptor-ref name="organisationUnitTreeStack" />
+    </action>
+
+    <action name="generateDataSetReport" class="org.hisp.dhis.reporting.dataset.action.GenerateDataSetReportAction">
+      <result name="xls" type="gridXlsResult" />
+      <result name="pdf" type="gridPdfResult" />
+      <result name="success" type="velocity">/main.vm</result> <!-- Page param set in action -->
+      <param name="menu">/dhis-web-reporting/menu.vm</param>
+      <param name="javascripts">javascript/dataSetReport.js</param>
+    </action>
 	
     <!-- Tally Sheet Forms Generator -->
 
@@ -295,7 +295,7 @@
       <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/tallySheet.js</param>
       <interceptor-ref name="organisationUnitTreeStack" />
     </action>
-        
+
     <action name="configureTallySheetGenerator" class="org.hisp.dhis.reporting.tallysheet.action.ViewTallySheetAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="menuTreeHeight">420</param>
@@ -304,24 +304,24 @@
       <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/tallySheet.js</param>
       <interceptor-ref name="organisationUnitTreeStack" />
     </action>
-        
+
     <action name="generateTallySheetPDF" class="org.hisp.dhis.reporting.tallysheet.action.GenerateTallySheetAction">
       <result name="success" type="stream">
-      <param name="contentType">application/pdf</param>
-      <param name="inputName">inputStream</param>
-      <param name="contentDisposition">filename="${fileName}"</param>
-      <param name="bufferSize">1024</param>
+        <param name="contentType">application/pdf</param>
+        <param name="inputName">inputStream</param>
+        <param name="contentDisposition">filename="${fileName}"</param>
+        <param name="bufferSize">1024</param>
       </result>
     </action>
         
     <!-- Organisation Unit Distribution -->
-  
-    <action name="getOrgUnitDistribution" class="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionAction">      
-      <result name="csv" type="gridCsvResult"/>
-      <result name="xls" type="gridXlsResult"/>
-      <result name="pdf" type="gridPdfResult"/>
+
+    <action name="getOrgUnitDistribution" class="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionAction">
+      <result name="csv" type="gridCsvResult" />
+      <result name="xls" type="gridXlsResult" />
+      <result name="pdf" type="gridPdfResult" />
       <result name="html" type="velocity">/dhis-web-commons/ajax/htmlGrid.vm</result>
-    </action>    
+    </action>
 
     <action name="displayOrgUnitDistribution" class="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionOptionsAction">
       <result name="success" type="velocity">/main.vm</result>
@@ -331,27 +331,27 @@
       <param name="stylesheets">style/dhis-web-reporting.css</param>
       <interceptor-ref name="organisationUnitTreeStack" />
     </action>
-	
-	<action name="getOrgUnitDistributionChart" class="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionChartAction">
-	  <result name="success" type="chart"></result>
+
+    <action name="getOrgUnitDistributionChart" class="org.hisp.dhis.reporting.orgunitdistribution.action.GetOrgUnitDistributionChartAction">
+      <result name="success" type="chart"></result>
     </action>
 	
 	<!-- Scheduling -->
-	
-	<action name="viewScheduledTasks" class="org.hisp.dhis.reporting.scheduling.action.ScheduleTasksAction">	
-      <result name="success" type="velocity">/main.vm</result>
-      <param name="page">/dhis-web-reporting/viewScheduledTasks.vm</param>
-      <param name="menu">/dhis-web-reporting/menu.vm</param>
-	  <param name="statusOnly">true</param>
-      <param name="requiredAuthorities">F_SCHEDULING_ADMIN</param>
-	</action>
-	
-	<action name="scheduleTasks" class="org.hisp.dhis.reporting.scheduling.action.ScheduleTasksAction">	
-      <result name="success" type="velocity">/main.vm</result>
-      <param name="page">/dhis-web-reporting/viewScheduledTasks.vm</param>
-      <param name="menu">/dhis-web-reporting/menu.vm</param>
-      <param name="requiredAuthorities">F_SCHEDULING_ADMIN</param>
-	</action>
+
+    <action name="viewScheduledTasks" class="org.hisp.dhis.reporting.scheduling.action.ScheduleTasksAction">
+      <result name="success" type="velocity">/main.vm</result>
+      <param name="page">/dhis-web-reporting/viewScheduledTasks.vm</param>
+      <param name="menu">/dhis-web-reporting/menu.vm</param>
+      <param name="statusOnly">true</param>
+      <param name="requiredAuthorities">F_SCHEDULING_ADMIN</param>
+    </action>
+
+    <action name="scheduleTasks" class="org.hisp.dhis.reporting.scheduling.action.ScheduleTasksAction">
+      <result name="success" type="velocity">/main.vm</result>
+      <param name="page">/dhis-web-reporting/viewScheduledTasks.vm</param>
+      <param name="menu">/dhis-web-reporting/menu.vm</param>
+      <param name="requiredAuthorities">F_SCHEDULING_ADMIN</param>
+    </action>
 	
 	<!-- Datamart CSV Export -->
 

=== added file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementModeForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementModeForm.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementModeForm.vm	2011-06-07 16:12:23 +0000
@@ -0,0 +1,162 @@
+<table>
+<!-- Periods -->
+
+<tr>
+    <th colspan="2">$i18n.getString( "category_y_available_periods" )</th>
+</tr>
+<tr>
+	<td>
+		<input type="button" style="width:60px" value="$i18n.getString( 'prev' )" onclick="getAvailablePeriods( 'periodType', 'availablePeriods', 'selectedPeriods', '-1' )" />
+		<input type="button" style="width:60px" value="$i18n.getString( 'next' )" onclick="getAvailablePeriods( 'periodType', 'availablePeriods', 'selectedPeriods', '1' )" />
+		<select id="periodType" name="periodType" style="min-width:478px" onchange="getAvailablePeriods( 'periodType', 'availablePeriods', 'selectedPeriods', '0' )">
+			<option value="">[ $i18n.getString( "select_period_type_all" ) ]</option>
+			#foreach ( $type in $periodTypes )
+				<option value="$type.name">$type.name</option>
+			#end
+		</select>
+	</td>
+</tr>
+<tr>
+    <td colspan="2">
+        <select multiple size="6" id="availablePeriods" name="availablePeriods" style="min-width:600px" ondblclick="moveSelectedById( 'availablePeriods', 'selectedPeriods' )">
+            #foreach ( $period in $availablePeriods )
+                <option value="$period.externalId">$format.formatPeriod( $period )</option>
+            #end
+        </select>
+    </td>
+</tr>
+
+<tr>
+    <td colspan="2">
+        <input type="button" value="$i18n.getString( 'add_selected' )" title="$i18n.getString( 'add_selected' )" style="width:120px" onclick="moveSelectedById( 'availablePeriods', 'selectedPeriods' )" />
+        <input type="button" value="$i18n.getString( 'add_all' )" title="$i18n.getString( 'add_all' )" style="width:120px" onclick="moveAllById( 'availablePeriods', 'selectedPeriods' )" />
+        <input type="button" value="$i18n.getString( 'remove_selected' )" title="$i18n.getString( 'remove_selected' )" style="width:120px" onclick="moveSelectedById( 'selectedPeriods', 'availablePeriods' )" />
+        <input type="button" value="$i18n.getString( 'remove_all' )" title="$i18n.getString( 'remove_all' )" style="width:120px" onclick="moveAllById( 'selectedPeriods', 'availablePeriods' )" />
+    </td>
+</tr>
+
+<tr>
+    <th colspan="2">$i18n.getString( "category_y_selected_periods" )</th>
+</tr>
+
+<tr>
+    <td>
+        <select size="6" id="selectedPeriods" name="selectedPeriods" style="min-width:600px" multiple ondblclick="moveSelectedById( 'selectedPeriods', 'availablePeriods' )">               
+            #foreach ( $period in $selectedPeriods )
+                <option value="$period.externalId">$format.formatPeriod( $period )</option>
+            #end
+        </select>
+    </td>
+    <td></td>
+</tr>
+<tr>
+    <td colspan="2" style="height:15px"></td>
+</tr>
+<!-- Relative periods -->
+
+<tr>
+	<th colspan="2">$i18n.getString( "relative_periods" )</th>
+</tr>
+<tr>
+	<td>
+	    <label for="reportingMonth">$i18n.getString( "reporting_month" )</label>
+		<input type="checkbox" id="reportingMonth" name="reportingMonth" value="true"#if( $chart.relatives.isReportingMonth() ) checked#end>&nbsp;
+		<label for="monthsThisYear">$i18n.getString( "months_this_year" )</label>
+		<input type="checkbox" id="monthsThisYear" name="monthsThisYear" value="true""#if( $chart.relatives.isMonthsThisYear() ) checked#end>&nbsp;
+		<label for="quartersThisYear">$i18n.getString( "quarters_this_year" )</label>
+		<input type="checkbox" id="quartersThisYear" name="quartersThisYear" value="true"#if( $chart.relatives.isQuartersThisYear() ) checked#end>&nbsp;
+		<label for="thisYear">$i18n.getString( "this_year" )</label>
+		<input type="checkbox" id="thisYear" name="thisYear" value="true"#if( $chart.relatives.isThisYear() ) checked#end><br><br>
+		
+		<label for="monthsLastYear">$i18n.getString( "months_last_year" )</label>
+		<input type="checkbox" id="monthsLastYear" name="monthsLastYear" value="true""#if( $chart.relatives.isMonthsLastYear() ) checked#end>&nbsp;
+		<label for="quartersLastYear">$i18n.getString( "quarters_last_year" )</label>
+		<input type="checkbox" id="quartersLastYear" name="quartersLastYear" value="true"#if( $chart.relatives.isQuartersLastYear() ) checked#end>&nbsp;
+		<label for="lastYear">$i18n.getString( "last_year" )</label>
+		<input type="checkbox" id="lastYear" name="lastYear" value="true"#if( $chart.relatives.isLastYear() ) checked#end>         
+    </td>
+</tr>
+<tr>
+    <td style="height:15px"></td>
+</tr>
+<!-- Data elements -->
+    <tr>
+        <th colspan="2">$i18n.getString( "value_x_available_dataelements" )</th>
+    </tr>
+    <tr>
+        <td colspan="2">
+            <select id="dataElementGroupId" name="dataElementGroupId" style="min-width:600px" onchange="getDataElements()">
+                <option value="$ALL">[ $i18n.getString( "select_dataelementgroup_all" ) ]</option>
+                #foreach ( $group in $dataElementGroups )
+                    <option value="$group.id">$group.name</option>
+                #end
+            </select>
+        </td>
+        <td></td>
+    </tr>
+    <tr>
+        <td colspan="2">
+            <select multiple size="6" id="availableDataElements" name="availableDataElements" style="min-width:600px" ondblclick="moveSelectedById( 'availableDataElements', 'selectedDataElements' )">             
+                #foreach ( $dataElement in $availableDataElements )
+                    <option value="$dataElement.id">$dataElement.name</option>
+                #end
+            </select>
+        </td>
+    </tr>
+    <tr>
+        <td colspan="2">
+            <input type="button" value="$i18n.getString( 'add_selected' )" title="$i18n.getString( 'add_selected' )" style="width:120px" onclick="moveSelectedById( 'availableDataElements', 'selectedDataElements' )" />
+            <input type="button" value="$i18n.getString( 'add_all' )" title="$i18n.getString( 'add_all' )" style="width:120px" onclick="moveAllById( 'availableDataElements', 'selectedDataElements' )" />
+			<input type="button" value="$i18n.getString( 'remove_selected' )" title="$i18n.getString( 'remove_selected' )" style="width:120px" onclick="moveSelectedById( 'selectedDataElements', 'availableDataElements' )" />
+			<input type="button" value="$i18n.getString( 'remove_all' )" title="$i18n.getString( 'remove_all' )" style="width:120px" onclick="moveAllById( 'selectedDataElements', 'availableDataElements' )" />
+        </td>
+    </tr>
+
+    <tr>
+        <th colspan="2">$i18n.getString( "value_x_selected_dataelements" )</th>
+    </tr>
+
+    <tr>
+        <td>
+            <select multiple size="6" id="selectedDataElements" name="selectedDataElements" style="min-width:600px" ondblclick="moveSelectedById( 'selectedDataElements', 'availableDataElements' )">
+                #foreach( $dataElement in $selectedDataElements )
+                    <option value="$dataElement.id">$dataElement.name</option>
+                #end
+            </select>                  
+        </td>
+        <td>
+            <a href="#" onclick="moveUpSelectedOption( 'selectedDataElements' )"><img src="../images/move_up.png" border="0" alt=""></a><br><br>
+            <a href="#" onclick="moveDownSelectedOption( 'selectedDataElements' )"><img src="../images/move_down.png" border="0" alt=""></a>        
+        </td>
+    </tr>
+    <tr>
+        <td colspan="2" style="height:15px"></td>
+    </tr>
+
+<!-- OrganisationUnit -->
+
+<tr>
+    <th colspan="2">$i18n.getString( "filter_available_organisationunits" ) - <a href="javascript:clearListById( 'selectedOrganisationUnits' )">$i18n.getString( 'clear' )</a></th>
+</tr>
+
+<tr>
+    <td colspan="2">
+        <select id="organisationUnitLevel" name="organisationUnitLevel" style="min-width:600px" onchange="getOrganisationUnitsToSelected()">
+            <option value="$ALL">[ $i18n.getString( "select_organisationunit_level_all" ) ]</option>
+            #foreach ( $level in $levels )
+                <option value="$level.level">$encoder.htmlEncode( $level.name )</option>
+            #end
+        </select>
+    </td>
+</tr>
+<tr>
+    <td colspan="2">
+        <select id="selectedOrganisationUnits" name="selectedOrganisationUnits" style="min-width:600px">               
+            #foreach ( $unit in $selectedOrganisationUnits )
+                <option value="$unit.id">$unit.name</option>
+            #end
+        </select>
+    </td>
+</tr>
+	
+</table>

=== added file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementOrgunitOrPeriodForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementOrgunitOrPeriodForm.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartDataElementOrgunitOrPeriodForm.vm	2011-06-07 16:12:23 +0000
@@ -0,0 +1,75 @@
+<table>
+
+    <col>       
+    <col width="16">
+    	
+    <!-- Data elements -->
+    <tr>
+        <th colspan="2">$i18n.getString( "value_y_available_dataelements" )</th>
+    </tr>
+    <tr>
+        <td colspan="2">
+            <select id="dataElementGroupId" name="dataElementGroupId" style="min-width:600px" onchange="getDataElements()">
+                <option value="$ALL">[ $i18n.getString( "select_dataelementgroup_all" ) ]</option>
+                #foreach ( $group in $dataElementGroups )
+                    <option value="$group.id">$group.name</option>
+                #end
+            </select>
+        </td>
+        <td></td>
+    </tr>
+    <tr>
+        <td colspan="2">
+            <select multiple size="6" id="availableDataElements" name="availableDataElements" style="min-width:600px" ondblclick="moveSelectedById( 'availableDataElements', 'selectedDataElements' )">             
+                #foreach ( $dataElement in $availableDataElements )
+                    <option value="$dataElement.id">$dataElement.name</option>
+                #end
+            </select>
+        </td>
+    </tr>
+
+    <tr>
+        <td colspan="2">
+            <input type="button" value="$i18n.getString( 'add_selected' )" title="$i18n.getString( 'add_selected' )" style="width:120px" onclick="moveSelectedById( 'availableDataElements', 'selectedDataElements' )" />
+            <input type="button" value="$i18n.getString( 'add_all' )" title="$i18n.getString( 'add_all' )" style="width:120px" onclick="moveAllById( 'availableDataElements', 'selectedDataElements' )" />
+            <input type="button" value="$i18n.getString( 'remove_selected' )" title="$i18n.getString( 'remove_selected' )" style="width:120px" onclick="moveSelectedById( 'selectedDataElements', 'availableDataElements' )" />
+			<input type="button" value="$i18n.getString( 'remove_all' )" title="$i18n.getString( 'remove_all' )" style="width:120px" onclick="moveAllById( 'selectedDataElements', 'availableDataElements' )" />
+        </td>
+    </tr>
+
+    <tr>
+        <th colspan="2">$i18n.getString( "value_y_selected_dataelements" )</th>
+    </tr>
+
+    <tr>
+        <td>
+            <select multiple size="6" id="selectedDataElements" name="selectedDataElements" style="min-width:600px" ondblclick="moveSelectedById( 'selectedDataElements', 'availableDataElements' )">
+                #foreach( $dataElement in $selectedDataElements )
+                    <option value="$dataElement.id">$dataElement.name</option>
+                #end
+            </select>                  
+        </td>
+        <td>
+            <a href="#" onclick="moveUpSelectedOption( 'selectedDataElements' )"><img src="../images/move_up.png" border="0" alt=""></a><br><br>
+            <a href="#" onclick="moveDownSelectedOption( 'selectedDataElements' )"><img src="../images/move_down.png" border="0" alt=""></a>        
+        </td>
+    </tr>
+    <tr>
+        <td colspan="2" style="height:15px"></td>
+    </tr>
+    
+    <!-- Category -->
+
+    #if ( $dimension == "period_dataElement" )
+    	#parse( "dhis-web-reporting/addChartPeriodModeForm.vm" )
+    #else
+        #parse( "dhis-web-reporting/addChartOrganisationUnitModeForm.vm" )
+    #end    
+    
+    <tr>
+        <td colspan="2" style="height:15px"></td>
+    </tr>
+	
+</table>
+
+</form>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartForm.vm	2011-05-02 12:54:28 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartForm.vm	2011-06-07 16:12:23 +0000
@@ -18,6 +18,7 @@
 	});
 
     var i18n_must_select_at_least_one_indicator = '$encoder.jsEscape( $i18n.getString( "must_select_at_least_one_indicator" ), "'")';
+    var i18n_must_select_at_least_one_dataelement = '$encoder.jsEscape( $i18n.getString( "must_select_at_least_one_dataelement" ), "'")';
     var i18n_must_select_at_least_one_unit = '$encoder.jsEscape( $i18n.getString( "must_select_at_least_one_unit" ), "'")';
     var i18n_must_select_at_least_one_period = '$encoder.jsEscape( $i18n.getString( "must_select_at_least_one_period" ), "'")';
 	var i18n_target_line_value_must_be_provided = '$encoder.jsEscape( $i18n.getString( "target_line_value_must_be_provided" ), "'")';
@@ -27,10 +28,16 @@
 #macro ( getHeader )
 	#if ( $dimension == "period" )
 		$i18n.getString( "create_indicator_by_period_chart" )
+	#elseif( $dimension == "period_dataElement" )
+		$i18n.getString( "create_dataelement_by_period_chart" )
 	#elseif ( $dimension == "organisationUnit" )
 	    $i18n.getString( "create_indicator_by_organisation_unit_chart" )
+	#elseif ( $dimension == "organisationUnit_dataElement" )
+	    $i18n.getString( "create_dataelement_by_organisation_unit_chart" )
 	#elseif ( $dimension == "indicator" )
 	    $i18n.getString( "create_period_by_indicator_chart" )
+	#elseif ( $dimension == "dataElement_period" )
+	    $i18n.getString( "create_period_by_dataelement_chart" )
 	#end
 #end
 
@@ -111,17 +118,26 @@
     </tr>
 </table>
 
-#if ( $dimension == "indicator" )
+#if ( $dimension == "period" )
+	#parse( "dhis-web-reporting/addChartOrgunitOrPeriodForm.vm" )
+#elseif( $dimension == "period_dataElement" )
+	#parse( "dhis-web-reporting/addChartDataElementOrgunitOrPeriodForm.vm" )
+#elseif ( $dimension == "organisationUnit" )
+	#parse( "dhis-web-reporting/addChartOrgunitOrPeriodForm.vm" )
+#elseif ( $dimension == "organisationUnit_dataElement" )
+	#parse( "dhis-web-reporting/addChartDataElementOrgunitOrPeriodForm.vm" )
+#elseif ( $dimension == "indicator" )
     #parse( "dhis-web-reporting/addChartIndicatorModeForm.vm" )
-#else 
-	#parse( "dhis-web-reporting/addChartOrgunitOrPeriodForm.vm" )
+#elseif ( $dimension == "dataElement_period" )
+	#parse( "dhis-web-reporting/addChartDataElementModeForm.vm" )
 #end
+
 <table>
     <!-- Submit -->
     
     <tr>        
         <td colspan="2">
-            <input type="button" value="$i18n.getString( 'save' )"onclick="saveChart()" style="width:120px" />
+            <input type="button" value="$i18n.getString( 'save' )" onclick="saveChart()" style="width:120px" />
             <input type="button" value="$i18n.getString( 'back' )" onclick="javascript:window.location.href='displayViewChartForm.action'" style="width:120px" />
         </td>
     </tr>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js	2011-04-15 13:48:42 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js	2011-06-07 16:12:23 +0000
@@ -1,11 +1,12 @@
-
 // -----------------------------------------------------------------------------
 // View chart
 // -----------------------------------------------------------------------------
 
 function viewChart( url )
 {
-    window.open( url, "_blank", "directories=no, height=560, width=760, location=no, menubar=no, status=no, toolbar=no, resizable=yes, scrollbars=yes" );
+    window
+            .open(url, "_blank",
+                    "directories=no, height=560, width=760, location=no, menubar=no, status=no, toolbar=no, resizable=yes, scrollbars=yes");
 }
 
 // -----------------------------------------------------------------------------
@@ -14,7 +15,7 @@
 
 function removeChart( chartId, chartTitle )
 {
-	removeItem( chartId, chartTitle, i18n_confirm_delete, "removeChart.action" );
+    removeItem(chartId, chartTitle, i18n_confirm_delete, "removeChart.action");
 }
 
 // -----------------------------------------------------------------------------
@@ -24,19 +25,19 @@
 function showChartDetails( chartId )
 {
     var request = new Request();
-    request.setResponseTypeXML( 'chart' );
-    request.setCallbackSuccess( chartReceived );
-    request.send( 'getChart.action?id=' + chartId );
+    request.setResponseTypeXML('chart');
+    request.setCallbackSuccess(chartReceived);
+    request.send('getChart.action?id=' + chartId);
 }
 
 function chartReceived( xmlObject )
 {
-    setInnerHTML( 'titleField', getElementValue( xmlObject, 'title' ) );
-    setInnerHTML( 'dimensionField', getElementValue( xmlObject, 'dimension' ) );
-    setInnerHTML( 'indicatorsField', getElementValue( xmlObject, 'indicators' ) );
-    setInnerHTML( 'periodsField', getElementValue( xmlObject, 'periods' ) );
-    setInnerHTML( 'organisationUnitsField', getElementValue( xmlObject, 'organisationUnits' ) );
-    
+    setInnerHTML('titleField', getElementValue(xmlObject, 'title'));
+    setInnerHTML('dimensionField', getElementValue(xmlObject, 'dimension'));
+    setInnerHTML('indicatorsField', getElementValue(xmlObject, 'indicators'));
+    setInnerHTML('periodsField', getElementValue(xmlObject, 'periods'));
+    setInnerHTML('organisationUnitsField', getElementValue(xmlObject, 'organisationUnits'));
+
     showDetails();
 }
 
@@ -46,74 +47,66 @@
 
 function saveChart()
 {
-    if ( validateTargetLine() && validateCollections() )
+    if (validateTargetLine() && validateCollections())
     {
-        var url = "validateChart.action?id=" + getFieldValue( "id" ) + "&title=" + getFieldValue( "title" );
+        var url = "validateChart.action?id=" + getFieldValue("id") + "&title=" + getFieldValue("title");
 
         var request = new Request();
-        request.setResponseTypeXML( 'message' );
-        request.setCallbackSuccess( saveChartReceived );
-        request.send( url );
+        request.setResponseTypeXML('message');
+        request.setCallbackSuccess(saveChartReceived);
+        request.send(url);
     }
 }
 
 function saveChartReceived( messageElement )
 {
-    var type = messageElement.getAttribute( 'type' );
+    var type = messageElement.getAttribute('type');
     var message = messageElement.firstChild.nodeValue;
-    var dimension = document.getElementById( "dimension" ).value;
+    var dimension = document.getElementById("dimension").value;
 
-    if ( type == "input" )
+    if (type == "input")
     {
-        setMessage( message );
-        
+        setMessage(message);
+
         return false;
-    }
-    else if ( type == "success" )
+    } else if (type == "success")
     {
-        selectAllById( "selectedIndicators" );
-        
-        if ( dimension == "period" || dimension == "indicator")
-        {
-            selectAllById( "selectedPeriods" );
-        }
-        else if ( dimension == "organisationUnit" )
-        {        
-            selectAllById( "selectedOrganisationUnits" );
-        }
-        
-        document.getElementById( "chartForm" ).submit();
+        $("#selectedIndicators").children().attr("selected", true);
+        $("#selectedDataElements").children().attr("selected", true);
+        $("#selectedPeriods").children().attr("selected", true);
+        $("#selectedOrganisationUnits").children().attr("selected", true);
+        $('#chartForm').submit();
     }
 }
 
 function selectedChartType()
 {
-	return $("#type").val();
+    return $("#type").val();
 }
 
 function selectedIndicatorsCount()
 {
-	return $("#selectedIndicators option").length;
+    return $("#selectedIndicators option").length;
 }
 
 function validateTargetLine()
 {
     var targetLine = $("#targetLine").attr("checked");
 
-    if( targetLine )
+    if (targetLine)
     {
-        var targetLineValue = $("#targetLineValue").val(); 
-        
-        if( targetLineValue.length == 0)
+        var targetLineValue = $("#targetLineValue").val();
+
+        if (targetLineValue.length == 0)
         {
-            setMessage( i18n_target_line_value_must_be_provided );
+            setMessage(i18n_target_line_value_must_be_provided);
 
             return false;
         }
 
-        if( isNaN( targetLineValue ) )
+        if (isNaN(targetLineValue))
         {
-            setMessage( i18n_target_line_value_must_be_number );
+            setMessage(i18n_target_line_value_must_be_number);
 
             return false;
         }
@@ -124,24 +117,24 @@
 
 function validateCollections()
 {
-    if ( !hasElements( "selectedIndicators" ) )
-    {
-        setMessage( i18n_must_select_at_least_one_indicator );
-
-        return false;
-    }
-
-    if ( !hasElements( "selectedOrganisationUnits" ) && !isChecked( "userOrganisationUnit" ) )
-    {
-        setMessage( i18n_must_select_at_least_one_unit );
-
-        return false;
-    }
-
-    if ( !hasElements( "selectedPeriods" ) && !relativePeriodsChecked() )
-    {
-        setMessage( i18n_must_select_at_least_one_period );
-        
+    if (!hasElements("selectedIndicators") && !hasElements("selectedDataElements"))
+    {
+        setMessage(i18n_must_select_at_least_one_indicator);
+
+        return false;
+    }
+
+    if (!hasElements("selectedOrganisationUnits") && !isChecked("userOrganisationUnit"))
+    {
+        setMessage(i18n_must_select_at_least_one_unit);
+
+        return false;
+    }
+
+    if (!hasElements("selectedPeriods") && !relativePeriodsChecked())
+    {
+        setMessage(i18n_must_select_at_least_one_period);
+
         return false;
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm	2011-06-01 11:39:43 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm	2011-06-07 16:12:23 +0000
@@ -25,8 +25,11 @@
                     <td align="right">
                     	<select id="chart_type">
                     		<option value='period'>$i18n.getString( 'period_by_indicator_chart' )</option>
+                    		<option value='period_dataElement'>$i18n.getString( 'period_by_dataelement_chart' )</option>
                     		<option value='organisationUnit'>$i18n.getString( 'indicator_by_organisation_unit_chart' )</option>
+                    		<option value='organisationUnit_dataElement'>$i18n.getString( 'dataelement_by_organisation_unit_chart' )</option>
                     		<option value='indicator'>$i18n.getString( 'indicator_by_period_chart' )</option>
+                    		<option value='dataElement_period'>$i18n.getString( 'dataelement_by_period_chart' )</option>
                     	</select>
                     	<button type="button" id="add_chart">$i18n.getString( 'add' )</button>
                     </td>