dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #09275
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2415: Changing Numerator/Denominator in IndicatorwiseAnalysis, Annual and Survey Analysis in dashboard
------------------------------------------------------------
revno: 2415
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-12-23 12:53:23 +0530
message:
Changing Numerator/Denominator in IndicatorwiseAnalysis, Annual and Survey Analysis in dashboard
added:
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportSurveyDataToExcelAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sa/action/GenerateChartSurveyAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/SurveyChartResult.java
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisIndicatorResult_16Dec2010.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisResult_17Dec2010.vm
modified:
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/aa/action/GenerateAnnualAnalysisDataAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportIndicatorToExcelAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportToExcelAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetSortedIndicatorDataAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateSummaryDataStatusResultAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartAction1.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartDataElementAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sa/action/GenerateSurveyAnalysisDataAction.java
local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties
local/in/dhis-web-dashboard/src/main/resources/struts.xml
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/annualAnalysisResult.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisIndicatorResult.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForGAIndicator.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisFront.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisResult.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 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/aa/action/GenerateAnnualAnalysisDataAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/aa/action/GenerateAnnualAnalysisDataAction.java 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/aa/action/GenerateAnnualAnalysisDataAction.java 2010-12-23 07:23:23 +0000
@@ -38,6 +38,7 @@
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
+import org.apache.velocity.tools.generic.ListTool;
import org.hisp.dhis.aggregation.AggregationService;
import org.hisp.dhis.dataanalyser.util.DashBoardService;
import org.hisp.dhis.dataelement.DataElement;
@@ -167,6 +168,38 @@
{
return data2;
}
+
+ //17/12/2010 for num data
+ List<List<Double>> numDataList;
+
+ public List<List<Double>> getNumDataList()
+ {
+ return numDataList;
+ }
+ //17/12/2010 for denum data
+ List<List<Double>> denumDataList;
+
+ public List<List<Double>> getDenumDataList()
+ {
+ return denumDataList;
+ }
+
+ Double numServiceValues[][];
+
+ public Double[][] getNumServiceValues()
+ {
+ return numServiceValues;
+ }
+
+ Double denumServiceValues[][];
+
+ public Double[][] getDenumServiceValues()
+ {
+ return denumServiceValues;
+ }
+
+
+
List<List<Double>> dataList;
public List<List<Double>> getDataList() {
@@ -224,14 +257,25 @@
this.ouIDTB = ouIDTB;
}
+ ListTool listTool;
+
+ public ListTool getListTool()
+ {
+ return listTool;
+ }
+
public String execute()
throws Exception {
dataList = new ArrayList<List<Double>>();
+ numDataList = new ArrayList<List<Double>>();
+ denumDataList = new ArrayList<List<Double>>();
+
xseriesList = new ArrayList<String>();
yseriesList = new ArrayList<String>();
decimalFormat = new DecimalFormat("0.0");
-
+
+ listTool = new ListTool();
// OrgUnit Related Info
selectedOrgUnit = new OrganisationUnit();
selectedOrgUnit = organisationUnitService.getOrganisationUnit(ouIDTB);
@@ -242,6 +286,7 @@
selectedIndicator = new Indicator();
selectedIndicator = indicatorService.getIndicator(availableIndicators);
chartTitle += "\n Indicator : " + selectedIndicator.getName();
+
} else {
selectedDataElement = new DataElement();
@@ -271,6 +316,9 @@
HttpSession session = req.getSession();
session.setAttribute("data1", data1);
+ session.setAttribute("numDataList", numDataList);
+ session.setAttribute("denumDataList", denumDataList);
+
session.setAttribute("data2", data2);
session.setAttribute("series1", series1);
session.setAttribute("categories1", categories1);
@@ -294,6 +342,10 @@
// DecimalFormat decFormat = new DecimalFormat("0.0");
Double[][] serviceValues = new Double[annualPeriodsListCB.size()][monthlyPeriodsListCB.size()];
+
+ numServiceValues = new Double[annualPeriodsListCB.size()][monthlyPeriodsListCB.size()];
+ denumServiceValues = new Double[annualPeriodsListCB.size()][monthlyPeriodsListCB.size()];
+
data2 = new Double[annualPeriodsListCB.size()][monthlyPeriodsListCB.size()];
String[] monthNames = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
@@ -309,6 +361,9 @@
Iterator iterator1 = annualPeriodsListCB.iterator();
while (iterator1.hasNext()) {
List<Double> dataValues = new ArrayList<Double>();
+ List<Double> numDataValue = new ArrayList<Double>();
+ List<Double> denumDataValue = new ArrayList<Double>();
+
int tempYear = Integer.parseInt((String) iterator1.next());
//series1[count1] = "" + tempYear + "-" + (tempYear + 1);
series1[count1] = "" + tempYear;
@@ -324,13 +379,32 @@
p = dashBoardService.getPeriodByMonth(tempMonth, tempYear, monthlyPeriodType);
if (p == null) {
serviceValues[count1][count2] = 0.0;
+ numServiceValues[count1][count2] = 0.0;
+ denumServiceValues[count1][count2] = 0.0;
+
System.out.println("PERIOD IS NULL for " + tempMonth + " : " + tempYear);
- } else {
- if (riRadio.equals("indicatorsRadio")) {
- serviceValues[count1][count2] = aggregationService.getAggregatedIndicatorValue(
- selectedIndicator, p.getStartDate(), p.getEndDate(), selectedOrgUnit);
+ }
+ else
+ {
+ if (riRadio.equals("indicatorsRadio"))
+ {
+ serviceValues[count1][count2] = aggregationService.getAggregatedIndicatorValue( selectedIndicator, p.getStartDate(), p.getEndDate(), selectedOrgUnit);
//System.out.println("indicators Radio is Selected " + serviceValues[count1][count2]);
- } else {
+
+ numServiceValues[count1][count2] = aggregationService.getAggregatedNumeratorValue( selectedIndicator, p.getStartDate(),p.getEndDate(), selectedOrgUnit );
+ denumServiceValues[count1][count2] = aggregationService.getAggregatedDenominatorValue( selectedIndicator, p.getStartDate(),p.getEndDate(), selectedOrgUnit );
+
+ // for numenetor value
+ numServiceValues[count1][count2] = numServiceValues[count1][count2];
+ numServiceValues[count1][count2] = Math.round( numServiceValues[count1][count2] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+
+ // for denum value
+ denumServiceValues[count1][count2] = denumServiceValues[count1][count2];
+ denumServiceValues[count1][count2] = Math.round( denumServiceValues[count1][count2] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+
+ }
+ else
+ {
Double aggDataValue = 0.0;
serviceValues[count1][count2] = 0.0;
DataElementCategoryCombo dataElementCategoryCombo = selectedDataElement.getCategoryCombo();
@@ -339,7 +413,8 @@
dataElementCategoryCombo.getOptionCombos());
Iterator<DataElementCategoryOptionCombo> optionComboIterator = optionCombos.iterator();
- while (optionComboIterator.hasNext()) {
+ while (optionComboIterator.hasNext())
+ {
DataElementCategoryOptionCombo decoc = (DataElementCategoryOptionCombo) optionComboIterator.next();
aggDataValue = aggregationService.getAggregatedDataValue(selectedDataElement, decoc, p.getStartDate(), p.getEndDate(), selectedOrgUnit);
@@ -354,23 +429,42 @@
}
//if ( serviceValues[count1][count2] != null )
//{
- if (serviceValues[count1][count2] == null) {
+ if ( serviceValues[count1][count2] == null )
+ {
serviceValues[count1][count2] = 0.0;
}
serviceValues[count1][count2] = Math.round(serviceValues[count1][count2] * Math.pow(10, 1)) / Math.pow(10, 1);
//}
}
- if (serviceValues[count1][count2] == null) {
+ if ( serviceValues[count1][count2] == null )
+ {
serviceValues[count1][count2] = 0.0;
}
+
+ if ( numServiceValues[count1][count2] == null )
+ {
+ numServiceValues[count1][count2] = 0.0;
+ }
+
+ if ( denumServiceValues[count1][count2] == null )
+ {
+ denumServiceValues[count1][count2] = 0.0;
+ }
categories1[count2] = monthNames[tempMonth];
categories2[count2] = monthNames[tempMonth];
data2[count1][count2] = 0.0;
+
dataValues.add(serviceValues[count1][count2]);
+ numDataValue.add( numServiceValues[count1][count2] );
+ denumDataValue.add( denumServiceValues[count1][count2] );
+
count2++;
}// Monthly PeriodList loop end
dataList.add(dataValues);
+ numDataList.add( numDataValue );
+ denumDataList.add( denumDataValue );
+
count1++;
} // Annual PeriodList loop end
return serviceValues;
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportIndicatorToExcelAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportIndicatorToExcelAction.java 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportIndicatorToExcelAction.java 2010-12-23 07:23:23 +0000
@@ -223,7 +223,6 @@
// tempRow1 -= objData1.length;
tempRow1 = 0;
}
-
tempCol1 = 0;
tempCol2 = 0;
tempRow1++;
@@ -242,7 +241,6 @@
sheet0.mergeCells( tempCol1 , tempRow1, tempCol1, tempRow1+1 );
sheet0.addCell( new Label( tempCol1, tempRow1, "Indicators", wCellformat2) );
-
tempCol1++;
tempCol2++;
// sheet0.mergeCells( tempCol1 , tempRow1, tempCol1 + 3, tempRow1 );
@@ -275,7 +273,6 @@
tempCol1++;
for( int k=0;k<categories1.length;k++ )
{
-
//sheet0.addCell( new Number( tempColNo, tempRowNo, Double.parseDouble( tempStr ), wCellformat ) );
sheet0.addCell( new Number( tempCol1, tempRow1, numDataArray[j][k], wCellformat1 ) );
sheet0.addCell( new Number( tempCol1+1, tempRow1, denumDataArray[j][k], wCellformat1 ) );
=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportSurveyDataToExcelAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportSurveyDataToExcelAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportSurveyDataToExcelAction.java 2010-12-23 07:23:23 +0000
@@ -0,0 +1,542 @@
+/*
+ * Copyright (c) 2004-2010, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+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.CellType;
+import jxl.Workbook;
+import jxl.format.Alignment;
+import jxl.format.Border;
+import jxl.format.BorderLineStyle;
+import jxl.format.CellFormat;
+import jxl.format.Colour;
+import jxl.write.Label;
+import jxl.write.Number;
+import jxl.write.WritableCell;
+import jxl.write.WritableCellFormat;
+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;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ *
+ * @version ExportSurveyDataToExcelAction.java Dec 9, 2010 5:19:10 PM
+ */
+public class ExportSurveyDataToExcelAction implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+/*
+ private LocationManager locationManager;
+
+ public void setLocationManager( LocationManager locationManager )
+ {
+ this.locationManager = locationManager;
+ }
+ */
+ private ConfigurationService configurationService;
+
+ public void setConfigurationService( ConfigurationService configurationService )
+ {
+ this.configurationService = configurationService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input & output
+ // -------------------------------------------------------------------------
+
+ double[][] data1;
+
+ double[][] data2;
+
+ String[] series1;
+
+ String[] series2;
+
+ String[] categories1;
+
+ String[] categories2;
+
+ List<Survey> surveyList;
+
+
+ private InputStream inputStream;
+
+ public InputStream getInputStream()
+ {
+ return inputStream;
+ }
+
+ /*
+ private String contentType;
+
+ public String getContentType()
+ {
+ return contentType;
+ }
+ */
+
+ private String fileName;
+
+ public String getFileName()
+ {
+ return fileName;
+ }
+
+ /*
+ private int bufferSize;
+
+ public int getBufferSize()
+ {
+ return bufferSize;
+ }
+ */
+
+ private String viewSummary;
+
+ public void setViewSummary( String viewSummary )
+ {
+ this.viewSummary = viewSummary;
+ }
+
+ private String chartDisplayOption;
+
+ public void setChartDisplayOption( String chartDisplayOption )
+ {
+ this.chartDisplayOption = chartDisplayOption;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ int tempCol1 = 0;
+ int tempRow1 = 1;
+
+ System.out.println( "Export to Excel" );
+
+ 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" );
+
+ //List<Survey> surveyList = (List<Survey>)session.getAttribute( "surveyList" );
+
+ System.out.println( "Survey List size is " + series2S.length );
+ initialzeAllLists(series1S, series2S, categories1S, categories2S);
+ // initialzeAllLists(series1S, series2S, categories1S, categories2S, surveyList );
+
+ if(objData1 == null || objData2 == null || series1 == null || series2 == null || categories1 == null || categories2 == null || surveyList == null )
+ System.out.println("Session Objects are null");
+ else
+ System.out.println("Session Objects are not null");
+
+ data1 = convertDoubleTodouble( objData1 );
+ data2 = convertDoubleTodouble( objData2 );
+
+ if(chartDisplayOption == null || chartDisplayOption.equalsIgnoreCase("none")) { }
+ // else if(chartDisplayOption.equalsIgnoreCase("ascend")) { sortByAscending(); }
+ // else if(chartDisplayOption.equalsIgnoreCase("desend")) { sortByDesscending(); }
+ // else if(chartDisplayOption.equalsIgnoreCase("alphabet")) { sortByAlphabet(); }
+
+ //File outputReportFile = locationManager.getFileForWriting( UUID.randomUUID().toString() + ".xls", "db", "output" );
+
+
+ // String outputReportFile = System.getProperty( "user.home" ) + File.separator + "dhis" + File.separator + configurationService.getConfigurationByKey( Configuration_IN.KEY_REPORTFOLDER ).getValue()
+ // + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+ String outputReportFile = System.getenv( "DHIS2_HOME" ) + File.separator + configurationService.getConfigurationByKey( Configuration_IN.KEY_REPORTFOLDER ).getValue()
+ + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+
+ // System.out.println("Env Variable is :" + System.getenv( "DHIS2_HOME" ) );
+ // System.out.println("Complete path is :" + outputReportFile );
+
+ WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File(outputReportFile) );
+ WritableSheet sheet0 = outputReportWorkbook.createSheet( "ChartOutput", 0 );
+
+ if(viewSummary.equals( "no" ))
+ {
+ WritableImage writableImage = new WritableImage(0,1,10,23,encoderBytes);
+ sheet0.addImage( writableImage );
+ tempRow1 = 24;
+ }
+ else
+ {
+ tempRow1 -= objData1.length;
+ }
+
+
+ int count1 = 0;
+ int count2 = 0;
+ int flag1 = 0;
+ while(count1 <= categories1.length)
+ {
+ for(int j=0;j<data1.length;j++)
+ {
+ tempCol1 = 1;
+ tempRow1++;
+ WritableCellFormat wCellformat1 = new WritableCellFormat();
+ wCellformat1.setBorder( Border.ALL, BorderLineStyle.THIN );
+ wCellformat1.setWrap( true );
+
+ WritableCellFormat wCellformat2 = new WritableCellFormat();
+ wCellformat2.setBorder( Border.ALL, BorderLineStyle.THIN );
+ wCellformat2.setAlignment( Alignment.CENTRE );
+ wCellformat2.setBackground( Colour.GRAY_25 );
+ wCellformat2.setWrap( true );
+
+
+ WritableCell cell1;
+ CellFormat cellFormat1;
+
+ for(int k=count2;k<count1;k++)
+ {
+ if(k==count2 && j==0)
+ {
+ tempCol1 = 0;
+ tempRow1++;
+ cell1 = sheet0.getWritableCell(tempCol1, tempRow1);
+ cellFormat1 = cell1.getCellFormat();
+
+
+ if (cell1.getType() == CellType.LABEL)
+ {
+ Label l = (Label) cell1;
+ l.setString("Service");
+ l.setCellFormat( cellFormat1 );
+ }
+ else
+ {
+ sheet0.addCell( new Label( tempCol1, tempRow1, "Service", wCellformat2) );
+ }
+ tempCol1++;
+
+
+
+
+
+ for(int i=count2; i< count1; i++)
+ {
+ cell1 = sheet0.getWritableCell(tempCol1, tempRow1);
+ cellFormat1 = cell1.getCellFormat();
+ if (cell1.getType() == CellType.LABEL)
+ {
+ Label l = (Label) cell1;
+ l.setString(categories1[i]); // period name
+ l.setCellFormat( cellFormat1 );
+ }
+ else
+ {
+ sheet0.addCell( new Label( tempCol1, tempRow1, categories1[i], wCellformat2) );
+ }
+ tempCol1++;
+ }
+ tempRow1++;
+ tempCol1 = 1;
+ }
+
+
+ if(k==count2)
+ {
+ tempCol1 = 0;
+ cell1 = sheet0.getWritableCell(tempCol1, tempRow1);
+ cellFormat1 = cell1.getCellFormat();
+
+ if (cell1.getType() == CellType.LABEL)
+ {
+ Label l = (Label) cell1;
+ l.setString(series1[j]);//indicator name
+ l.setCellFormat( cellFormat1 );
+ }
+ else
+ {
+ sheet0.addCell( new Label( tempCol1, tempRow1, series1[j], wCellformat2) );
+ }
+ tempCol1++;
+ }
+ cell1 = sheet0.getWritableCell(tempCol1, tempRow1);
+ cellFormat1 = cell1.getCellFormat();
+
+
+ if (cell1.getType() == CellType.LABEL)
+ {
+ Label l = (Label) cell1;
+ l.setString(""+data1[j][k]);
+ l.setCellFormat( cellFormat1 );
+ }
+ else
+ {
+ sheet0.addCell( new Number( tempCol1, tempRow1, data1[j][k], wCellformat1 ) );
+ //sheet0.addCell( new Number( tempCol1, tempRow1, ""+data1[j][k], wCellformat1) );
+ }
+ tempCol1++;
+ }
+ }
+ if(flag1 == 1) break;
+ count2 = count1;
+ if( (count1+10 > categories1.length) && (categories1.length - count1 <= 10))
+ {
+ count1 += categories1.length - count1;
+ flag1 = 1;
+ }
+ else
+ count1 += 10;
+ }
+ outputReportWorkbook.write();
+ outputReportWorkbook.close();
+
+ fileName = "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 )
+ {
+ //System.out.println("Before Sorting : ");
+ 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();
+ //System.out.print(categories1[j]+": "+data[i][j]+", ");
+ }
+ //System.out.println("");
+ }
+
+ return data;
+ }// convertDoubleTodouble end
+
+/*
+ public void sortByAscending()
+ {
+ for(int i=0; i < categories1.length-1 ; i++)
+ {
+ for(int j=0; j < categories1.length-1-i; j++)
+ {
+ if(data1[0][j] > data1[0][j+1])
+ {
+ for(int k=0; k<series1.length; k++)
+ {
+ double temp1 = data1[k][j];
+ data1[k][j] = data1[k][j+1];
+ data1[k][j+1] = temp1;
+ }
+
+ String temp2 = categories1[j];
+ categories1[j] = categories1[j+1];
+ categories1[j+1] = temp2;
+ }
+ }
+ }
+*/
+ /*
+ for(int i=0; i < categories2.length-1 ; i++)
+ {
+ for(int j=0; j < categories2.length-1-i; j++)
+ {
+ if(data2[0][j] > data2[0][j+1])
+ {
+ for(int k=0; k<series2.length; k++)
+ {
+ double temp1 = data2[k][j];
+ data2[k][j] = data2[k][j+1];
+ data2[k][j+1] = temp1;
+ }
+
+ String temp2 = categories2[j];
+ categories2[j] = categories2[j+1];
+ categories2[j+1] = temp2;
+ }
+ }
+ }
+ */
+
+ // }
+
+ /*
+ public void sortByDesscending()
+ {
+ for(int i=0; i < categories1.length-1 ; i++)
+ {
+ for(int j=0; j < categories1.length-1-i; j++)
+ {
+ if(data1[0][j] < data1[0][j+1])
+ {
+ for(int k=0; k<series1.length; k++)
+ {
+ double temp1 = data1[k][j];
+ data1[k][j] = data1[k][j+1];
+ data1[k][j+1] = temp1;
+ }
+
+ String temp2 = categories1[j];
+ categories1[j] = categories1[j+1];
+ categories1[j+1] = temp2;
+ }
+ }
+ }
+ */
+ /*
+ for(int i=0; i < categories2.length-1 ; i++)
+ {
+ for(int j=0; j < categories2.length-1-i; j++)
+ {
+ if(data2[0][j] < data2[0][j+1])
+ {
+ for(int k=0; k<series2.length; k++)
+ {
+ double temp1 = data2[k][j];
+ data2[k][j] = data2[k][j+1];
+ data2[k][j+1] = temp1;
+ }
+
+ String temp2 = categories2[j];
+ categories2[j] = categories2[j+1];
+ categories2[j+1] = temp2;
+ }
+ }
+ }
+ */
+ // }
+ /*
+ public void sortByAlphabet()
+ {
+ for(int i=0; i < categories1.length-1 ; i++)
+ {
+ for(int j=0; j < categories1.length-1-i; j++)
+ {
+ if(categories1[j].compareToIgnoreCase(categories1[j+1]) > 0)
+ {
+ for(int k=0; k<series1.length; k++)
+ {
+ double temp1 = data1[k][j];
+ data1[k][j] = data1[k][j+1];
+ data1[k][j+1] = temp1;
+ }
+
+ String temp2 = categories1[j];
+ categories1[j] = categories1[j+1];
+ categories1[j+1] = temp2;
+ }
+ }
+ }
+*/
+ /*
+ for(int i=0; i < categories2.length-1 ; i++)
+ {
+ for(int j=0; j < categories2.length-1-i; j++)
+ {
+ if(categories2[j].compareToIgnoreCase(categories2[j+1]) > 0)
+ {
+ for(int k=0; k<series2.length; k++)
+ {
+ double temp1 = data2[k][j];
+ data2[k][j] = data2[k][j+1];
+ data2[k][j+1] = temp1;
+ }
+
+ String temp2 = categories2[j];
+ categories2[j] = categories2[j+1];
+ categories2[j+1] = temp2;
+ }
+ }
+ }
+ */
+
+ // }
+
+
+}
+
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportToExcelAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportToExcelAction.java 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/ExportToExcelAction.java 2010-12-23 07:23:23 +0000
@@ -126,6 +126,8 @@
int tempCol1 = 0;
int tempRow1 = 1;
+ System.out.println( "Export to Excel" );
+
ActionContext ctx = ActionContext.getContext();
HttpServletRequest req = (HttpServletRequest) ctx.get( ServletActionContext.HTTP_REQUEST );
HttpSession session = req.getSession();
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetSortedIndicatorDataAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetSortedIndicatorDataAction.java 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetSortedIndicatorDataAction.java 2010-12-23 07:23:23 +0000
@@ -115,6 +115,58 @@
public void initializeDataLists()
{
int i;
+ headingInfo.add( "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse; border-style: solid\" bordercolor=\"#111111\" width=\"100%\"><tr><td class=\"TableHeadingCellStyles\" bgcolor=\"#C0C0C0\" style=\"border-style: dotted; border-width: 1\"><strong>Indicator Names</strong></td>" );
+ headingInfo.add( "<td class=\"TableHeadingCellStyles\" align=\"center\" bgcolor=\"#C0C0C0\" style=\"border-style: dotted; border-width: 1\"><strong></strong></td>" );
+
+ for(i=0; i < categories1.length; i++)
+ {
+ headingInfo.add( "<td class=\"TableHeadingCellStyles\" align=\"center\" bgcolor=\"#C0C0C0\" style=\"border-style: dotted; border-width: 1\"><strong>"+categories1[i]+"</strong></td>" );
+ }
+ headingInfo.add( "</tr>" );
+
+ for(i=0; i<data1.length; i++)
+ {
+ headingInfo.add( "<tr><td class=\"TableHeadingCellStyles\" rowspan = 3 style=\"border-style: dotted; border-width: 1\">"+series1[i]+"</td>" );
+ headingInfo.add( "<td class=\"TableHeadingCellStyles\" align=\"center\" bgcolor=\"#C0C0C0\" style=\"border-style: dotted; border-width: 1\"><strong>Num</strong></td>" );
+ for(int j=0; j<data1[i].length; j++)
+ {
+ headingInfo.add( "<td class=\"TableDataCellStyles\" align=\"center\" style=\"border-style: dotted; border-width: 1\">"+numDataArray[i][j]+"</td>" );
+ // headingInfo.add( "<td class=\"TableDataCellStyles\" align=\"center\" style=\"border-style: dotted; border-width: 1\">"+denumDataArray[i][j]+"</td>" );
+ //headingInfo.add( "<td class=\"TableDataCellStyles\" align=\"center\" style=\"border-style: dotted; border-width: 1\">"+data1[i][j]+"</td>" );
+
+ }
+ headingInfo.add( "</tr>" );
+
+ headingInfo.add( "<tr><td class=\"TableHeadingCellStyles\" align=\"center\" bgcolor=\"#C0C0C0\" style=\"border-style: dotted; border-width: 1\"><strong>Den</strong></td>" );
+ for(int j=0; j<data1[i].length; j++)
+ {
+ // headingInfo.add( "<td class=\"TableDataCellStyles\" align=\"center\" style=\"border-style: dotted; border-width: 1\">"+numDataArray[i][j]+"</td>" );
+ headingInfo.add( "<td class=\"TableDataCellStyles\" align=\"center\" style=\"border-style: dotted; border-width: 1\">"+denumDataArray[i][j]+"</td>" );
+ //headingInfo.add( "<td class=\"TableDataCellStyles\" align=\"center\" style=\"border-style: dotted; border-width: 1\">"+data1[i][j]+"</td>" );
+
+ }
+ headingInfo.add( "</tr>" );
+
+ headingInfo.add( "<tr><td class=\"TableHeadingCellStyles\" align=\"center\" bgcolor=\"#C0C0C0\" style=\"border-style: dotted; border-width: 1\"><strong>Val</strong></td>" );
+ for(int j=0; j<data1[i].length; j++)
+ {
+ // headingInfo.add( "<td class=\"TableDataCellStyles\" align=\"center\" style=\"border-style: dotted; border-width: 1\">"+numDataArray[i][j]+"</td>" );
+ // headingInfo.add( "<td class=\"TableDataCellStyles\" align=\"center\" style=\"border-style: dotted; border-width: 1\">"+denumDataArray[i][j]+"</td>" );
+ headingInfo.add( "<td class=\"TableDataCellStyles\" align=\"center\" style=\"border-style: dotted; border-width: 1\"><strong>"+data1[i][j]+"</strong></td>" );
+
+ }
+ headingInfo.add( "</tr>" );
+
+
+ }
+
+ headingInfo.add( "</table>" );
+
+
+
+ //16/12/2010 Start
+ /*
+ int i;
headingInfo.add( "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse; border-style: solid\" bordercolor=\"#111111\" width=\"100%\"><tr><td class=\"TableHeadingCellStyles\" bgcolor=\"#C0C0C0\" rowspan=2 style=\"border-style: dotted; border-width: 1\"><strong>Indicator Names</strong></td>" );
for(i=0; i < categories1.length; i++)
@@ -134,6 +186,8 @@
headingInfo.add( "<td class=\"TableHeadingCellStyles\" align=\"center\" bgcolor=\"#C0C0C0\" style=\"border-style: dotted; border-width: 1\"><strong>Val</strong></td>" );
}
headingInfo.add( "</tr>" );
+
+*/ //16/12/2010 end
/*
for(i=0; i<numDataArray.length; i++)
@@ -155,7 +209,11 @@
}
// headingInfo.add( "</tr>" );
}
-*/
+*/
+
+ //16/12/2010 Start
+ /*
+
for(i=0; i<data1.length; i++)
{
headingInfo.add( "<tr><td class=\"TableHeadingCellStyles\" style=\"border-style: dotted; border-width: 1\">"+series1[i]+"</td>" );
@@ -170,6 +228,7 @@
}
headingInfo.add( "</table>" );
+ */ //16/12/2010 end
}
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateSummaryDataStatusResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateSummaryDataStatusResultAction.java 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateSummaryDataStatusResultAction.java 2010-12-23 07:23:23 +0000
@@ -668,7 +668,7 @@
try
{
@SuppressWarnings("unused")
- int sqlResult = jdbcTemplate.update( query );
+ int sqlResult = jdbcTemplate.update( query );
System.out.println( "View " + dataViewName + " dropped Successfully (if exists) " );
query = "CREATE view " + dataViewName + " AS "
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartAction1.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartAction1.java 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartAction1.java 2010-12-23 07:23:23 +0000
@@ -39,6 +39,7 @@
import org.hisp.dhis.dataanalyser.ga.charts.LineAndBarChart;
import org.hisp.dhis.dataanalyser.ga.charts.LineChart;
import org.hisp.dhis.dataanalyser.ga.charts.StandardChart;
+import org.hisp.dhis.dataanalyser.ga.charts.SurveyChart;
import org.hisp.dhis.dataanalyser.ga.charts.Vertical3DBarChart;
import org.jfree.chart.ChartRenderingInfo;
import org.jfree.chart.JFreeChart;
@@ -221,12 +222,13 @@
//System.out.println( "PieChart3D" );
selChart = new PieChart3D();
}
+*/
else if ( currentChart.equals( "SurveyChart" ) )
{
//System.out.println( "SurveyChart" );
selChart = new SurveyChart();
}
-*/
+
// chart = selChart.getChartViewer( data1, series1, categories1, chartTitle, xAxis_Title, yAxis_Title );
chart = selChart.getChartViewergetChartViewerDataElement( data1, series1, categories1, chartTitle, xAxis_Title, yAxis_Title );
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartDataElementAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartDataElementAction.java 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/charts/GenerateChartDataElementAction.java 2010-12-23 07:23:23 +0000
@@ -964,6 +964,7 @@
if( aggDataCB != null )
{
aggDataValue = aggregationService.getAggregatedDataValue( dataElement, decoc, startDate, endDate, orgUnit );
+ System.out.println( "start Date is : " + startDate + " , End date is : " + endDate );
//System.out.println( "Agg data value before is : " + aggDataValue );
if(aggDataValue == null ) aggDataValue = 0.0;
//System.out.println( "Agg data value after zero assign is : " + aggDataValue );
=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sa/action/GenerateChartSurveyAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sa/action/GenerateChartSurveyAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sa/action/GenerateChartSurveyAction.java 2010-12-23 07:23:23 +0000
@@ -0,0 +1,487 @@
+/*
+ * Copyright (c) 2004-2010, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.hisp.dhis.dataanalyser.sa.action;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+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.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.MonthlyPeriodType;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.survey.Survey;
+import org.hisp.dhis.survey.SurveyService;
+import org.hisp.dhis.surveydatavalue.SurveyDataValue;
+import org.hisp.dhis.surveydatavalue.SurveyDataValueService;
+
+import com.opensymphony.xwork2.Action;
+import com.opensymphony.xwork2.ActionContext;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ *
+ * @version GenerateChartSurveyAction.java Dec 10, 2010 11:33:19 AM
+ */
+public class GenerateChartSurveyAction 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 IndicatorService indicatorService;
+
+ public void setIndicatorService( IndicatorService indicatorService )
+ {
+ this.indicatorService = indicatorService;
+ }
+
+ private AggregationService aggregationService;
+
+ public void setAggregationService( AggregationService aggregationService )
+ {
+ this.aggregationService = aggregationService;
+ }
+
+ private SurveyService surveyService;
+
+ public void setSurveyService( SurveyService surveyService )
+ {
+ this.surveyService = surveyService;
+ }
+
+ private SurveyDataValueService surveyDataValueService;
+
+ public void setSurveyDataValueService( SurveyDataValueService surveyDataValueService )
+ {
+ this.surveyDataValueService = surveyDataValueService;
+ }
+
+ private PeriodService periodService;
+
+ public void setPeriodService( PeriodService periodService )
+ {
+ this.periodService = periodService;
+ }
+
+ // ---------------------------------------------------------------
+ // Input & Output
+ // ---------------------------------------------------------------
+
+ private HttpSession session;
+
+ public HttpSession getSession()
+ {
+ return session;
+ }
+
+ private SurveyChartResult surveyChartResult;
+
+ public SurveyChartResult getSurveyChartResult()
+ {
+ return surveyChartResult;
+ }
+
+ private OrganisationUnit selectedOrgUnit;
+
+ private Indicator selectedIndicator;
+
+ private String[] series1;
+
+ public String[] getSeries1()
+ {
+ return series1;
+ }
+
+ private String[] series2;
+
+ public String[] getSeries2()
+ {
+ return series2;
+ }
+
+ private String[] categories1;
+
+ public String[] getCategories1()
+ {
+ return categories1;
+ }
+
+ private String[] categories2;
+
+ public String[] getCategories2()
+ {
+ return categories2;
+ }
+ String chartTitle = "Service : ";
+
+ public String getChartTitle()
+ {
+ return chartTitle;
+ }
+
+ String xAxis_Title;
+
+ public String getXAxis_Title()
+ {
+ return xAxis_Title;
+ }
+
+ String yAxis_Title;
+
+ public String getYAxis_Title()
+ {
+ return yAxis_Title;
+ }
+
+ List<String> numeratorDEList;
+
+ public List<String> getNumeratorDEList()
+ {
+ return numeratorDEList;
+ }
+
+ List<String> denominatorDEList;
+
+ public List<String> getDenominatorDEList()
+ {
+ return denominatorDEList;
+ }
+
+ Double data1[][];
+
+ public Double[][] getData1()
+ {
+ return data1;
+ }
+
+ Double data2[][];
+
+ public Double[][] getData2()
+ {
+ return data2;
+ }
+ List<List<String>> dataList;
+
+ public List<List<String>> getDataList()
+ {
+ return dataList;
+ }
+
+ List<String> xseriesList;
+
+ public List<String> getXseriesList()
+ {
+ return xseriesList;
+ }
+
+ List<String> yseriesList;
+
+ public List<String> getYseriesList()
+ {
+ return yseriesList;
+ }
+
+ /* Input Parameters */
+ private int availableIndicators;
+
+ public void setAvailableIndicators( int availableIndicators )
+ {
+ this.availableIndicators = availableIndicators;
+ }
+
+ 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 List<Survey> surveyList;
+
+ public List<Survey> getSurveyList()
+ {
+ return surveyList;
+ }
+
+ private List<Period> monthlyPeriods;
+
+ ListTool listTool;
+
+ public ListTool getListTool()
+ {
+ return listTool;
+ }
+
+ private List<SurveyDataValue> surveyDataValueList;
+
+ public List<SurveyDataValue> getSurveyDataValueList()
+ {
+ return surveyDataValueList;
+ }
+
+ public String execute()throws Exception
+ {
+ statementManager.initialise();
+
+ listTool = new ListTool();
+
+ // dataList = new ArrayList<List<String>>();
+ // xseriesList = new ArrayList<String>();
+ yseriesList = new ArrayList<String>();
+
+ System.out.println( "inside GenerateChartSurveyAction" );
+
+ // OrgUnit Related Info
+ selectedOrgUnit = new OrganisationUnit();
+ selectedOrgUnit = organisationUnitService.getOrganisationUnit( ouIDTB );
+ chartTitle = "Facility : " + selectedOrgUnit.getShortName();
+
+ // Service Related Info
+ selectedIndicator = new Indicator();
+ selectedIndicator = indicatorService.getIndicator( availableIndicators );
+ chartTitle += "\n Indicator : " + selectedIndicator.getName();
+
+ surveyList = new ArrayList<Survey>( surveyService.getSurveysByIndicator( selectedIndicator ) );
+
+ // Map<OrganisationUnitGroup, List<OrganisationUnit>> orgUnitGroupMap = new HashMap<OrganisationUnitGroup, List<OrganisationUnit>>();
+ // Map<Survey, Double> surveyValues = new HashMap<Survey, Double>();
+ //surveyDataValueList = new ArrayList<SurveyDataValue>();
+
+ // Period Related Info
+ Period startPeriod = periodService.getPeriod( sDateLB );
+ Period endPeriod = periodService.getPeriod( eDateLB );
+
+ monthlyPeriods = new ArrayList<Period>( periodService.getPeriodsBetweenDates( new MonthlyPeriodType(),startPeriod.getStartDate(), endPeriod.getEndDate() ) );
+
+ System.out.println( "Chart Generation Start Time is : \t" + new Date() );
+ surveyChartResult = generateChartSurveyData( monthlyPeriods, selectedIndicator,selectedOrgUnit );
+
+ // data1 = getServiceValuesByPeriod();
+ // xAxis_Title = "Period";
+ // yAxis_Title = "Indicator";
+
+
+ ActionContext ctx = ActionContext.getContext();
+ HttpServletRequest req = (HttpServletRequest) ctx.get( ServletActionContext.HTTP_REQUEST );
+
+ session = req.getSession();
+
+ session.setAttribute( "data1", surveyChartResult.getData() );
+ session.setAttribute( "data2", surveyChartResult.getData2() );
+ session.setAttribute( "numDataArray", surveyChartResult.getNumDataArray() );
+ session.setAttribute( "denumDataArray", surveyChartResult.getDenumDataArray() );
+ session.setAttribute( "series1", surveyChartResult.getSeries() );
+ session.setAttribute( "series2", surveyChartResult.getSeries2() );
+ session.setAttribute( "categories1", surveyChartResult.getCategories() );
+ session.setAttribute( "chartTitle", surveyChartResult.getChartTitle() );
+ session.setAttribute( "xAxisTitle", surveyChartResult.getXAxis_Title() );
+ session.setAttribute( "yAxisTitle", surveyChartResult.getYAxis_Title() );
+ session.setAttribute( "categories2", categories2 );
+
+ statementManager.destroy();
+ System.out.println( "Chart Generation End Time is : \t" + new Date() );
+
+ return SUCCESS;
+ }
+
+ public SurveyChartResult generateChartSurveyData( List<Period> monthlyPeriods,Indicator selectedIndicator, OrganisationUnit selectedOrgUnit )
+ throws Exception
+ {
+
+ SurveyChartResult surveyChartResult;
+
+ //Double[][] serviceValues = new Double[1][monthlyPeriods.size()];
+
+ // Double[][] numDataArray = new Double[1][monthlyPeriods.size()];
+ // Double[][] denumDataArray = new Double[1][monthlyPeriods.size()];
+
+ String[] series = new String[1];
+ String[] categories = new String[monthlyPeriods.size()];
+ Double[][] data = new Double[1][monthlyPeriods.size()];
+
+ Double[][] numDataArray = new Double[1][monthlyPeriods.size()];
+ Double[][] denumDataArray = new Double[1][monthlyPeriods.size()];
+
+ categories2 = new String[monthlyPeriods.size()];
+/*
+ Map<String, String> surveyValues = new HashMap<String, String>();
+
+ surveyList = new ArrayList<Survey>( surveyService.getSurveysByIndicator( selectedIndicator ) );
+
+ String surveyDataValue;
+ for ( Survey survey : surveyList )
+ {
+ // Survey survey = surveyService.getSurveyByName( surveyId );
+
+ SurveyDataValue tempSurveyDataValue = surveyDataValueService.getSurveyDataValue( selectedOrgUnit, survey, selectedIndicator );
+ if ( tempSurveyDataValue.getValue() == null )
+ {
+ surveyDataValue = "";
+ }
+ else
+ {
+ surveyDataValue = tempSurveyDataValue.getValue();
+ }
+ surveyValues.put( survey.getName(), surveyDataValue );
+ // selOUGroupMemberList.addAll( selectedOUGroupMemberList );
+ }
+*/
+ // Map<Integer, List<Double>> numData = new HashMap<Integer,
+ // List<Double>>();
+ // Map<Integer, List<Double>> denumData = new HashMap<Integer,
+ // List<Double>>();
+
+ String chartTitle = "OrganisationUnit : " + selectedOrgUnit.getShortName();
+ String xAxis_Title = "Period";
+ String yAxis_Title = "Indicator";
+
+ surveyList = new ArrayList<Survey>( surveyService.getSurveysByIndicator( selectedIndicator ) );
+ surveyDataValueList = new ArrayList<SurveyDataValue>();
+
+ data2 = new Double[surveyList.size()][monthlyPeriods.size()];
+
+ series2 = new String[surveyList.size()];
+
+ for ( int i = 0; i < data2.length; i++ )
+ {
+ Survey survey = surveyList.get( i );
+ SurveyDataValue surveyDataValue = surveyDataValueService.getSurveyDataValue( selectedOrgUnit, survey, selectedIndicator );
+
+ surveyDataValueList.add( surveyDataValue );
+
+ series2[i] = survey.getName();
+
+ for ( int j = 0; j < data2[i].length; j++ )
+ {
+ if ( surveyDataValue != null )
+ {
+ data2[i][j] = Double.parseDouble( surveyDataValue.getValue() );
+ }
+ else
+ {
+ data2[i][j] = 0.0;
+ }
+ }
+ }
+
+ int countForServiceList = 0;
+ int countForPeriodList = 0;
+
+ Iterator<Period> periodListIterator = monthlyPeriods.iterator();
+
+ series[countForServiceList] = selectedIndicator.getName();
+ yseriesList.add( selectedIndicator.getName() );
+
+ Double aggSurveyIndicatorDataValue = 0.0;
+ Double aggIndicatorNumValue = 0.0;
+ Double aggIndicatorDenumValue = 0.0;
+
+ while ( periodListIterator.hasNext() )
+ {
+ Period p = (Period) periodListIterator.next();
+ aggSurveyIndicatorDataValue = aggregationService.getAggregatedIndicatorValue(selectedIndicator, p.getStartDate(), p.getEndDate(), selectedOrgUnit );
+
+ if( aggSurveyIndicatorDataValue == null )
+ {
+ aggSurveyIndicatorDataValue = 0.0;
+ }
+
+ data[countForServiceList][countForPeriodList] = aggSurveyIndicatorDataValue;
+
+ //for indicator value
+ data[countForServiceList][countForPeriodList] = Math.round( data[countForServiceList][countForPeriodList] * Math.pow( 10, 1 ) ) / Math.pow( 10, 1 );
+
+ aggIndicatorNumValue = aggregationService.getAggregatedNumeratorValue( selectedIndicator, p.getStartDate(),p.getEndDate(), selectedOrgUnit );
+ aggIndicatorDenumValue = aggregationService.getAggregatedDenominatorValue( selectedIndicator, p.getStartDate(),p.getEndDate(), selectedOrgUnit );
+
+ // for numenetor value
+ numDataArray[countForServiceList][countForPeriodList] = aggIndicatorNumValue;
+ numDataArray[countForServiceList][countForPeriodList] = Math.round( numDataArray[countForServiceList][countForPeriodList] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+
+ // for denum value
+ denumDataArray[countForServiceList][countForPeriodList] = aggIndicatorDenumValue;
+ denumDataArray[countForServiceList][countForPeriodList] = Math.round( denumDataArray[countForServiceList][countForPeriodList] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+
+
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
+ categories[countForPeriodList] = simpleDateFormat.format( p.getStartDate() );
+ categories2[countForPeriodList] = simpleDateFormat.format( p.getStartDate() );
+
+ countForPeriodList++;
+ }
+ countForServiceList++;
+
+
+ surveyChartResult = new SurveyChartResult( series, series2,categories, data, data2, numDataArray, denumDataArray, chartTitle, xAxis_Title, yAxis_Title );
+ return surveyChartResult;
+
+ }
+
+
+
+}
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sa/action/GenerateSurveyAnalysisDataAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sa/action/GenerateSurveyAnalysisDataAction.java 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/sa/action/GenerateSurveyAnalysisDataAction.java 2010-12-23 07:23:23 +0000
@@ -308,6 +308,8 @@
Survey survey = surveyList.get( i );
SurveyDataValue surveyDataValue = surveyDataValueService.getSurveyDataValue( selectedOrgUnit, survey,
selectedIndicator );
+
+
surveyDataValueList.add( surveyDataValue );
@@ -338,6 +340,8 @@
session.setAttribute( "chartTitle", chartTitle );
session.setAttribute( "xAxisTitle", xAxis_Title );
session.setAttribute( "yAxisTitle", yAxis_Title );
+
+ //session.setAttribute( "surveyList", surveyList );
statementManager.destroy();
@@ -348,6 +352,9 @@
{
Double[][] serviceValues = new Double[1][monthlyPeriods.size()];
+ Double[][] numDataArray = new Double[1][monthlyPeriods.size()];
+ Double[][] denumDataArray = new Double[1][monthlyPeriods.size()];
+
int countForServiceList = 0;
int countForPeriodList = 0;
@@ -365,20 +372,41 @@
Iterator<Period> periodListIterator = monthlyPeriods.iterator();
countForPeriodList = 0;
+
+ Double aggSurveyDataValue = 0.0;
+
+ Double aggIndicatorNumValue = 0.0;
+ Double aggIndicatorDenumValue = 0.0;
+
while ( periodListIterator.hasNext() )
{
Period p = (Period) periodListIterator.next();
- serviceValues[countForServiceList][countForPeriodList] = aggregationService.getAggregatedIndicatorValue(
- selectedIndicator, p.getStartDate(), p.getEndDate(), selectedOrgUnit );
-
- serviceValues[countForServiceList][countForPeriodList] = Math
- .round( serviceValues[countForServiceList][countForPeriodList] * Math.pow( 10, 2 ) )
- / Math.pow( 10, 2 );
-
+ // serviceValues[countForServiceList][countForPeriodList] = aggregationService.getAggregatedIndicatorValue(selectedIndicator, p.getStartDate(), p.getEndDate(), selectedOrgUnit );
+ aggSurveyDataValue = aggregationService.getAggregatedIndicatorValue(selectedIndicator, p.getStartDate(), p.getEndDate(), selectedOrgUnit );
+
+ if( aggSurveyDataValue == null ) aggSurveyDataValue = 0.0;
+
+ serviceValues[countForServiceList][countForPeriodList] = aggSurveyDataValue;
+
+ aggIndicatorNumValue = aggregationService.getAggregatedNumeratorValue( selectedIndicator, p.getStartDate(),p.getEndDate(), selectedOrgUnit );
+ aggIndicatorDenumValue = aggregationService.getAggregatedDenominatorValue( selectedIndicator, p.getStartDate(),p.getEndDate(), selectedOrgUnit );
+
+
+ //for indicator value
+ serviceValues[countForServiceList][countForPeriodList] = Math.round( serviceValues[countForServiceList][countForPeriodList] * Math.pow( 10, 2 ) ) / Math.pow( 10, 2 );
+
+ // for numenetor value
+ numDataArray[countForServiceList][countForPeriodList] = aggIndicatorNumValue;
+ numDataArray[countForServiceList][countForPeriodList] = Math.round( numDataArray[countForServiceList][countForPeriodList] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+
+ // for denum value
+ denumDataArray[countForServiceList][countForPeriodList] = aggIndicatorDenumValue;
+ denumDataArray[countForServiceList][countForPeriodList] = Math.round( denumDataArray[countForServiceList][countForPeriodList] * Math.pow( 10, 1 ) )/ Math.pow( 10, 1 );
+ /*
if ( serviceValues[countForServiceList][countForPeriodList] == -1 )
serviceValues[countForServiceList][countForPeriodList] = 0.0;
-
+ */
SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
categories1[countForPeriodList] = simpleDateFormat.format( p.getStartDate() );
categories2[countForPeriodList] = simpleDateFormat.format( p.getStartDate() );
=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/SurveyChartResult.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/SurveyChartResult.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/util/SurveyChartResult.java 2010-12-23 07:23:23 +0000
@@ -0,0 +1,255 @@
+/*
+ * Copyright (c) 2004-2010, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.hisp.dhis.dataanalyser.util;
+
+import java.util.Map;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ *
+ * @version SurveyChartResult.java Dec 10, 2010 11:13:26 AM
+ */
+public class SurveyChartResult
+{
+
+ //-------------------------------------------------------------------------
+ // Constructor
+ //-------------------------------------------------------------------------
+
+ public SurveyChartResult()
+ {
+
+ }
+
+ public SurveyChartResult( String[] series, String[] series2, String[] categories, Double data[][], Double data2[][], Double numDataArray[][],Double denumDataArray[][],String chartTitle,String xAxis_Title,String yAxis_Title )
+ {
+ this.series = series; // Y-axis
+ this.series2 = series2; // for Survey name
+ this.categories = categories; // X-axis
+ this.data = data;
+ this.data2 = data2; // for survey value
+ this.numDataArray = numDataArray;
+ this.denumDataArray = denumDataArray;
+ this.chartTitle = chartTitle;
+ this.xAxis_Title = xAxis_Title;
+ this.yAxis_Title = yAxis_Title;
+ //this.xseriesList = xseriesList;
+ //this.yseriesList = yseriesList;
+ }
+ //---------------------------------------------------------------
+ // Getters and Setters
+ //---------------------------------------------------------------
+
+
+ private String[] series;
+
+ public String[] getSeries()
+ {
+ return series;
+ }
+
+ public void setSeries( String[] series )
+ {
+ this.series = series;
+ }
+
+ private String[] series2;
+
+
+ public String[] getSeries2()
+ {
+ return series2;
+ }
+
+ public void setSeries2( String[] series2 )
+ {
+ this.series2 = series2;
+ }
+
+
+ private String[] categories;
+
+ public String[] getCategories()
+ {
+ return categories;
+ }
+
+ public void setCategories( String[] categories )
+ {
+ this.categories = categories;
+ }
+
+ Double data[][];
+
+ public Double[][] getData()
+ {
+ return data;
+ }
+
+ public void setData( Double[][] data )
+ {
+ this.data = data;
+ }
+
+ Double data2[][];
+
+ public Double[][] getData2()
+ {
+ return data2;
+ }
+
+ public void setData2( Double[][] data2 )
+ {
+ this.data2 = data2;
+ }
+
+
+ Double numDataArray[][];
+
+ public Double[][] getNumDataArray()
+ {
+ return numDataArray;
+ }
+
+ public void setNumDataArray( Double[][] numDataArray )
+ {
+ this.numDataArray = numDataArray;
+ }
+
+ Double denumDataArray[][];
+
+ public Double[][] getDenumDataArray()
+ {
+ return denumDataArray;
+ }
+
+ public void setDenumDataArray( Double[][] denumDataArray )
+ {
+ this.denumDataArray = denumDataArray;
+ }
+ /*
+ private String[] surveyName;
+
+ public String[] getSurveyName()
+ {
+ return surveyName;
+ }
+
+
+ public void setSurveyName( String[] surveyName )
+ {
+ this.surveyName = surveyName;
+ }
+
+ Double surveyDataValue[][];
+
+ public Double[][] getSurveyDataValue()
+ {
+ return surveyDataValue;
+ }
+
+ public void setSurveyDataValue( Double[][] surveyDataValue )
+ {
+ this.surveyDataValue = surveyDataValue;
+ }
+*/
+ public Map<String, String> surveyValues;
+
+ public Map<String, String> getSurveyValues()
+ {
+ return surveyValues;
+ }
+
+ public void setSurveyValues( Map<String, String> surveyValues )
+ {
+ this.surveyValues = surveyValues;
+ }
+
+
+ /*
+ public Map<Integer, List<Double>> numData;
+
+
+ public Map<Integer, List<Double>> getNumData()
+ {
+ return numData;
+ }
+
+ public void setNumData( Map<Integer, List<Double>> numData )
+ {
+ this.numData = numData;
+ }
+
+ public Map<Integer, List<Double>> denumData;
+
+ public Map<Integer, List<Double>> getDenumData()
+ {
+ return denumData;
+ }
+
+ public void setDenumData( Map<Integer, List<Double>> denumData )
+ {
+ this.denumData = denumData;
+ }
+*/
+ private String chartTitle;
+
+ public String getChartTitle()
+ {
+ return chartTitle;
+ }
+
+ public void setChartTitle( String chartTitle )
+ {
+ this.chartTitle = chartTitle;
+ }
+
+ private String xAxis_Title;
+
+ public String getXAxis_Title()
+ {
+ return xAxis_Title;
+ }
+
+ public void setXAxis_Title( String axis_Title )
+ {
+ xAxis_Title = axis_Title;
+ }
+ private String yAxis_Title;
+
+ public String getYAxis_Title()
+ {
+ return yAxis_Title;
+ }
+
+ public void setYAxis_Title( String axis_Title )
+ {
+ yAxis_Title = axis_Title;
+ }
+
+}
+
=== 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 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2010-12-23 07:23:23 +0000
@@ -353,6 +353,32 @@
</bean>
+ <bean id="org.hisp.dhis.dataanalyser.sa.action.GenerateChartSurveyAction"
+ class="org.hisp.dhis.dataanalyser.sa.action.GenerateChartSurveyAction"
+ scope="prototype">
+ <property name="aggregationService">
+ <ref bean="org.hisp.dhis.aggregation.AggregationService"/>
+ </property>
+ <property name="statementManager" ref="statementManager"/>
+
+ <property name="surveyService">
+ <ref bean="org.hisp.dhis.survey.SurveyService"/>
+ </property>
+ <property name="indicatorService">
+ <ref bean="org.hisp.dhis.indicator.IndicatorService"/>
+ </property>
+ <property name="periodService">
+ <ref bean="org.hisp.dhis.period.PeriodService"/>
+ </property>
+ <property name="organisationUnitService">
+ <ref bean="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
+ </property>
+ <property name="surveyDataValueService">
+ <ref bean="org.hisp.dhis.surveydatavalue.SurveyDataValueService"/>
+ </property>
+ </bean>
+
+<!--
<bean id="org.hisp.dhis.dataanalyser.sa.action.GenerateSurveyAnalysisDataAction"
class="org.hisp.dhis.dataanalyser.sa.action.GenerateSurveyAnalysisDataAction"
scope="prototype">
@@ -377,6 +403,40 @@
<ref bean="org.hisp.dhis.surveydatavalue.SurveyDataValueService"/>
</property>
</bean>
+-->
+<!-- <bean id="org.hisp.dhis.dataanalyser.sa.action.GenerateChartSurveyAction"
+ class="org.hisp.dhis.dataanalyser.sa.action.GenerateChartSurveyAction"
+ scope="prototype">
+ <property name="aggregationService">
+ <ref bean="org.hisp.dhis.aggregation.AggregationService"/>
+ </property>
+ <property name="statementManager" ref="statementManager"/>
+
+ <property name="surveyService">
+ <ref bean="org.hisp.dhis.survey.SurveyService"/>
+ </property>
+ <property name="indicatorService">
+ <ref bean="org.hisp.dhis.indicator.IndicatorService"/>
+ </property>
+ <property name="periodService">
+ <ref bean="org.hisp.dhis.period.PeriodService"/>
+ </property>
+ <property name="organisationUnitService">
+ <ref bean="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
+ </property>
+ <property name="surveyDataValueService">
+ <ref bean="org.hisp.dhis.surveydatavalue.SurveyDataValueService"/>
+ </property>
+ </bean>
+-->
+ <!-- Export Survey to Excel -->
+ <bean id="org.hisp.dhis.dataanalyser.action.ExportSurveyDataToExcelAction"
+ class="org.hisp.dhis.dataanalyser.action.ExportSurveyDataToExcelAction"
+ scope="prototype">
+
+ <property name="configurationService" ref="org.hisp.dhis.config.ConfigurationService">
+ </property>
+ </bean>
<!-- DataStatus -->
@@ -578,8 +638,6 @@
<!-- DataStatus For Mobile end -->
-
-
<bean
id="org.hisp.dhis.dataanalyser.ds.action.GenerateSummaryDataStatusResultAction"
class="org.hisp.dhis.dataanalyser.ds.action.GenerateSummaryDataStatusResultAction"
=== modified file 'local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties'
--- local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties 2010-12-23 07:23:23 +0000
@@ -49,6 +49,7 @@
#------SurveyAnalusis------------------------#
+survey = Survey
sa_survey_analyser = Survey Analyser
#-------TabularAnalysis----------------------#
=== modified file 'local/in/dhis-web-dashboard/src/main/resources/struts.xml'
--- local/in/dhis-web-dashboard/src/main/resources/struts.xml 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/struts.xml 2010-12-23 07:23:23 +0000
@@ -186,10 +186,9 @@
<action name="generateAnnualData"
class="org.hisp.dhis.dataanalyser.aa.action.GenerateAnnualAnalysisDataAction">
- <result name="success" type="velocity">
- /dhis-web-dashboard/annualAnalysisResult.vm</result>
- <param name="javascripts">
- ../dhis-web-commons/ouwt/ouwt.js,javascript/ga.js,javascript/hashtable.js</param>
+ <result name="success" type="velocity">/popup.vm</result>
+ <param name="page">/dhis-web-dashboard/annualAnalysisResult.vm</param>
+ <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,javascript/ga.js,javascript/hashtable.js</param>
<param name="stylesheets">css/StylesForTags.css</param>
<interceptor-ref name="organisationUnitTreeStack"/>
</action>
@@ -219,20 +218,51 @@
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-dashboard/surveyAnalysisFront.vm</param>
<param name="menu">/dhis-web-dashboard/menuWithTreeForSA.vm</param>
- <param name="javascripts">
- ../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/db.js,javascript/aa.js,javascript/hashtable.js,javascript/date.js</param>
+ <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/db.js,javascript/aa.js,javascript/hashtable.js,javascript/date.js</param>
<param name="stylesheets">css/StylesForTags.css</param>
<interceptor-ref name="organisationUnitTreeStack"/>
</action>
- <action name="viewSurveyAnalysisResult"
+<!-- <action name="viewSurveyAnalysisResult"
class="org.hisp.dhis.dataanalyser.sa.action.GenerateSurveyAnalysisDataAction">
<result name="success" type="velocity">
/dhis-web-dashboard/surveyAnalysisResult.vm</result>
<param name="javascripts">
../dhis-web-commons/ouwt/ouwt.js,javascript/ga.js,javascript/hashtable.js</param>
<param name="stylesheets">css/StylesForTags.css</param>
- </action>
+ </action>-->
+
+ <action name="generateChartSurvey"
+ class="org.hisp.dhis.dataanalyser.sa.action.GenerateChartSurveyAction">
+ <result name="success" type="velocity">/popup.vm</result>
+ <param name="page">/dhis-web-dashboard/surveyAnalysisResult.vm</param>
+ <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/ga.js,javascript/hashtable.js</param>
+ <param name="stylesheets">css/StylesForTags.css</param>
+ </action>
+
+
+
+<!-- <action name="viewSurveyAnalysisResult"
+ class="org.hisp.dhis.dataanalyser.sa.action.GenerateChartSurveyAction">
+ <result name="success" type="velocity">/dhis-web-dashboard/surveyAnalysisResult.vm</result>
+ <param name="javascripts">
+ ../dhis-web-commons/ouwt/ouwt.js,javascript/ga.js,javascript/hashtable.js</param>
+ <param name="stylesheets">css/StylesForTags.css</param>
+ </action>
+ -->
+
+ <!-- Export Survey data to Excel -->
+ <action name="exportSurveyDataToExcel"
+ class="org.hisp.dhis.dataanalyser.action.ExportSurveyDataToExcelAction">
+ <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 -->
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/annualAnalysisResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/annualAnalysisResult.vm 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/annualAnalysisResult.vm 2010-12-23 07:23:23 +0000
@@ -58,33 +58,85 @@
<option value="LineAndBarChart">Line And BarChart</option>
<option value="AreaChart" >Area Chart</option>
</select>
-
-
</div>
<br /><br />
+#if($riRadio.equals("indicatorsRadio"))
+ <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: solid" bordercolor="black" width="100%">
+ <tr>
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Year</strong></td>
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" align="center" style="border-style: dotted; border-width: 1"><strong> </strong></td>
+ #foreach($xaxisvalue in $xseriesList)
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" align="center" style="border-style: dotted; border-width: 1" ><strong>$xaxisvalue</strong></td>
+ #end
+ </tr>
+
+ #set($count1 = 0)
+ #foreach($onedataList in $dataList)
+ <tr>
+
+ #set( $numValCimpleteResult = $numServiceValues )
+ #set( $denumValCimpleteResult = $denumServiceValues )
+
+ #set( $numValList = $listTool.get($numValCimpleteResult, $count1) )
+ #set( $denumValList = $listTool.get($denumValCimpleteResult, $count1) )
+
+ <td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" rowspan="3" >$yseriesList.get( $count1 )</td>
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Num</strong></td>
+ #set( $count2 = 0 )
+ #foreach($data in $onedataList)
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$listTool.get($numValList, $count2)</td>
+ #set( $count2 = $count2 + 1 )
+ #end
+ </tr>
+ <tr>
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Den</strong></td>
+ #set( $count2 = 0 )
+ #foreach($data in $onedataList)
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$listTool.get($denumValList, $count2)</td>
+ #set( $count2 = $count2 + 1 )
+ #end
+ </tr>
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Val</strong></td>
+ #set( $count2 = 0 )
+ #foreach($data in $onedataList)
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1"><strong>$data</strong></td>
+ #set( $count2 = $count2 + 1 )
+ #end
+ </tr>
+ #set($count1 = $count1 + 1)
+ #end
+ </table>
- <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: dotted" bordercolor="#111111" width="100%">
+ <br />
+ <div align="center">
+ <iframe name="iframeForChart" id="iframeForChart" src="generateChart.action?currentChart=Vertical3DBarChart" width="850px" height="550px" scrolling=auto frameborder="0"></iframe>
+ </div>
+#else
+ <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: solid" bordercolor="black" width="100%">
<tr>
- <td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1">Year</td>
- #foreach($xaxisvalue in $xseriesList)
- <td class="TableHeadingCellStyles" align="center" style="border-style: dotted; border-width: 1">$xaxisvalue</td>
- #end
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Year</strong></td>
+ #foreach($xaxisvalue in $xseriesList)
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" align="center" style="border-style: dotted; border-width: 1" ><strong>$xaxisvalue</strong></td>
+ #end
</tr>
- #set($count1 = 0)
+ #set($count1 = 0)
#foreach($onedataList in $dataList)
<tr>
<td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1">$yseriesList.get($count1)</td>
- #foreach($data in $onedataList)
- <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$decimalFormat.format( $data )</td>
- #end
- #set($count1 = $count1 + 1)
+ #foreach($data in $onedataList)
+ <!-- <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1"><strong>$decimalFormat.format( $data )</strong></td> -->
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1"><strong>$data</strong></td>
+ #end
+ #set($count1 = $count1 + 1)
</tr>
- #end
+ #end
</table>
<br />
- <div align="center">
- <iframe name="iframeForChart" id="iframeForChart" src="generateChart.action?currentChart=Vertical3DBarChart" width="850px" height="550px" scrolling=auto frameborder="0"></iframe>
- </div>
+ <div align="center">
+ <iframe name="iframeForChart" id="iframeForChart" src="generateChart.action?currentChart=Vertical3DBarChart" width="850px" height="550px" scrolling=auto frameborder="0"></iframe>
+ </div>
+
+#end
</body>
</html>
\ No newline at end of file
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisIndicatorResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisIndicatorResult.vm 2010-11-22 13:02:23 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisIndicatorResult.vm 2010-12-23 07:23:23 +0000
@@ -141,6 +141,7 @@
<td class="NormalB"><a id="exportExcelAnchor1" name="exportExcelAnchor1" href="#" onclick="javascript:exportToExcelFunction1('no')" target="_blank">Export To Excel</a></td>
<td class="NormalB"> <!--<font face="Arial, Helvetica, sans-serif" color="#000000">-->
<select id="chartTypeOption" name="chartTypeOption" onchange="chartTypeOptionChange(event)">
+ <option value="Vertical3DBarChart">Select Chart Type</option>
<option value="Vertical3DBarChart">Vertical 3D BarChart</option>
<option value="Horizontal3DBarChart">Horizontal 3D BarChart</option>
<option value="LineChart">Line Chart</option>
@@ -164,42 +165,51 @@
<div id="headingInfoId">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: solid" bordercolor="black" width="100%">
<tr>
- <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" rowspan="2"><strong>Indicator Names</strong></td>
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1"><strong>Indicator Names</strong></td>
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" align="center" style="border-style: dotted; border-width: 1"><strong> </strong></td>
#foreach($xaxisvalue in $indicatorChartResult.categories)
- <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" colspan="3"><strong>$xaxisvalue</strong></td>
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1"><strong>$xaxisvalue</strong></td>
#end
</tr>
+ #set($count1 = 0)
+ #foreach($onedataList in $indicatorChartResult.data )
+
<tr>
-
- #foreach($xaxisvalue in $indicatorChartResult.categories)
- <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Num</strong></td>
- <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Den</strong></td>
- <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Val</strong></td>
- #end
+ #set( $numValCimpleteResult = $indicatorChartResult.numDataArray )
+ #set( $denumValCimpleteResult = $indicatorChartResult.denumDataArray )
+ #set( $numValList = $listTool.get($numValCimpleteResult, $count1) )
+ #set( $denumValList = $listTool.get($denumValCimpleteResult, $count1) )
+ #set( $count2 = 0 )
+
+ <td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" rowspan="3">$yseriesList.get($count1).name</td>
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Num</strong></td>
+ #foreach($data in $onedataList)
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$listTool.get($numValList, $count2)</td>
+ #set( $count2 = $count2 + 1 )
+ #end
</tr>
- #set( $numValCimpleteResult = $indicatorChartResult.numDataArray )
- #set( $denumValCimpleteResult = $indicatorChartResult.denumDataArray )
- #set($count1 = 0)
- #foreach($onedataList in $indicatorChartResult.data )
-
- <tr>
- <td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1">$yseriesList.get($count1).name</td>
-
- #set( $numValList = $listTool.get($numValCimpleteResult, $count1) )
- #set( $denumValList = $listTool.get($denumValCimpleteResult, $count1) )
- #set( $count2 = 0 )
- #foreach($data in $onedataList)
-
- <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$listTool.get($numValList, $count2)</td>
- <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$listTool.get($denumValList, $count2)</td>
- <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$data</td>
-
- #set( $count2 = $count2 + 1 )
- #end
-
- </tr>
- #set( $count1 = $count1 + 1 )
- #end
+
+ <tr>
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Den</strong></td>
+ #set( $count2 = 0 )
+ #foreach($data in $onedataList)
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$listTool.get($denumValList, $count2)</td>
+ #set( $count2 = $count2 + 1 )
+ #end
+ </tr>
+
+ <tr>
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Val</strong></td>
+ #set( $count2 = 0 )
+ #foreach($data in $onedataList)
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1"><strong>$data</strong></td>
+ #set( $count2 = $count2 + 1 )
+ #end
+
+ </tr>
+ #set( $count1 = $count1 + 1 )
+
+ #end
</table>
</div>
</div>
@@ -235,5 +245,5 @@
</table>
- <textarea id="testId" rows="10" cols="70" style="display:none"> </textarea>
+ <textarea id="testId" rows="10" cols="70" style="display:none"> </textarea>
</form>
=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisIndicatorResult_16Dec2010.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisIndicatorResult_16Dec2010.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisIndicatorResult_16Dec2010.vm 2010-12-23 07:23:23 +0000
@@ -0,0 +1,240 @@
+<script>
+
+ function drillDownResult(evt, selVal )
+ {
+ evt.target.href = "drillDownResult.action?selectedValues="+selVal;
+ }
+
+// Chart Display Option change start
+
+ function chartTypeOptionChange(evt)
+ {
+
+
+ var chartTypeOptionList = document.getElementById("chartTypeOption");
+ var chartTypeOptionValue = chartTypeOptionList.options[ chartTypeOptionList.selectedIndex ].value;
+
+ // var tempICount = $selectedServiceList.size();
+
+ // alert(chartTypeOptionValue);
+
+ var chartDisplayOptionList = document.getElementById("chartDisplayOption");
+ var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
+
+ // alert(chartDisplayOptionValue);
+
+ iframeForChart.location.href = "generateChart1.action?currentChart="+chartTypeOptionValue+"&chartDisplayOption="+chartDisplayOptionValue;
+
+ }
+
+// Chart Display Option change for sorting
+
+ function chartDisplayOptionChange(evt)
+ {
+
+ var chartTypeOptionList = document.getElementById("chartTypeOption");
+ var chartTypeOptionValue = chartTypeOptionList.options[ chartTypeOptionList.selectedIndex ].value;
+ // alert(chartTypeOptionValue);
+ var chartDisplayOptionList = document.getElementById("chartDisplayOption");
+ var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
+ // alert(chartDisplayOptionValue);
+ // iframeForChart.location.href = "generateChart1.action?currentChart="+chartNamesToView[chartType][indexForChart]+"&chartDisplayOption="+chartDisplayOptionValue;
+
+ iframeForChart.location.href = "generateChart1.action?currentChart="+chartTypeOptionValue+"&chartDisplayOption="+chartDisplayOptionValue;
+
+ getSortedList(chartDisplayOptionValue);
+ }
+
+function getSortedListForSummary()
+{
+ var chartDisplayOptionList = document.getElementById("chartDisplayOption");
+ var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
+
+ getSortedList(chartDisplayOptionValue);
+}
+
+function getSortedList(chartDisplayOptionValue)
+{
+ //var url = "getSortedData.action?chartDisplayOption=" + chartDisplayOptionValue;
+
+ var request = new Request();
+ request.setResponseTypeXML( 'messages' );
+ request.setCallbackSuccess( getSortedListReceived );
+ //request.send( url );
+
+ // alert("inside sorting function");
+ var requestString = "getSortedIndicatorData.action";
+ var params = "chartDisplayOption=" + chartDisplayOptionValue;
+ request.sendAsPost( params );
+ request.send( requestString );
+}
+
+function getSortedListReceived(xmlObject)
+{
+ var messages = xmlObject.getElementsByTagName("message");
+ document.getElementById("headingInfoId").innerHTML = "";
+ document.getElementById("testId").value = "";
+
+ for ( var i = 0; i < messages.length; i++ )
+ {
+ var hinfo = messages[ i ].firstChild.nodeValue;
+ //document.getElementById("headingInfoId").innerHTML += hinfo;
+ document.getElementById("testId").value += hinfo;
+ }
+
+ document.getElementById("headingInfoId").innerHTML = document.getElementById("testId").value;
+}
+
+//fucction for selected Button is ViewChart
+
+function exportToExcelFunction1( summaryOption )
+ {
+ //alert("inside Viw Summary: " + summaryOption );
+ var chartDisplayOptionList = document.getElementById("chartDisplayOption");
+ var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
+
+ document.getElementById("exportExcelAnchor1").href="exportIndicatorToExcel.action?viewSummary="+summaryOption+"&chartDisplayOption="+chartDisplayOptionValue;
+
+ }
+
+function exportDataStatusResultToWorkBook()
+ {
+ document.getElementById('htmlCode').value = document.getElementById('formResult').innerHTML;
+
+ return true;
+ }
+
+//fucction for selected Button is ViewSummary
+
+function exportToExcelFunction2( summaryOption )
+ {
+ // alert("inside Viw Summary" + summaryOption );
+ var chartDisplayOptionList = document.getElementById("chartDisplayOption");
+ var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
+
+ document.getElementById("exportExcelAnchor2").href="exportIndicatorToExcel.action?viewSummary="+summaryOption+"&chartDisplayOption="+chartDisplayOptionValue;
+
+ }
+
+</script>
+<div align="right" class="NormalB">
+ <table>
+ <tr>
+ <td class="NormalB">
+ #if($selectedButton.equals("ViewSummary"))
+
+ <td class="NormalB"><a id="exportExcelAnchor2" name="exportExcelAnchor2" href="#" onclick="javascript:exportToExcelFunction2('yes')" target="_blank">Export To WorkBook</a></td>
+ <td class="NormalB">
+ <select id="chartDisplayOption" name="chartDisplayOption" onchange="getSortedListForSummary()">
+ <option value="none">Select Sort Type</option>
+ <option value="ascend">Ascending</option>
+ <option value="desend">Desending</option>
+ <option value="alphabet">Alphabetical</option>
+ </select>
+
+
+ </td>
+
+ </tr>
+ #else
+ <tr>
+ <td class="NormalB"><a id="exportExcelAnchor1" name="exportExcelAnchor1" href="#" onclick="javascript:exportToExcelFunction1('no')" target="_blank">Export To Excel</a></td>
+ <td class="NormalB"> <!--<font face="Arial, Helvetica, sans-serif" color="#000000">-->
+ <select id="chartTypeOption" name="chartTypeOption" onchange="chartTypeOptionChange(event)">
+ <option value="Vertical3DBarChart">Vertical 3D BarChart</option>
+ <option value="Horizontal3DBarChart">Horizontal 3D BarChart</option>
+ <option value="LineChart">Line Chart</option>
+ <option value="LineAndBarChart">Line And BarChart</option>
+ <option value="AreaChart" >Area Chart</option>
+ </select>
+
+ <select id="chartDisplayOption" name="chartDisplayOption" onchange="chartDisplayOptionChange(event)">
+ <option value="none">Select Sort Type</option>
+ <option value="ascend">Ascending</option>
+ <option value="desend">Desending</option>
+ <option value="alphabet">Alphabetical</option>
+ </select>
+ </td>
+ </tr>
+ #end
+ </table>
+</div>
+
+<div id="formResult">
+<div id="headingInfoId">
+<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: solid" bordercolor="black" width="100%">
+ <tr>
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" rowspan="2"><strong>Indicator Names</strong></td>
+ #foreach($xaxisvalue in $indicatorChartResult.categories)
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" colspan="3"><strong>$xaxisvalue</strong></td>
+ #end
+ </tr>
+
+ <tr>
+
+ #foreach($xaxisvalue in $indicatorChartResult.categories)
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Num</strong></td>
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Den</strong></td>
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Val</strong></td>
+ #end
+ </tr>
+ #set( $numValCimpleteResult = $indicatorChartResult.numDataArray )
+ #set( $denumValCimpleteResult = $indicatorChartResult.denumDataArray )
+ #set($count1 = 0)
+ #foreach($onedataList in $indicatorChartResult.data )
+
+ <tr>
+ <td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1">$yseriesList.get($count1).name</td>
+
+ #set( $numValList = $listTool.get($numValCimpleteResult, $count1) )
+ #set( $denumValList = $listTool.get($denumValCimpleteResult, $count1) )
+ #set( $count2 = 0 )
+ #foreach($data in $onedataList)
+
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$listTool.get($numValList, $count2)</td>
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$listTool.get($denumValList, $count2)</td>
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$data</td>
+
+ #set( $count2 = $count2 + 1 )
+ #end
+
+ </tr>
+ #set( $count1 = $count1 + 1 )
+ #end
+ </table>
+</div>
+</div>
+#if($selectedButton.equals("ViewSummary"))
+ <br><br>
+ #else
+ <br>
+ <div align="center">
+ <iframe name="iframeForChart" id="iframeForChart" src="generateChart1.action?currentChart=Vertical3DBarChart" width="850px" height="550px" scrolling=auto frameborder="0"></iframe>
+ </div>
+ <br>
+#end
+</div>
+
+ <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: solid" bordercolor="black" width="100%">
+ <tr>
+ <td class="TableHeadingCellStyles" width="30%" align="center" bgcolor="#C0C0C0" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"><strong>Indicator Names</strong></td>
+ <td class="TableHeadingCellStyles" width="30%" align="center" bgcolor="#C0C0C0" colspan="2" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"><strong>Formula</strong></td>
+ <td class="TableHeadingCellStyles" width="20%" align="center" bgcolor="#C0C0C0" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"><strong>Numerator DataElements</strong></td>
+ <td class="TableHeadingCellStyles" width="20%" align="center" bgcolor="#C0C0C0" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"><strong>Denominator DataElements</strong></td>
+ </tr>
+ #set($count1 = 0)
+ #foreach($service in $yseriesList )
+ <tr>
+ <td class="TableHeadingCellStyles" width="30%" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1">$service.getName()</td>
+ <td class="TableHeadingCellStyles" width="25%" align="center" style="border-left-style:dotted; border-left-width:1; border-right-width:0; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"><u>$service.getNumeratorDescription()</u><br>$service.getDenominatorDescription()</td>
+ <td class="TableHeadingCellStyles" width="5%" align="left" style="border-left-style:dotted; border-left-width:0; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1"> X $service.getIndicatorType().getFactor()</td>
+ <td class="TableHeadingCellStyles" width="20%" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1">$numeratorDEList.get($count1)</td>
+ <td class="TableHeadingCellStyles" width="20%" style="border-left-style:dotted; border-left-width:1; border-right-width:1; border-top-style:dotted; border-top-width:1; border-bottom-style:dotted; border-bottom-width:1">$denominatorDEList.get($count1)</td>
+ </tr>
+ #set($count1 = $count1 + 1)
+ #end
+ </table>
+
+
+ <textarea id="testId" rows="10" cols="70" style="display:none"> </textarea>
+</form>
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm 2010-12-23 07:23:23 +0000
@@ -7,8 +7,8 @@
<li><a href="annualAnalyser.action">$i18n.getString( "annual" )</a></li>
<li><a href="graphicalAnalyserDataElement.action">$i18n.getString( "dataelements_wise" )</a></li>
<li><a href="graphicalAnalyserIndicator.action">$i18n.getString( "indicator_wise" )</a></li>
- <!-- <li><a href="surveyAnalyser.action">Survey</a></li>
- <li><a href="motionChartForm.action">MotionChart</a></li> -->
+ <li><a href="surveyAnalyser.action">$i18n.getString( "survey" )</a></li>
+ <!-- <li><a href="motionChartForm.action">MotionChart</a></li> -->
</ul>
<li><a href="tabularAnalysisForm.action">$i18n.getString( "ta" )</a></li>
<li>$i18n.getString( "ds_datastatus" )</li>
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForGAIndicator.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForGAIndicator.vm 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForGAIndicator.vm 2010-12-23 07:23:23 +0000
@@ -9,8 +9,8 @@
<a href="index.action">
<img src="images/goback.png" width="36" height="30" alt="$i18n.getString( "go_back" )"></a>
</div>
-#parse( "/dhis-web-commons/ouwt/orgunittree.vm" )
-
+##parse( "/dhis-web-commons/ouwt/orgunittree.vm" )
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )
<!-- The script that registeres selctions in the orgunit tree -->
<script type="text/javascript">
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisFront.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisFront.vm 2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisFront.vm 2010-12-23 07:23:23 +0000
@@ -1,8 +1,7 @@
<h1>Survey Analyser</h1>
<hr /><br />
-
-<form id="ChartGenerationForm" name="ChartGenerationForm" action="viewSurveyAnalysisResult.action" method="post" onsubmit="return formValidationsForSurvey()" target="chartWindow1">
+<form id="ChartGenerationForm" name="ChartGenerationForm" action="generateChartSurvey.action" method="post" onsubmit="return formValidationsForSurvey()" target="chartWindow1">
<table align="center" style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="730" border=0>
<tr>
<td class="NormalB">
=== 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-06-04 11:50:05 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisResult.vm 2010-12-23 07:23:23 +0000
@@ -1,20 +1,8 @@
-
-<html>
-<head>
-<title>Chart Result Screen</title>
-<link type="text/css" rel="stylesheet" href="css/StylesForTags.css">
-<script type="text/javascript" src="../dhis-web-commons/request.js"></script>
-<script type="text/javascript" src="javascript/lists.js"></script>
-<script type="text/javascript" src="javascript/ga.js"></script>
-<script type="text/javascript" src="javascript/hashtable.js"></script>
-
<script>
-
-
- function chartDisplayOptionChange(evt)
- {
-
+
+function chartDisplayOptionChange(evt)
+{
var chartType = 0;
var tempICount = $selectedServiceList.size();
if(tempICount==0) chartType=0;
@@ -22,297 +10,105 @@
else chartType=2;
var chartDisplayOptionList = document.getElementById("chartDisplayOption");
- var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
+ var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
- iframeForChart.location.href = "generateChart.action?currentChart="+chartNamesToView[chartType][indexForChart]+"&chartDisplayOption="+chartDisplayOptionValue;
-
- getSortedList(chartDisplayOptionValue);
- }
-
+ iframeForChart.location.href = "generateChart.action?currentChart="+chartNamesToView[chartType][indexForChart]+"&chartDisplayOption="+chartDisplayOptionValue;
+ // iframeForChart.location.href = "generateChart1.action?currentChart="+chartNamesToView[chartType][indexForChart]+"&chartDisplayOption="+chartDisplayOptionValue;
+
+ getSortedList(chartDisplayOptionValue);
+}
function exportToExcelFunction1( summaryOption )
{
- //var chartDisplayOptionList = document.getElementById("chartDisplayOption");
- //var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
-
- document.getElementById("exportExcelAnchor1").href="exportToExcel.action?viewSummary="+summaryOption+"&chartDisplayOption=none";
+ //var chartDisplayOptionList = document.getElementById("chartDisplayOption");
+ //var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
+
+ document.getElementById("exportExcelAnchor1").href="exportSurveyDataToExcel.action?viewSummary="+summaryOption+"&chartDisplayOption=none";
+
+ //document.getElementById("exportExcelAnchor1").href="exportToExcel.action?viewSummary="+summaryOption+"&chartDisplayOption=none";
}
- function exportDataStatusResultToWorkBook()
- {
- document.getElementById('htmlCode').value = document.getElementById('formResult').innerHTML;
-
- return true;
- }
-
-</script>
-
-<script>
-
-
-// -----------------------------------------------------------------------------
-// Author: Torgeir Lorange Ostby, torgeilo@xxxxxxxxx
-// Version: $Id: request.js 2644 2007-01-03 13:24:56Z torgeilo $
-// -----------------------------------------------------------------------------
-
-/*
- * Usage:
- *
- * function processResponse( response ) { ... } // Text or XML
- * function requestFailed( httpStatusCode ) { ... }
- *
- * var request = new Request();
- * request.setResponseTypeXML( 'rootElement' ); // Optional
- * request.sendAsPost( 'value=1&value=2' ); // Optional
- * request.setCallbackSuccess( processResponse ); // Optional
- * request.setCallbackError( requestFailed ); // Optional
- * request.send( 'url.action?value=1' );
- */
-
-function Request()
-{
- var request;
- var responseType = 'TEXT';
- var requestMethod = 'GET';
- var requestParameters = null;
- var rootElementName;
- var callbackSuccess;
- var callbackError;
-
- this.setResponseTypeXML = function( rootElementName_ )
- {
- responseType = 'XML';
- rootElementName = rootElementName_;
- };
-
- this.sendAsPost = function( requestParameters_ )
- {
- requestMethod = 'POST';
- requestParameters = requestParameters_;
- };
-
- this.setCallbackSuccess = function( callbackSuccess_ )
- {
- callbackSuccess = callbackSuccess_;
- };
-
- this.setCallbackError = function( callbackError_ )
- {
- callbackError = callbackError_;
- };
-
- this.send = function( url )
- {
- request = newXMLHttpRequest();
-
- if ( !request )
- {
- window.alert( "Your browser doesn't support XMLHttpRequest" );
- return;
- }
-
- request.onreadystatechange = responseReceived;
- request.open( requestMethod, url, true );
- request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );
- request.send( requestParameters );
- };
-
- function newXMLHttpRequest()
- {
- if ( window.XMLHttpRequest )
- {
- try
- {
- return new XMLHttpRequest();
- }
- catch ( e )
- {
- return false;
- }
- }
- else if ( window.ActiveXObject )
- {
- try
- {
- return new ActiveXObject( 'Msxml2.XMLHTTP' );
- }
- catch ( e )
- {
- try
- {
- return new ActiveXObject( 'Microsoft.XMLHTTP' );
- }
- catch ( ee )
- {
- return false;
- }
- }
- }
-
- return false;
- }
-
- function responseReceived()
- {
- if ( request.readyState == 4 )
- {
- switch( request.status )
- {
- case 200:
- if ( callbackSuccess )
- {
- if ( responseType == 'TEXT' )
- {
- callbackSuccess( request.responseText );
- }
- else
- {
- var xml = textToXML( request.responseText, rootElementName );
-
- callbackSuccess( xml );
- }
- }
- break;
- case 204:
- if ( callbackSuccess )
- {
- callbackSuccess( null );
- }
- break;
- case 500:
- var message = 'Operation failed - internal server error';
-
- var serverMessage = request.responseText;
-
- if ( serverMessage )
- {
- var maxLength = 512;
-
- if ( serverMessage.length > maxLength )
- {
- serverMessage = serverMessage.substring( 0, maxLength - 3 ) + '...';
- }
-
- if ( serverMessage.length > 0 )
- {
- message += '\n\n' + serverMessage;
- }
- }
-
- message += '\n\nThe error details are logged';
-
- window.alert( message );
-
- break;
- default:
- if ( callbackError )
- {
- callbackError( request.status );
- }
- }
- }
- }
-
- function textToXML( text, rootElementName )
- {
- var docImpl = document.implementation;
- var parser, dom;
-
- // For standards compliant browsers
- if ( docImpl && docImpl.createLSParser )
- {
- parser = docImpl.createLSParser( docImpl.MODE_SYNCHRONOUS, null );
- var input = docImpl.createLSInput();
- input.stringData = text;
- return parser.parse( input ).documentElement;
- }
-
- // For IE
- else if ( window.ActiveXObject )
- {
- dom = new ActiveXObject( 'Microsoft.XMLDOM' );
- dom.async = "false";
- dom.loadXML( text );
- return dom.getElementsByTagName( rootElementName )[0];
- }
-
- // For Mozilla
- else if ( window.DOMParser )
- {
- parser = new DOMParser();
- dom = parser.parseFromString( text, 'application\/xml' );
- return dom.documentElement;
- }
-
- // No parsing abilities
- return null;
- }
+function exportDataStatusResultToWorkBook()
+{
+ document.getElementById('htmlCode').value = document.getElementById('formResult').innerHTML;
+
+ return true;
}
-
-
-
-
</script>
</head>
<body >
- <div align="right">
-
-
-
- <a id="exportExcelAnchor1" name="exportExcelAnchor1" href="#" onclick="javascript:exportToExcelFunction1('no')" target="_blank">Export To Excel</a>
-
- </div>
- <br>
- <form id="form1" name="form1" action="exportDataStatusToExcel.action" method="post" onsubmit="return exportDataStatusResultToWorkBook()" target="_newtab">
- <input type="hidden" name="htmlCode" id="htmlCode" />
- <div align="right" class="NormalB">
- <!--<input type="submit" name="ExportToWorkBook" value="Export To WorkBook" style="width: 160; height: 25; font-family:Arial; font-weight:bold; color:#000000">-->
- </div>
- <div id="formResult">
-
- <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: dotted" bordercolor="#111111" width="100%">
- <tr>
- <td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" >Service Name</td>
- #foreach( $survey in $surveyList )
- <td class="TableHeadingCellStyles" align="center" style="border-style: dotted; border-width: 1">$survey.name</td>
- #end
-
- #foreach($xaxisvalue in $xseriesList)
- <td class="TableHeadingCellStyles" align="center" style="border-style: dotted; border-width: 1" >$xaxisvalue</td>
- #end
- </tr>
- #set($count1 = 0)
- #foreach($onedataList in $dataList)
- <tr>
- <td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1">$yseriesList.get($count1)</td>
- #foreach( $surveyDV in $surveyDataValueList )
- <td class="TableHeadingCellStyles" align="center" style="border-style: dotted; border-width: 1">$!surveyDV.value</td>
- #end
-
- #set($count2 = 0)
- #foreach($data in $onedataList)
- <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$data</td>
- #set($count2 = $count2 + 1)
- #end
- #set($count1 = $count1 + 1)
- </tr>
- #end
- </table>
-
-
-
- <br>
- <div align="center">
- <iframe name="iframeForChart" id="iframeForChart" src="generateChart.action?currentChart=SurveyChart" width="850px" height="550px" scrolling=auto frameborder="0"></iframe>
- </div>
- <br>
-
+<div align="right">
+ <a id="exportExcelAnchor1" name="exportExcelAnchor1" href="#" onclick="javascript:exportToExcelFunction1('no')" target="_blank">Export To Excel</a>
</div>
-
- <textarea id="testId" rows="10" cols="70" style="display:none"> </textarea>
- </form>
+<br>
+<form id="form1" name="form1" action="exportDataStatusToExcel.action" method="post" onsubmit="return exportDataStatusResultToWorkBook()" target="_newtab">
+<input type="hidden" name="htmlCode" id="htmlCode" />
+<div align="right" class="NormalB">
+ <!--<input type="submit" name="ExportToWorkBook" value="Export To WorkBook" style="width: 160; height: 25; font-family:Arial; font-weight:bold; color:#000000">-->
+</div>
+<div id="formResult">
+
+<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: solid" bordercolor="black" width="100%">
+ <tr>
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" >Indicator Name</td>
+ #foreach( $survey in $surveyChartResult.series2 )
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" align="center" style="border-style: dotted; border-width: 1" >$survey</td>
+ #end
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" align="center" style="border-style: dotted; border-width: 1"><strong> </strong></td>
+ #foreach($xaxisvalue in $surveyChartResult.categories )
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" align="center" style="border-style: dotted; border-width: 1" >$xaxisvalue</td>
+ #end
+ </tr>
+ #set($count1 = 0)
+ #set( $surveyDataValueResult = $surveyChartResult.data2 )
+ #foreach($onedataList in $surveyChartResult.data )
+ <tr>
+ #set( $numValCimpleteResult = $surveyChartResult.numDataArray )
+ #set( $denumValCimpleteResult = $surveyChartResult.denumDataArray )
+
+ #set( $numValList = $listTool.get($numValCimpleteResult, $count1) )
+ #set( $denumValList = $listTool.get($denumValCimpleteResult, $count1) )
+ #set( $count2 = 0 )
+
+ <td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" rowspan="3" >$yseriesList.get($count1)</td>
+ #foreach( $surveyDV in $surveyDataValueList )
+ <td class="TableHeadingCellStyles" align="center" style="border-style: dotted; border-width: 1" rowspan="3" >$!surveyDV.value</td>
+ #end
+
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Num</strong></td>
+ #foreach($data in $onedataList)
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$listTool.get($numValList, $count2)</td>
+ #set( $count2 = $count2 + 1 )
+ #end
+ </tr>
+ <tr>
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Den</strong></td>
+ #set( $count2 = 0 )
+ #foreach($data in $onedataList)
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$listTool.get($denumValList, $count2)</td>
+ #set( $count2 = $count2 + 1 )
+ #end
+ </tr>
+ <tr>
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Val</strong></td>
+ #set( $count2 = 0 )
+ #foreach($data in $onedataList)
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1"><strong>$data</strong></td>
+ #set( $count2 = $count2 + 1 )
+ #end
+ </tr>
+ #set( $count1 = $count1 + 1 )
+
+ #end
+</table>
+<div align="center">
+ <iframe name="iframeForChart" id="iframeForChart" src="generateChart.action?currentChart=SurveyChart" width="850px" height="550px" scrolling=auto frameborder="0"></iframe>
+</div>
+ <br>
+</div>
+<textarea id="testId" rows="10" cols="70" style="display:none"> </textarea>
+</form>
</body>
- </html>
\ No newline at end of file
=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisResult_17Dec2010.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisResult_17Dec2010.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/surveyAnalysisResult_17Dec2010.vm 2010-12-23 07:23:23 +0000
@@ -0,0 +1,317 @@
+
+
+<html>
+<head>
+<title>Chart Result Screen</title>
+<link type="text/css" rel="stylesheet" href="css/StylesForTags.css">
+<script type="text/javascript" src="../dhis-web-commons/request.js"></script>
+<script type="text/javascript" src="javascript/lists.js"></script>
+<script type="text/javascript" src="javascript/ga.js"></script>
+<script type="text/javascript" src="javascript/hashtable.js"></script>
+
+<script>
+
+
+ function chartDisplayOptionChange(evt)
+ {
+
+ var chartType = 0;
+ var tempICount = $selectedServiceList.size();
+ if(tempICount==0) chartType=0;
+ else if(tempICount==1) chartType=1;
+ else chartType=2;
+
+ var chartDisplayOptionList = document.getElementById("chartDisplayOption");
+ var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
+
+ iframeForChart.location.href = "generateChart.action?currentChart="+chartNamesToView[chartType][indexForChart]+"&chartDisplayOption="+chartDisplayOptionValue;
+ // iframeForChart.location.href = "generateChart1.action?currentChart="+chartNamesToView[chartType][indexForChart]+"&chartDisplayOption="+chartDisplayOptionValue;
+
+ getSortedList(chartDisplayOptionValue);
+ }
+
+
+function exportToExcelFunction1( summaryOption )
+{
+ //var chartDisplayOptionList = document.getElementById("chartDisplayOption");
+ //var chartDisplayOptionValue = chartDisplayOptionList.options[ chartDisplayOptionList.selectedIndex ].value;
+
+ document.getElementById("exportExcelAnchor1").href="exportSurveyDataToExcel.action?viewSummary="+summaryOption+"&chartDisplayOption=none";
+
+ //document.getElementById("exportExcelAnchor1").href="exportToExcel.action?viewSummary="+summaryOption+"&chartDisplayOption=none";
+
+}
+
+function exportDataStatusResultToWorkBook()
+{
+ document.getElementById('htmlCode').value = document.getElementById('formResult').innerHTML;
+
+ return true;
+}
+
+</script>
+
+<script>
+
+
+// -----------------------------------------------------------------------------
+// Author: Torgeir Lorange Ostby, torgeilo@xxxxxxxxx
+// Version: $Id: request.js 2644 2007-01-03 13:24:56Z torgeilo $
+// -----------------------------------------------------------------------------
+
+/*
+ * Usage:
+ *
+ * function processResponse( response ) { ... } // Text or XML
+ * function requestFailed( httpStatusCode ) { ... }
+ *
+ * var request = new Request();
+ * request.setResponseTypeXML( 'rootElement' ); // Optional
+ * request.sendAsPost( 'value=1&value=2' ); // Optional
+ * request.setCallbackSuccess( processResponse ); // Optional
+ * request.setCallbackError( requestFailed ); // Optional
+ * request.send( 'url.action?value=1' );
+ */
+
+function Request()
+{
+ var request;
+ var responseType = 'TEXT';
+ var requestMethod = 'GET';
+ var requestParameters = null;
+ var rootElementName;
+ var callbackSuccess;
+ var callbackError;
+
+ this.setResponseTypeXML = function( rootElementName_ )
+ {
+ responseType = 'XML';
+ rootElementName = rootElementName_;
+ };
+
+ this.sendAsPost = function( requestParameters_ )
+ {
+ requestMethod = 'POST';
+ requestParameters = requestParameters_;
+ };
+
+ this.setCallbackSuccess = function( callbackSuccess_ )
+ {
+ callbackSuccess = callbackSuccess_;
+ };
+
+ this.setCallbackError = function( callbackError_ )
+ {
+ callbackError = callbackError_;
+ };
+
+ this.send = function( url )
+ {
+ request = newXMLHttpRequest();
+
+ if ( !request )
+ {
+ window.alert( "Your browser doesn't support XMLHttpRequest" );
+ return;
+ }
+
+ request.onreadystatechange = responseReceived;
+ request.open( requestMethod, url, true );
+ request.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );
+ request.send( requestParameters );
+ };
+
+ function newXMLHttpRequest()
+ {
+ if ( window.XMLHttpRequest )
+ {
+ try
+ {
+ return new XMLHttpRequest();
+ }
+ catch ( e )
+ {
+ return false;
+ }
+ }
+ else if ( window.ActiveXObject )
+ {
+ try
+ {
+ return new ActiveXObject( 'Msxml2.XMLHTTP' );
+ }
+ catch ( e )
+ {
+ try
+ {
+ return new ActiveXObject( 'Microsoft.XMLHTTP' );
+ }
+ catch ( ee )
+ {
+ return false;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ function responseReceived()
+ {
+ if ( request.readyState == 4 )
+ {
+ switch( request.status )
+ {
+ case 200:
+ if ( callbackSuccess )
+ {
+ if ( responseType == 'TEXT' )
+ {
+ callbackSuccess( request.responseText );
+ }
+ else
+ {
+ var xml = textToXML( request.responseText, rootElementName );
+
+ callbackSuccess( xml );
+ }
+ }
+ break;
+ case 204:
+ if ( callbackSuccess )
+ {
+ callbackSuccess( null );
+ }
+ break;
+ case 500:
+ var message = 'Operation failed - internal server error';
+
+ var serverMessage = request.responseText;
+
+ if ( serverMessage )
+ {
+ var maxLength = 512;
+
+ if ( serverMessage.length > maxLength )
+ {
+ serverMessage = serverMessage.substring( 0, maxLength - 3 ) + '...';
+ }
+
+ if ( serverMessage.length > 0 )
+ {
+ message += '\n\n' + serverMessage;
+ }
+ }
+
+ message += '\n\nThe error details are logged';
+
+ window.alert( message );
+
+ break;
+ default:
+ if ( callbackError )
+ {
+ callbackError( request.status );
+ }
+ }
+ }
+ }
+
+ function textToXML( text, rootElementName )
+ {
+ var docImpl = document.implementation;
+ var parser, dom;
+
+ // For standards compliant browsers
+ if ( docImpl && docImpl.createLSParser )
+ {
+ parser = docImpl.createLSParser( docImpl.MODE_SYNCHRONOUS, null );
+ var input = docImpl.createLSInput();
+ input.stringData = text;
+ return parser.parse( input ).documentElement;
+ }
+
+ // For IE
+ else if ( window.ActiveXObject )
+ {
+ dom = new ActiveXObject( 'Microsoft.XMLDOM' );
+ dom.async = "false";
+ dom.loadXML( text );
+ return dom.getElementsByTagName( rootElementName )[0];
+ }
+
+ // For Mozilla
+ else if ( window.DOMParser )
+ {
+ parser = new DOMParser();
+ dom = parser.parseFromString( text, 'application\/xml' );
+ return dom.documentElement;
+ }
+
+ // No parsing abilities
+ return null;
+ }
+}
+
+</script>
+
+</head>
+<body >
+ <div align="right">
+ <a id="exportExcelAnchor1" name="exportExcelAnchor1" href="#" onclick="javascript:exportToExcelFunction1('no')" target="_blank">Export To Excel</a>
+
+ </div>
+ <br>
+ <form id="form1" name="form1" action="exportDataStatusToExcel.action" method="post" onsubmit="return exportDataStatusResultToWorkBook()" target="_newtab">
+ <input type="hidden" name="htmlCode" id="htmlCode" />
+ <div align="right" class="NormalB">
+ <!--<input type="submit" name="ExportToWorkBook" value="Export To WorkBook" style="width: 160; height: 25; font-family:Arial; font-weight:bold; color:#000000">-->
+ </div>
+ <div id="formResult">
+
+ <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: solid" bordercolor="black" width="100%">
+ <tr>
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" >Indicator Name</td>
+ #foreach( $survey in $surveyChartResult.series2 )
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" align="center" style="border-style: dotted; border-width: 1" >$survey</td>
+ #end
+
+
+ #foreach($xaxisvalue in $surveyChartResult.categories )
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" align="center" style="border-style: dotted; border-width: 1" >$xaxisvalue</td>
+ #end
+ </tr>
+ #set($count1 = 0)
+ #set( $surveyDataValueResult = $surveyChartResult.data2 )
+ #foreach($onedataList in $surveyChartResult.data )
+ <tr>
+ <td class="TableHeadingCellStyles" style="border-style: dotted; border-width: 1" rowspan="3" >$yseriesList.get($count1)</td>
+ #foreach( $surveyDV in $surveyDataValueList )
+ <td class="TableHeadingCellStyles" align="center" style="border-style: dotted; border-width: 1" rowspan="3" >$!surveyDV.value</td>
+ #end
+ </tr><tr>
+ <td class="TableHeadingCellStyles" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Num</strong></td>
+ <td class="TableHeadingCellStyles" align="center" bgcolor="#C0C0C0" style="border-style: dotted; border-width: 1" ><strong>Den</strong></td>
+
+
+
+ #set($count2 = 0)
+ #foreach($data in $onedataList)
+ <td class="TableDataCellStyles" align="center" style="border-style: dotted; border-width: 1">$data</td>
+ #set($count2 = $count2 + 1)
+ #end
+ #set($count1 = $count1 + 1)
+ </tr>
+ #end
+ </table>
+ <div align="center">
+ <iframe name="iframeForChart" id="iframeForChart" src="generateChart.action?currentChart=SurveyChart" width="850px" height="550px" scrolling=auto frameborder="0"></iframe>
+ </div>
+ <br>
+
+</div>
+ <textarea id="testId" rows="10" cols="70" style="display:none"> </textarea>
+ </form>
+
+ </body>
+ </html>
\ No newline at end of file