← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2585: Added Functionality to View CumulativeChart/Targetwise Chart

 

------------------------------------------------------------
revno: 2585
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-01-17 12:26:53 +0530
message:
  Added Functionality to View CumulativeChart/Targetwise Chart
added:
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportTargetDataToExcelAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisDataAction.java
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/deTargetAnalysisResult.vm
modified:
  dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/api/DefaultMobileImportService.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisFormAction.java
  local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-dashboard/src/main/resources/struts.xml
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/tr.js
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForTarget.vm
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisResult.vm
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/targetAnalysisFront.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-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/api/DefaultMobileImportService.java'
--- dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/api/DefaultMobileImportService.java	2010-12-30 05:17:07 +0000
+++ dhis-mobile/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/api/DefaultMobileImportService.java	2011-01-17 06:56:53 +0000
@@ -64,6 +64,8 @@
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.period.PeriodType;
+import org.hisp.dhis.period.WeeklyPeriodType;
+import org.hisp.dhis.period.YearlyPeriodType;
 import org.hisp.dhis.source.Source;
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.user.UserCredentials;
@@ -210,24 +212,30 @@
 
         SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
 
-        List<Period> monthlyPeriods = null;
+        List<Period> periods = null;
         PeriodType pt = null;
         if ( periodType.equals( "3" ) )
         {
             pt = new MonthlyPeriodType();
-            monthlyPeriods = new ArrayList<Period>( periodService.getPeriodsByPeriodType( pt ) );
-
-        }
-        else
-        {
-            if ( periodType.equals( "1" ) )
-            {
-                pt = new DailyPeriodType();
-                monthlyPeriods = new ArrayList<Period>( periodService.getPeriodsByPeriodType( pt ) );
-            }
-        }
-
-        for ( Period period : monthlyPeriods )
+            periods = new ArrayList<Period>( periodService.getPeriodsByPeriodType( pt ) );
+        }
+        else if ( periodType.equals( "1" ) )
+        {
+            pt = new DailyPeriodType();
+            periods = new ArrayList<Period>( periodService.getPeriodsByPeriodType( pt ) );
+        }
+        else if( periodType.equals( "6" ) )
+        {
+            pt = new YearlyPeriodType();
+            periods =  new ArrayList<Period>( periodService.getPeriodsByPeriodType( pt ) );
+        }
+        else if( periodType.equals( "2" ) )
+        {
+            pt = new WeeklyPeriodType();
+            periods =  new ArrayList<Period>( periodService.getPeriodsByPeriodType( pt ) );
+        }
+        
+        for ( Period period : periods )
         {
             String tempDate = dateFormat.format( period.getStartDate() );
             if ( tempDate.equalsIgnoreCase( startDate ) )

=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportTargetDataToExcelAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportTargetDataToExcelAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportTargetDataToExcelAction.java	2011-01-17 06:56:53 +0000
@@ -0,0 +1,257 @@
+package org.hisp.dhis.dataanalyser.action;
+
+import java.awt.image.BufferedImage;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.List;
+import java.util.UUID;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import jxl.Workbook;
+import jxl.format.Alignment;
+import jxl.format.Border;
+import jxl.format.BorderLineStyle;
+import jxl.format.Colour;
+import jxl.format.VerticalAlignment;
+import jxl.write.Label;
+import jxl.write.Number;
+import jxl.write.WritableCellFormat;
+import jxl.write.WritableFont;
+import jxl.write.WritableImage;
+import jxl.write.WritableSheet;
+import jxl.write.WritableWorkbook;
+
+import org.apache.struts2.ServletActionContext;
+import org.hisp.dhis.config.ConfigurationService;
+import org.hisp.dhis.config.Configuration_IN;
+import org.hisp.dhis.survey.Survey;
+
+import com.keypoint.PngEncoder;
+import com.opensymphony.xwork2.Action;
+import com.opensymphony.xwork2.ActionContext;
+
+public class ExportTargetDataToExcelAction implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private ConfigurationService configurationService;
+
+    public void setConfigurationService( ConfigurationService configurationService )
+    {
+        this.configurationService = configurationService;
+    }
+    
+    // -------------------------------------------------------------------------
+    // Input & output
+    // -------------------------------------------------------------------------
+    
+    double[][] data1;
+
+    double[][] numDataArray;
+    
+    double[][] denumDataArray;
+    
+    double[][] data2;
+
+    String[] series1;
+
+    String[] series2;
+
+    String[] categories1;
+
+    String[] categories2;
+    
+    List<Survey> surveyList;
+
+    
+    private InputStream inputStream;
+
+    public InputStream getInputStream()
+    {
+        return inputStream;
+    }
+
+    private String fileName;
+
+    public String getFileName()
+    {
+        return fileName;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {   
+        int tempCol1 = 0;
+        int tempRow1 = 1;
+        
+        ActionContext ctx = ActionContext.getContext();
+        HttpServletRequest req = (HttpServletRequest) ctx.get( ServletActionContext.HTTP_REQUEST );                        
+        HttpSession session = req.getSession();
+        BufferedImage chartImage = (BufferedImage) session.getAttribute("chartImage");
+        PngEncoder encoder = new PngEncoder(chartImage, false, 0, 9);
+        
+        byte[] encoderBytes = encoder.pngEncode();
+        Double[][] objData1 = (Double[][]) session.getAttribute( "data1" );
+        Double[][] objData2 = (Double[][]) session.getAttribute( "data2" );
+        
+        String[] series1S = (String[]) session.getAttribute( "series1" );
+        String[] series2S = (String[]) session.getAttribute( "series2" );
+        String[] categories1S = (String[]) session.getAttribute( "categories1" );
+        String[] categories2S = (String[]) session.getAttribute( "categories2" );
+        
+        initialzeAllLists( series1S, series2S, categories1S, categories2S );
+        
+        if( objData1 == null || objData2 == null || series1 == null || series2 == null || categories1 == null || categories2 == null )
+            System.out.println("Session Objects are null");
+        else
+            System.out.println("Session Objects are not null");
+        
+        data1 = convertDoubleTodouble( objData1 );
+        
+        data2 = convertDoubleTodouble( objData2 );
+        
+        String outputReportFile = System.getenv( "DHIS2_HOME" ) + File.separator + configurationService.getConfigurationByKey( Configuration_IN.KEY_REPORTFOLDER ).getValue()
+          + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+               
+        WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File(outputReportFile) );
+        WritableSheet sheet0 = outputReportWorkbook.createSheet( "TargetChartOutput", 0 );
+        
+        WritableImage writableImage = new WritableImage(0,1,10,23,encoderBytes);
+        sheet0.addImage( writableImage );
+        tempRow1 = 24;
+        
+        tempCol1 = 0;
+        tempRow1++;
+        WritableCellFormat wCellformat1 = new WritableCellFormat();                            
+        wCellformat1.setBorder( Border.ALL, BorderLineStyle.THIN );
+        wCellformat1.setAlignment( Alignment.CENTRE );
+        wCellformat1.setVerticalAlignment( VerticalAlignment.CENTRE );
+        wCellformat1.setWrap( true );
+    
+        WritableCellFormat wCellformat2 = new WritableCellFormat();                            
+        wCellformat2.setBorder( Border.ALL, BorderLineStyle.THIN );
+        wCellformat2.setAlignment( Alignment.CENTRE );
+        wCellformat2.setVerticalAlignment( VerticalAlignment.TOP);
+        wCellformat2.setBackground( Colour.GRAY_25 );                
+        wCellformat2.setWrap( true );
+        
+        WritableFont wfobj2 = new WritableFont( WritableFont.ARIAL, 10, WritableFont.BOLD );
+        WritableCellFormat wcf = new WritableCellFormat( wfobj2 );
+        wcf.setBorder( Border.ALL, BorderLineStyle.THIN );
+        wcf.setAlignment( Alignment.CENTRE );
+        wcf.setVerticalAlignment( VerticalAlignment.CENTRE );
+        wcf.setWrap( true );
+        
+        sheet0.addCell( new Label( tempCol1, tempRow1, "DataElement", wCellformat2) );
+ 
+         for(int i=0; i< categories1.length; i++)
+         {   
+             sheet0.addCell( new Label( tempCol1+1, tempRow1, categories1[i], wCellformat2) );
+             tempCol1++;
+         }
+         
+         tempRow1 = tempRow1+1;
+        
+         //int tempRowValue = 0;
+         
+         for(int j=0; j< series1.length; j++)
+         {
+             tempCol1 = 0;
+             sheet0.addCell( new Label( tempCol1, tempRow1, series1[j], wCellformat2) );
+             
+             int temColValue = 0;
+           
+             int tempValueCol = temColValue;
+           
+             tempValueCol = tempValueCol+1;
+             
+             for( int k=0; k< categories1.length; k++ )
+             { 
+                 sheet0.addCell( new Number( tempValueCol, tempRow1, data1[j][k], wcf ) );
+                 tempValueCol++;
+             }
+            tempRow1++;
+         }
+         
+         tempRow1++;
+         
+         for(int j=0; j< series2.length; j++)
+         {
+             tempCol1 = 0;
+             sheet0.addCell( new Label( tempCol1, tempRow1, series2[j], wCellformat2) );
+             
+             int tempValueCol = 1;
+           
+             for( int k=0; k< categories1.length; k++ )
+             { 
+                 sheet0.addCell( new Number( tempValueCol, tempRow1, data2[j][k], wcf ) );
+                 tempValueCol++;
+             }
+             
+             tempRow1++;
+         }
+         
+         
+        outputReportWorkbook.write();
+        outputReportWorkbook.close();
+
+        fileName = "Target_ChartOutput.xls";
+                
+        inputStream = new BufferedInputStream( new FileInputStream( outputReportFile ) );
+
+        return SUCCESS;
+    }
+    
+    
+    public void initialzeAllLists(String[]series1S, String[] series2S, String[] categories1S, String[] categories2S)
+    {
+        int i;
+        series1 = new String[series1S.length];
+        series2 = new String[series2S.length];
+        categories1 = new String[categories1S.length];
+        categories2 = new String[categories2S.length];
+        
+        for(i = 0; i < series1S.length; i++)
+        {
+            series1[i] = series1S[i];
+        }
+        for(i = 0; i < series2S.length; i++)
+        {
+            series2[i] = series2S[i];
+        }
+        for(i = 0; i < categories1S.length; i++)
+        {
+            categories1[i] = categories1S[i];
+        }
+        for(i = 0; i < categories2S.length; i++)
+        {
+            categories2[i] = categories2S[i];
+        }
+    }
+    
+    public double[][] convertDoubleTodouble( Double[][] objData )
+    {
+        double[][] data = new double[objData.length][objData[0].length];
+        
+        for ( int i = 0; i < objData.length; i++ )
+        {
+            for ( int j = 0; j < objData[0].length; j++ )
+            {
+                data[i][j] = objData[i][j].doubleValue();
+            }
+        }
+
+        return data;
+    }// convertDoubleTodouble end
+
+}

=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisDataAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisDataAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisDataAction.java	2011-01-17 06:56:53 +0000
@@ -0,0 +1,372 @@
+package org.hisp.dhis.dataanalyser.tr.action;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.amplecode.quick.StatementManager;
+import org.apache.struts2.ServletActionContext;
+import org.apache.velocity.tools.generic.ListTool;
+import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.dataanalyser.util.SurveyChartResult;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.detarget.DeTarget;
+import org.hisp.dhis.detarget.DeTargetMember;
+import org.hisp.dhis.detarget.DeTargetService;
+import org.hisp.dhis.detargetdatavalue.DeTargetDataValueService;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.period.MonthlyPeriodType;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.YearlyPeriodType;
+
+import com.opensymphony.xwork2.Action;
+import com.opensymphony.xwork2.ActionContext;
+
+public class GenerateTargetAnalysisDataAction implements Action
+{
+    // ---------------------------------------------------------------
+    // Dependencies
+    // ---------------------------------------------------------------
+
+    private StatementManager statementManager;
+
+    public void setStatementManager( StatementManager statementManager )
+    {
+        this.statementManager = statementManager;
+    }
+
+    private OrganisationUnitService organisationUnitService;
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
+    private DataElementCategoryService dataElementCategoryService;
+
+    public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService )
+    {
+        this.dataElementCategoryService = dataElementCategoryService;
+    }
+
+    private DataElementService dataElementService;
+
+    public void setDataElementService( DataElementService dataElementService )
+    {
+        this.dataElementService = dataElementService;
+    }
+    
+    private AggregationService aggregationService;
+
+    public void setAggregationService( AggregationService aggregationService )
+    {
+        this.aggregationService = aggregationService;
+    }
+
+    private PeriodService periodService;
+
+    public void setPeriodService( PeriodService periodService )
+    {
+        this.periodService = periodService;
+    }
+
+    private DeTargetService deTargetService;
+
+    public void setDeTargetService( DeTargetService deTargetService )
+    {
+        this.deTargetService = deTargetService;
+    }
+
+    private DeTargetDataValueService deTargetDataValueService;
+    
+    public void setDeTargetDataValueService( DeTargetDataValueService deTargetDataValueService )
+    {
+        this.deTargetDataValueService = deTargetDataValueService;
+    }
+    
+    private OrganisationUnitGroupService organisationUnitGroupService;
+    
+    public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService )
+    {
+        this.organisationUnitGroupService = organisationUnitGroupService;
+    }
+    
+    // ---------------------------------------------------------------
+    // Input & Output
+    // ---------------------------------------------------------------
+
+    private SurveyChartResult surveyChartResult;
+    
+    public SurveyChartResult getSurveyChartResult()
+    {
+        return surveyChartResult;
+    }
+
+
+    private ListTool listTool;
+
+    public ListTool getListTool()
+    {
+        return listTool;
+    }
+
+    private String availableDataElements;
+
+    public void setAvailableDataElements( String availableDataElements )
+    {
+        this.availableDataElements = availableDataElements;
+    }
+
+    private int ouIDTB;
+
+    public void setOuIDTB( int ouIDTB )
+    {
+        this.ouIDTB = ouIDTB;
+    }
+
+    private int sDateLB;
+
+    public void setSDateLB( int dateLB )
+    {
+        sDateLB = dateLB;
+    }
+
+    private int eDateLB;
+
+    public void setEDateLB( int dateLB )
+    {
+        eDateLB = dateLB;
+    }
+
+    private String ougGroupSetCB;
+
+    public void setOugGroupSetCB( String ougGroupSetCB )
+    {
+        this.ougGroupSetCB = ougGroupSetCB;
+    }
+
+    private Integer orgUnitGroupList;
+    
+    public void setOrgUnitGroupList( Integer orgUnitGroupList )
+    {
+        this.orgUnitGroupList = orgUnitGroupList;
+    }
+
+    private String selButton;
+    
+    public void setSelButton( String selButton )
+    {
+        this.selButton = selButton;
+    }
+
+    private List<DeTargetMember> deTargetMemberList;
+
+    private List<Period> monthlyPeriods;
+
+    private OrganisationUnit selectedOrgUnit;
+
+    private DataElement selectedDataElement;
+    
+    private DataElementCategoryOptionCombo selDECOptCombo;
+    
+    private Period startPeriod;
+    
+    private Period endPeriod;
+
+    private String[] series1;
+    private String[] categories1;
+    private String[] series2;
+    private String[] categories2;
+    String chartTitle;
+    String xAxis_Title;
+    String yAxis_Title;
+    Double data1[][];
+    Double data2[][];
+
+    public String execute()
+        throws Exception
+    {
+        statementManager.initialise();
+
+        listTool = new ListTool();
+        
+        // OrgUnit Related Info
+        selectedOrgUnit = organisationUnitService.getOrganisationUnit( ouIDTB );
+
+        // Service Related Info
+        String[] partsOfDEandOptionCombo = availableDataElements.split(":");
+        selectedDataElement = dataElementService.getDataElement( Integer.parseInt( partsOfDEandOptionCombo[0] ) );
+        selDECOptCombo = dataElementCategoryService.getDataElementCategoryOptionCombo( Integer.parseInt( partsOfDEandOptionCombo[1] ) );
+
+        chartTitle = "Facility : " + selectedOrgUnit.getShortName();
+        chartTitle += "\nDataElement : " + selectedDataElement.getName() + " " + selDECOptCombo.getName();
+
+        deTargetMemberList = new ArrayList<DeTargetMember>( deTargetService.getDeTargetsByDataElementAndCategoryOptionCombo( selectedDataElement, selDECOptCombo ) );
+
+        // Period Related Info
+        startPeriod = periodService.getPeriod( sDateLB );
+        endPeriod = periodService.getPeriod( eDateLB );
+
+        monthlyPeriods = new ArrayList<Period>( periodService.getPeriodsBetweenDates( new MonthlyPeriodType(), startPeriod.getStartDate(), endPeriod.getEndDate() ) );
+        List<Period> yearlyPeriods = new ArrayList<Period>( periodService.getIntersectingPeriodsByPeriodType( new YearlyPeriodType(), startPeriod.getStartDate(), endPeriod.getEndDate() ) );
+        
+        data1 = getServiceValuesByPeriod();
+        
+        xAxis_Title = "Period";
+        yAxis_Title = "DataElement";
+       
+        if( deTargetMemberList == null || deTargetMemberList.size() <= 0 )
+        {
+            data2 = new Double[1][monthlyPeriods.size()];
+            series2 = new String[1];
+            for ( int i = 0; i < data2.length; i++ )
+            {
+                series2[i] = "No Targets";
+                
+                for ( int j = 0; j < data2[i].length; j++ )
+                {
+                    data2[i][j] = 0.0;
+                }
+            }
+        }
+        else
+        {
+            data2 = new Double[deTargetMemberList.size()][monthlyPeriods.size()];
+            series2 = new String[deTargetMemberList.size()];
+            for ( int i = 0; i < data2.length; i++ )
+            {
+                DeTargetMember deTargetMember = deTargetMemberList.get( i );
+                DeTarget deTarget = deTargetMember.getDetarget();
+                
+                Double deTargetAggVal = 0.0;
+                for( Period period : yearlyPeriods )
+                {
+                    Double deTargetAggValue = deTargetDataValueService.getAggregatedDeTargetDataValue( selectedOrgUnit, deTarget, period, selectedDataElement, selDECOptCombo );
+                 
+                    if ( deTargetAggValue != null )
+                    {
+                        deTargetAggVal +=  deTargetAggValue;
+                    }
+                }
+                
+                deTargetAggVal = deTargetAggVal/ (12 * yearlyPeriods.size());
+                
+                series2[i] = deTarget.getName();
+                
+                for ( int j = 0; j < data2[i].length; j++ )
+                {
+                    if( selButton.equalsIgnoreCase( "VIEWCCHART" ) )
+                    {
+                        deTargetAggVal = deTargetAggVal * (j+1); 
+                    }
+                    
+                    data2[i][j] = deTargetAggVal;
+                }
+            }
+        }
+        
+        surveyChartResult = new SurveyChartResult( series1, series2,categories1, categories2, data1, data2, null, null, chartTitle, xAxis_Title, yAxis_Title );
+        
+        ActionContext ctx = ActionContext.getContext();
+        HttpServletRequest req = (HttpServletRequest) ctx.get( ServletActionContext.HTTP_REQUEST );
+
+        HttpSession session = req.getSession();
+        session.setAttribute( "data1", data1 );
+        session.setAttribute( "data2", data2 );
+        session.setAttribute( "series1", series1 );
+        session.setAttribute( "categories1", categories1 );
+        session.setAttribute( "series2", series2 );
+        session.setAttribute( "categories2", categories2 );
+        session.setAttribute( "chartTitle", chartTitle );
+        session.setAttribute( "xAxisTitle", xAxis_Title );
+        session.setAttribute( "yAxisTitle", yAxis_Title );
+        
+        statementManager.destroy();
+
+        return SUCCESS;
+    }// execute end
+    
+    public Double[][] getServiceValuesByPeriod()
+    {
+        Double[][] serviceValues = new Double[1][monthlyPeriods.size()];
+        series1 = new String[1];
+        categories1 = new String[monthlyPeriods.size()];
+        categories2 = new String[monthlyPeriods.size()];
+        
+        int countForServiceList = 0;
+        int countForPeriodList = 0;
+        Double aggDataValue = 0.0;
+
+        series1[countForServiceList] = selectedDataElement.getName();
+        
+        List<OrganisationUnit> orgUnitList = null;
+        if( ougGroupSetCB != null )
+        {
+            OrganisationUnitGroup orgUnitGroup = organisationUnitGroupService.getOrganisationUnitGroup( orgUnitGroupList );
+            orgUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( selectedOrgUnit.getId()) );
+            orgUnitList.retainAll( orgUnitGroup.getMembers() );
+        }
+
+        Iterator<Period> periodListIterator = monthlyPeriods.iterator();
+        while ( periodListIterator.hasNext() )
+        {
+            aggDataValue = 0.0;
+            Period p = (Period) periodListIterator.next();
+
+            if( ougGroupSetCB != null )
+            {
+                Double tempValue = 0.0;
+                for( OrganisationUnit orgUnit : orgUnitList )
+                {
+                    if( selButton.equalsIgnoreCase( "VIEWCCHART" ) )
+                    {
+                        tempValue = aggregationService.getAggregatedDataValue( selectedDataElement, selDECOptCombo, startPeriod.getStartDate(), p.getEndDate(), orgUnit );
+                    }
+                    else
+                    {
+                        tempValue = aggregationService.getAggregatedDataValue( selectedDataElement, selDECOptCombo, p.getStartDate(), p.getEndDate(), orgUnit );
+                    }
+                    
+                    if( tempValue != null ) aggDataValue += tempValue;
+                }
+            }
+            else
+            {
+                if( selButton.equalsIgnoreCase( "VIEWCCHART" ) )
+                {
+                    aggDataValue = aggregationService.getAggregatedDataValue( selectedDataElement, selDECOptCombo, startPeriod.getStartDate(), p.getEndDate(), selectedOrgUnit );
+                }
+                else
+                {
+                    aggDataValue = aggregationService.getAggregatedDataValue( selectedDataElement, selDECOptCombo, p.getStartDate(), p.getEndDate(), selectedOrgUnit );
+                }
+            }
+            
+            if( aggDataValue == null ) aggDataValue = 0.0;
+            
+            serviceValues[countForServiceList][countForPeriodList] = aggDataValue;
+            
+            serviceValues[countForServiceList][countForPeriodList] = Math.round( serviceValues[countForServiceList][countForPeriodList] * Math.pow( 10, 2 ) ) / Math.pow( 10, 2 );
+            
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
+            categories1[countForPeriodList] = simpleDateFormat.format( p.getStartDate() );
+            categories2[countForPeriodList] = simpleDateFormat.format( p.getStartDate() );
+
+            countForPeriodList++;
+        }// periodList loop end
+
+        return serviceValues;
+    }// getServiceValues method end
+
+}

=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisFormAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisFormAction.java	2011-01-13 09:39:35 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/tr/action/GenerateTargetAnalysisFormAction.java	2011-01-17 06:56:53 +0000
@@ -7,11 +7,9 @@
 import java.util.Iterator;
 import java.util.List;
 
-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.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.period.MonthlyPeriodType;
@@ -53,13 +51,6 @@
     //Input/Output
     //--------------------------------------------------------------------------
     
-    private List<DataElement> dataElements;
-    
-    public List<DataElement> getDataElements()
-    {
-        return dataElements;
-    }
-
    private List<DataElementGroup> dataElementGroups;
 
    public List<DataElementGroup> getDataElementGroups()
@@ -94,21 +85,7 @@
 
     public String execute()
     {
-        dataElements = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
-        
-        // take only those dataElement which are VALUE_TYPE_INT and DOMAIN_TYPE_AGGREGATE
-        Iterator<DataElement> alldeIterator = dataElements.iterator();
-        while ( alldeIterator.hasNext() )
-        {
-            DataElement dataElement = alldeIterator.next();
-            if ( !dataElement.getDomainType().equalsIgnoreCase( DataElement.DOMAIN_TYPE_AGGREGATE ) )
-            {
-                alldeIterator.remove();
-            }
-        }
-        
         dataElementGroups = new ArrayList<DataElementGroup>( dataElementService.getAllDataElementGroups() );
-        Collections.sort( dataElements, new DataElementNameComparator() );
         Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
         
         orgUnitGroups = new ArrayList<OrganisationUnitGroup> ( orgUnitGroupService.getAllOrganisationUnitGroups() );
@@ -130,5 +107,4 @@
         
         return SUCCESS;
     }
-
 }

=== modified file 'local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml	2011-01-13 09:39:35 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml	2011-01-17 06:56:53 +0000
@@ -510,28 +510,36 @@
 	<bean id="org.hisp.dhis.dataanalyser.tr.action.GenerateTargetAnalysisFormAction"
         class="org.hisp.dhis.dataanalyser.tr.action.GenerateTargetAnalysisFormAction"
         scope="prototype">
-		
-		<property name="periodService">
-            <ref bean="org.hisp.dhis.period.PeriodService"/>
-        </property>
-		<property name="dataElementService">
-            <ref bean="org.hisp.dhis.dataelement.DataElementService"/>
-        </property>
-		<property name="orgUnitGroupService">
-            <ref bean="org.hisp.dhis.organisationunit.OrganisationUnitGroupService"/>
-        </property>
-		
+		<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+		<property name="orgUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
 	</bean>
 	
 	<bean id="org.hisp.dhis.dataanalyser.action.GetOrgUnitNameAction"
 		class="org.hisp.dhis.dataanalyser.action.GetOrgUnitNameAction"
 		scope="prototype">
-		
-		<property name="organisationUnitService">
-			<ref bean="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
-		</property>
-			
+		<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
 	</bean>
+
+    <bean id="org.hisp.dhis.dataanalyser.tr.action.GenerateTargetAnalysisDataAction"
+        class="org.hisp.dhis.dataanalyser.tr.action.GenerateTargetAnalysisDataAction"
+        scope="prototype">
+        <property name="statementManager" ref="statementManager" />
+        <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+        <property name="dataElementCategoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
+        <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+        <property name="aggregationService" ref="org.hisp.dhis.aggregation.AggregationService" />
+        <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+        <property name="deTargetService" ref="org.hisp.dhis.detarget.DeTargetService" />
+        <property name="deTargetDataValueService" ref="org.hisp.dhis.detargetdatavalue.DeTargetDataValueService" />
+        <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
+    </bean>
+
+    <bean id="org.hisp.dhis.dataanalyser.action.ExportTargetDataToExcelAction"
+        class="org.hisp.dhis.dataanalyser.action.ExportTargetDataToExcelAction"
+        scope="prototype">
+        <property name="configurationService" ref="org.hisp.dhis.config.ConfigurationService" />
+    </bean> 
 		
 	
 	<!-- DataStatus -->

=== modified file 'local/in/dhis-web-dashboard/src/main/resources/struts.xml'
--- local/in/dhis-web-dashboard/src/main/resources/struts.xml	2011-01-13 09:39:35 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/struts.xml	2011-01-17 06:56:53 +0000
@@ -332,6 +332,22 @@
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 		
+		<action name="generateChartDeTarget"
+            class="org.hisp.dhis.dataanalyser.tr.action.GenerateTargetAnalysisDataAction">
+            <result name="success" type="velocity">/popup.vm</result>
+            <param name="page">/dhis-web-dashboard/deTargetAnalysisResult.vm</param>
+            <param name="stylesheets">css/StylesForTags.css</param>
+        </action>
+
+        <action name="exportTargetDataToExcel"
+            class="org.hisp.dhis.dataanalyser.action.ExportTargetDataToExcelAction">
+            <result name="success" type="stream">
+                <param name="contentType">application/vnd.ms-excel</param>
+                <param name="inputName">inputStream</param>
+                <param name="contentDisposition">filename="${fileName}"</param>
+                <param name="bufferSize">1024</param>
+            </result>
+        </action>       
 		
 		
 		<!-- DataStatus Module Stuff -->

=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/deTargetAnalysisResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/deTargetAnalysisResult.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/deTargetAnalysisResult.vm	2011-01-17 06:56:53 +0000
@@ -0,0 +1,47 @@
+
+<script>
+    var selectedOrgUnitId = $selectedOrgId;
+    var selctedIndicatorId = $selectedIndicatorId;
+	
+	function exportToExcelFunction1( )
+	{
+		document.getElementById("exportExcelAnchor1").href = "exportTargetDataToExcel.action";
+	}
+</script>
+
+<div align="right">
+    <a id="exportExcelAnchor1" name="exportExcelAnchor1" href="#" onclick="javascript:exportToExcelFunction1()" target="_blank">Export To Excel</a>
+</div>
+<br />
+
+<table border="1" cellpadding="0" cellspacing="0" style="border-collapse:collapse;border-style:solid" bordercolor="black" width="100%">
+	<tr>
+		<td class="TableHeadingCellStyles" bgcolor="#C0C0C0">DataElement</td>
+        #foreach($xaxisvalue in $surveyChartResult.categories )
+			<td class="TableHeadingCellStyles" bgcolor="#C0C0C0" align="center">$xaxisvalue</td>
+        #end
+    </tr>
+	#set( $series = $surveyChartResult.series )
+	#set( $targetNames = $surveyChartResult.series2 )
+	#set( $count1 = 0 )
+    #foreach( $onedataList in $surveyChartResult.data )
+		#set( $oneTargetDataList = $listTool.get( $!surveyChartResult.data2, $count1 ) )
+		<tr>
+			<td class="TableHeadingCellStyles">$listTool.get( $series, $count1 )</td>			
+			 #foreach( $data in $onedataList )
+				<td class="TableDataCellStyles" align="center">$data</td>
+			 #end
+		</tr>
+        <tr>
+            <td class="TableHeadingCellStyles">$listTool.get( $targetNames, $count1 )</td>           
+             #foreach( $targetData in $!oneTargetDataList )
+                <td class="TableDataCellStyles" align="center">$targetData</td>
+             #end
+        </tr>
+		#set( $count1 = $count1 + 1 )
+	#end
+</table>
+
+<div align="center">
+	<iframe name="iframeForChart" id="iframeForChart" src="generateChart.action?currentChart=SurveyChart" width="800px" height="550px" scrolling=auto frameborder="0"></iframe>
+</div>

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/tr.js'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/tr.js	2011-01-13 09:39:35 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/tr.js	2011-01-17 06:56:53 +0000
@@ -1,44 +1,29 @@
+
 function formValidations()
 {
-    var orgUnitListCB = document.getElementById("orgUnitListCB");
-    var selOUListLength = document.tabularAnalysisForm.orgUnitListCB.options.length;
+    var orgUnitGroupListCB = document.getElementById("orgUnitGroupList");
     
-    sDateIndex    = document.targetAnalysisForm.sDateLB.selectedIndex;
-    eDateIndex    = document.targetAnalysisForm.eDateLB.selectedIndex;
-    sDateTxt = document.targetAnalysisForm.sDateLB.options[sDateIndex].text;
+    sDateIndex    = document.getElementById("sDateLB").selectedIndex;
+    eDateIndex    = document.getElementById("eDateLB").selectedIndex;
+    sDateTxt = document.getElementById("sDateLB").options[sDateIndex].text;
     sDate = formatDate(new Date(getDateFromFormat(sDateTxt,"MMM-y")),"yyyy-MM-dd");
-    eDateTxt = document.targetAnalysisForm.eDateLB.options[eDateIndex].text;
+    eDateTxt = document.getElementById("eDateLB").options[eDateIndex].text;
     eDate = formatDate(new Date(getDateFromFormat(eDateTxt,"MMM-y")),"yyyy-MM-dd");
 
     if(sDateIndex < 0) {alert("Please Select Starting Period");return false;}
     else if(eDateIndex < 0) {alert("Please Select Ending Period");return false;}
     else if(sDate > eDate) {alert("Starting Date is Greater");return false;}
-    orgUnitListCB.disabled = false;
     
+    var sWidth = 850;
+	var sHeight = 650;
+    var LeftPosition=(screen.width)?(screen.width-sWidth)/2:100;
+    var TopPosition=(screen.height)?(screen.height-sHeight)/2:100;
+
+    window.open('','chartWindow1','width=' + sWidth + ', height=' + sHeight + ', ' + 'left=' + LeftPosition + ', top=' + TopPosition + ', ' + 'location=no, menubar=no, ' +  'status=no, toolbar=no, scrollbars=yes, resizable=yes');
+
     return true;
 } // formValidations Function End
 
-function deSelectionChangeFuntion( listId1, listId2 )
-{
-    var list1 = document.getElementById( listId1 );
-    var list2 = document.getElementById( listId2 );
-
-    clearList( list1 );
-	
-    for(var i=list2.options.length-1; i >= 0; i--)
-    {
-        option = list2.options[ i ];
-        var optValue = option.value;
-        var partsOfOptVal = new Array();
-        partsOfOptVal = optValue.split(":");
-        if(partsOfOptVal[0] == "D")
-        {
-            list2.remove( i );
-        }
-    }
-	
-    getDataElements();
-}
 
 function getDataElements()
 {
@@ -72,7 +57,7 @@
 
     for ( var i = 0; i < dataElements.length; i++ )
     {
-        var id = "D:"+dataElements[ i ].getElementsByTagName("id")[0].firstChild.nodeValue;
+        var id = dataElements[ i ].getElementsByTagName("id")[0].firstChild.nodeValue;
         var dataElementName = dataElements[ i ].getElementsByTagName("name")[0].firstChild.nodeValue;
         
             var option = document.createElement("option");

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForTarget.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForTarget.vm	2011-01-13 09:39:35 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForTarget.vm	2011-01-17 06:56:53 +0000
@@ -18,8 +18,10 @@
 
 function orgUnitHasBeenSelected( orgUnitIds )
 {
+	document.getElementById("ouIDTB"). value = orgUnitIds;
     if(orgUnitIds == null || orgUnitIds == "" )
     {
+		document.getElementById("ouNameTB"). value = "";
         return;
     }
     if( orgUnitIds != null )

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisResult.vm	2010-12-29 07:47:36 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisResult.vm	2011-01-17 06:56:53 +0000
@@ -4,7 +4,6 @@
     var selectedOrgUnitId = $selectedOrgId;
     var selctedIndicatorId = $selectedIndicatorId;
     
-    //alert( selectedOrgUnitId );
     
     //alert( selctedIndicatorId );
     

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/targetAnalysisFront.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/targetAnalysisFront.vm	2011-01-13 09:39:35 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/targetAnalysisFront.vm	2011-01-17 06:56:53 +0000
@@ -1,25 +1,5 @@
-<style>
-#overlay {
-z-index:9998;
-position:absolute;
-top:0;
-bottom:0;
-left:0;
-width:100%;
-background:#000;
-opacity:0.45;
--moz-opacity:0.45;
-filter:alpha(opacity=45);
-visibility:hidden;
-}
-#overlayImg{ width: 50px; height: 50px; z-index: 9999; position: absolute; left:50%}
-</style>
-<div id="overlay">
-<div id="overlayImg"><img  width="50" height="50" src="images/ajax-loader.gif" /></div>
-</div>
 
 <script>
-	
 	var orgUnitGroupIds = new Array();
 	var orgUnitGroupNames = new Array();
 
@@ -29,110 +9,105 @@
 	   orgUnitGroupNames[$count1] = '$orgUnitGroup.name';
 	   #set( $count1 = $count1 + 1 );
 	#end
-	
 </script>
 
 <h1>Target Analysis Form</h1>
-<hr />
+<hr /><br/>
 
-<form id="targetAnalysisForm" name="targetAnalysisForm" action="targetAnalysisResult.action" method="post" onsubmit="return formValidations()" target="_blank">	
+<form id="targetAnalysisForm" name="targetAnalysisForm" action="generateChartDeTarget.action" method="post" onsubmit="return formValidations()" target="chartWindow1">
 	<table align="center" style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="100%" border=0>
-		<colgroup>
-        	<col width="40%">
-  		    <col width="20%">
- 		    <col width="40%">
-  	    </colgroup>
-  	    
   	    <tr>
-			<td class="NormalB">$i18n.getString( "ga_filter_by_degroup" )<br>
+			<td class="NormalB">
+				$i18n.getString( "ga_filter_by_degroup" )<br />
 		   		<select id="dataElementGroupId" name="dataElementGroupId" style="width:350px" onchange="getDataElements()">
-                	<option value="0">[ Select DataElementGroup / All ]</option>				                    
-            			#foreach ( $degroup in $dataElementGroups )
-            			<option value="$degroup.id" title="$degroup.name">$degroup.name</option>        			
+                	<option value="0">[ Select DataElementGroup ]</option>
+            		#foreach ( $degroup in $dataElementGroups )
+						<option value="$degroup.id" title="$degroup.name">$degroup.name</option>
      		        #end
      		    </select>
-            </td>  
+			</td>
         </tr>
         <tr>
-			<td class="NormalB">&nbsp;</td>   
+			<td class="NormalB">&nbsp;</td>
 		</tr>
-		
 		<tr>
-			<td class="NormalB">&nbsp;</td>   
+			<td class="NormalB">&nbsp;</td>
 		</tr>
         <tr>
-           
-            <td class="NormalB" style="display:none" >$i18n.getString( "compare_view" )<br>
+            <td class="NormalB" style="display:none" >
+				$i18n.getString( "compare_view" )<br>
             	<select id="deSelection" name="deSelection" style="width:350px" onchange="deSelectionChangeFuntion( 'availableDataElements', 'selectedServices' )">
                 	<option value="dataelement">DataElements</option>
                     <option value="optioncombo" selected>Options in DataElements</option>
                 </select>
             </td>
-            
-            <td class="NormalB">$i18n.getString( "ga_available_delist" )<br>
-				<select id="availableDataElements" name="availableDataElements" style="width:350px" >					
-					#foreach ( $element in $dataElements )
-						<option value="D:$element.id" title="$element.name">$element.name</option>					
-				    #end
-				</select>
+		</tr>
+		<tr>
+            <td class="NormalB" >
+				$i18n.getString( "ga_available_delist" )<br />
+				<select id="availableDataElements" name="availableDataElements" style="width:350px" ></select>
 			</td>
-			
         </tr>
-        
         <tr>
-			<td class="NormalB">&nbsp;</td>   
-		</tr>
-		
-		<tr>
-			<td class="NormalB">&nbsp;</td>   
-		</tr>
-		
-		<tr>
-			<td class="NormalB">	
-				$i18n.getString( "ga_from" )<br>
-				<select id="sDateLB" name="sDateLB">												
-					#foreach($period in $monthlyPeriods)
-						<option value="$period.id">$simpleDateFormat.format($period.startDate)</option>
-					#end
-				</select>
-			</td>
-			      
-			<td class="NormalB">    
-				$i18n.getString( "ga_to" )<br>
-				<select id="eDateLB" name="eDateLB">
-					#foreach($period in $monthlyPeriods)
-						<option value="$period.id">$simpleDateFormat.format($period.endDate)</option>
-					#end			  							
-				</select>
-			</td>    
-		</tr>
-		
-		<tr>
-	        <td class="NormalB">$i18n.getString( "nr_orgunit" )<br>
-	            <input type="text" name="ouNameTB" id="ouNameTB" style="width:150px" disabled>
-	            </select>                       
-	        </td>
-	        <td class="NormalB"><input type="checkbox" id="ougGroupSetCB" name="ougGroupSetCB" onChange="getOrgUnitGroupsDataElements()"  disabled="true">$i18n.getString( "ga_orgUnitGroups" )<br>
-	            <select name="orgUnitGroupList" id="orgUnitGroupList" multiple size="7"  onChange="selectSingleOptionOrgUnitGroup()"  style="width: 150px;" disabled="true">
-	            </select>
-	        </td>
-		
-      	</tr>
-      	
-      	<tr>
-			<td>&nbsp;</td>
-			<td>&nbsp;</td>
-			<td>&nbsp;</td>
-		</tr>                    			                   			        
-		<tr>
-			<td>
-				<input type="submit" id="ViewChart" name="ViewChart" value="$i18n.getString( 'viewchart' )" style="width: 120; height: 25; font-family:Arial; font-weight:bold; color:#000000">
-			</td>
-			
-			<td>
-				<input type="submit" id="ViewCumulativeChart" name="ViewChart" value="$i18n.getString( 'view_cumulativechart' )" style="width: 120; height: 25; font-family:Arial; font-weight:bold; color:#000000">
-			</td>
-		</tr>
-      </table>
+			<td class="NormalB">&nbsp;</td>
+		</tr>		
+		<tr>
+			<td class="NormalB">&nbsp;</td>
+		</tr>		
+		<tr>
+			<td>
+				<table>
+					<tr>
+						<td class="NormalB">
+							<input type="checkbox" id="ougGroupSetCB" name="ougGroupSetCB" onChange="getOrgUnitGroupsDataElements()"  disabled="true">$i18n.getString( "ga_orgUnitGroups" )<br>
+							<select name="orgUnitGroupList" id="orgUnitGroupList" size="8"  onChange="selectSingleOptionOrgUnitGroup()"  style="width: 170px;" disabled="true">
+							</select>
+						</td>
+						<td style="width:30px">&nbsp;</td>
+						<td class="NormalB">
+							$i18n.getString( "ga_from" )<br>
+							<select id="sDateLB" name="sDateLB" style="width:150px">
+							#foreach($period in $monthlyPeriods)
+								<option value="$period.id">$simpleDateFormat.format($period.startDate)</option>
+							#end
+							</select>
+							<br/><br/>
+							$i18n.getString( "ga_to" )<br>
+							<select id="eDateLB" name="eDateLB" style="width:150px">
+								#foreach($period in $monthlyPeriods)
+									<option value="$period.id">$simpleDateFormat.format($period.endDate)</option>
+								#end
+							</select>
+							<br/><br/>
+							$i18n.getString( "nr_orgunit" )<br>
+							<input type="text" name="ouNameTB" id="ouNameTB" style="width:150px" disabled>
+							<input type="hidden" name="ouIDTB" id="ouIDTB" />	
+						</td>
+					</tr>
+					<tr>
+						<td class="NormalB">&nbsp;</td>
+						<td class="NormalB">&nbsp;</td>
+						<td class="NormalB">&nbsp;</td>
+					</tr>
+					<tr>
+						<td>
+							<input type="hidden" name="selButton" id="selButton" />
+							<input type="submit" id="ViewChart" name="ViewChart" value="$i18n.getString( 'viewchart' )" style="width:170px;height:25px;font-family:Arial;font-weight:bold;color:#000000" onclick="setButtonName('VIEWCHART')">
+						</td>
+						<td class="NormalB">&nbsp;</td>
+						<td>
+							<input type="submit" id="ViewCumulativeChart" name="ViewChart" value="$i18n.getString( 'view_cumulativechart' )" style="width: 120; height: 25; font-family:Arial; font-weight:bold; color:#000000" onclick="setButtonName('VIEWCCHART')">
+						</td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+	</table>
 </form>
-            
+
+<script>
+	function setButtonName( selButton )
+	{
+		document.getElementById("selButton").value = selButton;
+	}
+</script>
\ No newline at end of file