← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2429: Applied the generic results to data completeness report. Removed classes which now are obsolete.

 

------------------------------------------------------------
revno: 2429
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2010-12-27 00:25:10 +0100
message:
  Applied the generic results to data completeness report. Removed classes which now are obsolete.
removed:
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessPDFAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessWorkbookAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseBlankReportTableData.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseReportTableData.vm
modified:
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/PdfService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/impl/ItextPdfService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/WorkbookService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/impl/JExcelWorkbookService.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/result/GridPdfResult.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/inputReportParamsForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataCompleteness.js
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/orgUnitDistribution.js
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewOrgUnitDistribution.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/PdfService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/PdfService.java	2010-12-26 16:55:25 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/PdfService.java	2010-12-26 23:25:10 +0000
@@ -28,14 +28,10 @@
  */
 
 import java.io.OutputStream;
-import java.util.Collection;
 import java.util.List;
 
-import org.hisp.dhis.completeness.DataSetCompletenessResult;
-import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.validation.ValidationResult;
 
 /**
@@ -46,8 +42,5 @@
 {
     String ID = PdfService.class.getName();
 
-    void writeDataSetCompletenessResult( Collection<DataSetCompletenessResult> results, OutputStream out, I18n i18n,
-        OrganisationUnit unit, DataSet dataSet );
-
     void writeValidationResult( List<ValidationResult> results, OutputStream out, I18n i18n, I18nFormat format );
 }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/impl/ItextPdfService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/impl/ItextPdfService.java	2010-12-26 21:40:52 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/impl/ItextPdfService.java	2010-12-26 23:25:10 +0000
@@ -38,11 +38,8 @@
 import static org.hisp.dhis.system.util.PDFUtils.openDocument;
 
 import java.io.OutputStream;
-import java.util.Collection;
 import java.util.List;
 
-import org.hisp.dhis.completeness.DataSetCompletenessResult;
-import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -69,54 +66,6 @@
     // PdfService implementation
     // -------------------------------------------------------------------------
 
-    public void writeDataSetCompletenessResult( Collection<DataSetCompletenessResult> results, OutputStream out,
-        I18n i18n, OrganisationUnit unit, DataSet dataSet )
-    {
-        Document document = openDocument( out );
-
-        PdfPTable table = getPdfPTable( true, 0.501f, 0.10f, 0.10f, 0.10f, 0.10f, 0.10f );
-
-        table.setHeaderRows( 1 );
-
-        String dataSetName = dataSet != null ? " - " + dataSet.getName() : "";
-
-        table.addCell( getTitleCell( i18n.getString( "data_completeness_report" ) + " - " + unit.getName()
-            + dataSetName, 6 ) );
-
-        table.addCell( getEmptyCell( 6, 10 ) );
-
-        table.addCell( getSubtitleCell( i18n.getString( "district_health_information_software" ) + " - "
-            + DateUtils.getMediumDateString(), 6 ) );
-
-        table.addCell( getEmptyCell( 6, 25 ) );
-
-        table.addCell( getItalicCell( i18n.getString( "name" ) ) );
-        table.addCell( getItalicCell( i18n.getString( "actual" ) ) );
-        table.addCell( getItalicCell( i18n.getString( "target" ) ) );
-        table.addCell( getItalicCell( i18n.getString( "percent" ) ) );
-        table.addCell( getItalicCell( i18n.getString( "on_time" ) ) );
-        table.addCell( getItalicCell( i18n.getString( "percent" ) ) );
-
-        table.addCell( getEmptyCell( 6, 8 ) );
-
-        if ( results != null )
-        {
-            for ( DataSetCompletenessResult result : results )
-            {
-                table.addCell( getTextCell( result.getName() ) );
-                table.addCell( getTextCell( String.valueOf( result.getRegistrations() ) ) );
-                table.addCell( getTextCell( String.valueOf( result.getSources() ) ) );
-                table.addCell( getTextCell( String.valueOf( result.getPercentage() ) ) );
-                table.addCell( getTextCell( String.valueOf( result.getRegistrationsOnTime() ) ) );
-                table.addCell( getTextCell( String.valueOf( result.getPercentageOnTime() ) ) );
-            }
-        }
-
-        addTableToDocument( document, table );
-
-        closeDocument( document );
-    }
-
     public void writeValidationResult( List<ValidationResult> results, OutputStream out, I18n i18n, I18nFormat format )
     {
         Document document = openDocument( out );

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/WorkbookService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/WorkbookService.java	2010-12-26 15:38:45 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/WorkbookService.java	2010-12-26 23:25:10 +0000
@@ -28,14 +28,10 @@
  */
 
 import java.io.OutputStream;
-import java.util.Collection;
 import java.util.List;
 
-import org.hisp.dhis.completeness.DataSetCompletenessResult;
-import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.validation.ValidationResult;
 
 /**
@@ -46,7 +42,5 @@
 {
     String ID = WorkbookService.class.getName();
     
-    void writeDataSetCompletenessResult( Collection<DataSetCompletenessResult> results, OutputStream out, I18n i18n, OrganisationUnit unit, DataSet dataSet );
-    
     void writeValidationResult( List<ValidationResult> results, OutputStream out, I18n i18n, I18nFormat format );
 }

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/impl/JExcelWorkbookService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/impl/JExcelWorkbookService.java	2010-12-26 15:38:45 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/workbook/impl/JExcelWorkbookService.java	2010-12-26 23:25:10 +0000
@@ -29,7 +29,6 @@
 
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.Collection;
 import java.util.List;
 
 import jxl.Workbook;
@@ -42,8 +41,6 @@
 import jxl.write.WriteException;
 import jxl.write.biff.RowsExceededException;
 
-import org.hisp.dhis.completeness.DataSetCompletenessResult;
-import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -65,78 +62,6 @@
     // WorkbookService implementation
     // -------------------------------------------------------------------------
 
-    public void writeDataSetCompletenessResult( Collection<DataSetCompletenessResult> results, OutputStream out,
-        I18n i18n, OrganisationUnit unit, DataSet dataSet )
-    {
-        final int MARGIN_LEFT = 1;
-
-        WritableCellFormat documentTitle = new WritableCellFormat( new WritableFont( WritableFont.TAHOMA, 15,
-            WritableFont.NO_BOLD, false ) );
-        WritableCellFormat subTitle = new WritableCellFormat( new WritableFont( WritableFont.TAHOMA, 13,
-            WritableFont.NO_BOLD, false ) );
-        WritableCellFormat columnHeader = new WritableCellFormat( new WritableFont( WritableFont.TAHOMA, 11,
-            WritableFont.NO_BOLD, true ) );
-        WritableCellFormat text = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 11,
-            WritableFont.NO_BOLD, false ) );
-
-        try
-        {
-            WritableWorkbook workbook = Workbook.createWorkbook( out );
-
-            WritableSheet sheet = workbook.createSheet( "Data completeness", 0 );
-
-            String dataSetName = dataSet != null ? " - " + dataSet.getName() : "";
-
-            sheet.addCell( new Label( MARGIN_LEFT, 1, i18n.getString( "data_completeness_report" ) + " - "
-                + unit.getName() + dataSetName, documentTitle ) );
-
-            sheet.addCell( new Label( MARGIN_LEFT, 3, i18n.getString( "district_health_information_software" ) + " - "
-                + DateUtils.getMediumDateString(), subTitle ) );
-
-            int row = 5;
-
-            sheet.addCell( new Label( MARGIN_LEFT, row, i18n.getString( "name" ), columnHeader ) );
-            sheet.addCell( new Label( MARGIN_LEFT + 1, row, i18n.getString( "actual" ), columnHeader ) );
-            sheet.addCell( new Label( MARGIN_LEFT + 2, row, i18n.getString( "target" ), columnHeader ) );
-            sheet.addCell( new Label( MARGIN_LEFT + 3, row, i18n.getString( "percent" ), columnHeader ) );
-            sheet.addCell( new Label( MARGIN_LEFT + 4, row, i18n.getString( "on_time" ), columnHeader ) );
-            sheet.addCell( new Label( MARGIN_LEFT + 5, row, i18n.getString( "percent" ), columnHeader ) );
-
-            row = 7;
-
-            if ( results != null )
-            {
-                for ( DataSetCompletenessResult result : results )
-                {
-                    sheet.addCell( new Label( MARGIN_LEFT, row, result.getName(), text ) );
-                    sheet.addCell( new Number( MARGIN_LEFT + 1, row, result.getRegistrations(), text ) );
-                    sheet.addCell( new Number( MARGIN_LEFT + 2, row, result.getSources(), text ) );
-                    sheet.addCell( new Number( MARGIN_LEFT + 3, row, result.getPercentage(), text ) );
-                    sheet.addCell( new Number( MARGIN_LEFT + 4, row, result.getRegistrationsOnTime(), text ) );
-                    sheet.addCell( new Number( MARGIN_LEFT + 5, row, result.getPercentageOnTime(), text ) );
-
-                    row++;
-                }
-            }
-
-            workbook.write();
-
-            workbook.close();
-        }
-        catch ( IOException ex )
-        {
-            throw new RuntimeException( "Failed to create workbook", ex );
-        }
-        catch ( RowsExceededException ex )
-        {
-            throw new RuntimeException( "Rows exceeded", ex );
-        }
-        catch ( WriteException ex )
-        {
-            throw new RuntimeException( "Write failed", ex );
-        }
-    }
-
     public void writeValidationResult( List<ValidationResult> results, OutputStream out, I18n i18n, I18nFormat format )
     {
         final int MARGIN_LEFT = 1;

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/result/GridPdfResult.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/result/GridPdfResult.java	2010-12-26 21:40:52 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/result/GridPdfResult.java	2010-12-26 23:25:10 +0000
@@ -103,14 +103,16 @@
         table.setHeaderRows( 1 );
 
         table.addCell( getTitleCell( grid.getTitle(), grid.getWidth() ) );
-        table.addCell( getEmptyCell( grid.getWidth(), 20 ) );
+        table.addCell( getEmptyCell( grid.getWidth(), 30 ) );
+        table.addCell( getSubtitleCell( grid.getSubtitle(), grid.getWidth() ) );
+        table.addCell( getEmptyCell( grid.getWidth(), 30 ) );
         
         for ( String header : grid.getHeaders() )
         {
             table.addCell( getItalicCell( header ) );
         }
 
-        table.addCell( getEmptyCell( grid.getWidth(), 8 ) );
+        table.addCell( getEmptyCell( grid.getWidth(), 10 ) );
         
         for ( List<String> row : grid.getRows() )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessAction.java	2010-10-15 08:07:52 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessAction.java	2010-12-26 23:25:10 +0000
@@ -31,15 +31,18 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.common.ServiceProvider;
 import org.hisp.dhis.completeness.DataSetCompletenessResult;
 import org.hisp.dhis.completeness.DataSetCompletenessService;
 import org.hisp.dhis.completeness.comparator.DataSetCompletenessResultComparator;
 import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.oust.manager.SelectionTreeManager;
 import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.system.grid.ListGrid;
 import org.hisp.dhis.util.SessionUtils;
 
 import com.opensymphony.xwork2.Action;
@@ -52,8 +55,9 @@
     implements Action
 {
     private static final String KEY_DATA_COMPLETENESS = "dataSetCompletenessResults";
-
-    private static final String KEY_DATA_COMPLETENESS_DATASET = "dataSetCompletenessDataSet";
+    private static final String DEFAULT_TYPE = "html";    
+    private static final String SPACE = " ";
+    private static final String EMPTY = "";
 
     // -------------------------------------------------------------------------
     // Dependencies
@@ -86,6 +90,13 @@
     {
         this.selectionTreeManager = selectionTreeManager;
     }
+    
+    private I18n i18n;
+
+    public void setI18n( I18n i18n )
+    {
+        this.i18n = i18n;
+    }
 
     // -------------------------------------------------------------------------
     // Input
@@ -112,15 +123,22 @@
         this.criteria = criteria;
     }
 
+    private String type;
+
+    public void setType( String type )
+    {
+        this.type = type;
+    }
+
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
 
-    private List<DataSetCompletenessResult> results;
+    private Grid grid;
 
-    public List<DataSetCompletenessResult> getResults()
+    public Grid getGrid()
     {
-        return results;
+        return grid;
     }
 
     // -------------------------------------------------------------------------
@@ -130,44 +148,75 @@
     public String execute()
         throws Exception
     {
-        SessionUtils.removeSessionVar( KEY_DATA_COMPLETENESS );
-        SessionUtils.removeSessionVar( KEY_DATA_COMPLETENESS_DATASET );
-
-        Integer _periodId = periodService.getPeriodByExternalId( periodId ).getId();
-        OrganisationUnit selectedUnit = selectionTreeManager.getSelectedOrganisationUnit();
-
-        if ( periodId != null && selectedUnit != null && criteria != null )
-        {
-            DataSetCompletenessService completenessService = serviceProvider.provide( criteria );
-
-            if ( dataSetId != null )
-            {
-                // -------------------------------------------------------------
-                // Display completeness by DataSets
-                // -------------------------------------------------------------
-
-                results = new ArrayList<DataSetCompletenessResult>( completenessService.getDataSetCompleteness(
-                    _periodId, selectedUnit.getId(), dataSetId ) );
-
-                DataSet dataSet = dataSetService.getDataSet( dataSetId );
-
-                SessionUtils.setSessionVar( KEY_DATA_COMPLETENESS_DATASET, dataSet );
-            }
-            else
-            {
-                // -------------------------------------------------------------
-                // Display completeness by child OrganisationUnits for a DataSet
-                // -------------------------------------------------------------
-
-                results = new ArrayList<DataSetCompletenessResult>( completenessService.getDataSetCompleteness(
-                    _periodId, selectedUnit.getId() ) );
-            }
-
-            Collections.sort( results, new DataSetCompletenessResultComparator() );
-
-            SessionUtils.setSessionVar( KEY_DATA_COMPLETENESS, results );
-        }
-
-        return SUCCESS;
+        Grid _grid = (Grid) SessionUtils.getSessionVar( KEY_DATA_COMPLETENESS );
+        
+        if ( _grid != null && type != null && !type.equals( DEFAULT_TYPE ) ) // Use last grid for any format except html
+        {
+            grid = _grid;
+            
+            return type;
+        }
+        else
+        {    
+            Integer _periodId = periodService.getPeriodByExternalId( periodId ).getId();
+            OrganisationUnit selectedUnit = selectionTreeManager.getSelectedOrganisationUnit();
+            
+            if ( periodId != null && selectedUnit != null && criteria != null )
+            {
+                DataSet dataSet = null;
+                List<DataSetCompletenessResult> results = null;
+    
+                DataSetCompletenessService completenessService = serviceProvider.provide( criteria );
+    
+                if ( dataSetId != null && dataSetId != 0 ) // One data set for one organisation unit
+                {
+                    results = new ArrayList<DataSetCompletenessResult>( completenessService.getDataSetCompleteness(
+                        _periodId, selectedUnit.getId(), dataSetId ) );
+    
+                    dataSet = dataSetService.getDataSet( dataSetId );
+                }
+                else // All data sets for children of one organisation unit
+                {
+                    results = new ArrayList<DataSetCompletenessResult>( completenessService.getDataSetCompleteness(
+                        _periodId, selectedUnit.getId() ) );
+                }
+    
+                Collections.sort( results, new DataSetCompletenessResultComparator() );
+                
+                grid = getGrid( results, selectedUnit, dataSet );
+                
+                SessionUtils.setSessionVar( KEY_DATA_COMPLETENESS, grid );                      
+            }
+            
+            return type != null ? type : DEFAULT_TYPE;
+        }        
+    }
+    
+    private Grid getGrid( List<DataSetCompletenessResult> results, OrganisationUnit unit, DataSet dataSet )
+    {
+        String title = i18n.getString( "data_completeness_report" );
+        String subtitle = ( unit != null ? unit.getName() : EMPTY ) + SPACE + ( dataSet != null ? dataSet.getName() : EMPTY );
+        
+        Grid grid = new ListGrid().setTitle( title ).setSubtitle( subtitle );
+        
+        grid.addHeader( i18n.getString( "name" ) );
+        grid.addHeader( i18n.getString( "actual" ) );
+        grid.addHeader( i18n.getString( "target" ) );
+        grid.addHeader( i18n.getString( "percent" ) );
+        grid.addHeader( i18n.getString( "on_time" ) );
+        grid.addHeader( i18n.getString( "percent" ) );
+        
+        for ( DataSetCompletenessResult result : results )
+        {
+            grid.nextRow();
+            grid.addValue( result.getName() );
+            grid.addValue( String.valueOf( result.getRegistrations() ) );
+            grid.addValue( String.valueOf( result.getSources() ) );
+            grid.addValue( String.valueOf( result.getPercentage() ) );
+            grid.addValue( String.valueOf( result.getRegistrationsOnTime() ) );
+            grid.addValue( String.valueOf( result.getPercentageOnTime() ) );
+        }
+        
+        return grid;
     }
 }

=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessPDFAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessPDFAction.java	2010-10-15 08:07:52 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessPDFAction.java	1970-01-01 00:00:00 +0000
@@ -1,126 +0,0 @@
-package org.hisp.dhis.reporting.completeness.action;
-
-/*
- * 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.
- */
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.util.Collection;
-
-import org.hisp.dhis.completeness.DataSetCompletenessResult;
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.oust.manager.SelectionTreeManager;
-import org.hisp.dhis.pdf.PdfService;
-import org.hisp.dhis.util.SessionUtils;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class GetDataCompletenessPDFAction
-    implements Action
-{
-    private static final String KEY_DATA_COMPLETENESS = "dataSetCompletenessResults";
-
-    private static final String KEY_DATA_COMPLETENESS_DATASET = "dataSetCompletenessDataSet";
-
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private PdfService pdfService;
-
-    public void setPdfService( PdfService pdfService )
-    {
-        this.pdfService = pdfService;
-    }
-
-    private SelectionTreeManager selectionTreeManager;
-
-    public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager )
-    {
-        this.selectionTreeManager = selectionTreeManager;
-    }
-
-    // -------------------------------------------------------------------------
-    // I18n
-    // -------------------------------------------------------------------------
-
-    private I18n i18n;
-
-    public void setI18n( I18n i18n )
-    {
-        this.i18n = i18n;
-    }
-
-    // -------------------------------------------------------------------------
-    // Output
-    // -------------------------------------------------------------------------
-
-    private OrganisationUnit selectedUnit;
-
-    private InputStream inputStream;
-
-    public InputStream getInputStream()
-    {
-        return inputStream;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    @SuppressWarnings( "unchecked" )
-    public String execute()
-        throws Exception
-    {
-        Collection<DataSetCompletenessResult> results = (Collection<DataSetCompletenessResult>) SessionUtils
-            .getSessionVar( KEY_DATA_COMPLETENESS );
-
-        DataSet dataSet = (DataSet) SessionUtils.getSessionVar( KEY_DATA_COMPLETENESS_DATASET );
-
-        selectedUnit = selectionTreeManager.getSelectedOrganisationUnit();
-
-        if ( selectedUnit == null )
-        {
-            return ERROR;
-        }
-
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-
-        pdfService.writeDataSetCompletenessResult( results, out, i18n, selectedUnit, dataSet );
-
-        inputStream = new ByteArrayInputStream( out.toByteArray() );
-
-        return SUCCESS;
-    }
-}

=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessWorkbookAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessWorkbookAction.java	2010-10-15 09:47:16 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/completeness/action/GetDataCompletenessWorkbookAction.java	1970-01-01 00:00:00 +0000
@@ -1,119 +0,0 @@
-package org.hisp.dhis.reporting.completeness.action;
-
-/*
- * 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.
- */
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.util.Collection;
-
-import org.hisp.dhis.completeness.DataSetCompletenessResult;
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.oust.manager.SelectionTreeManager;
-import org.hisp.dhis.util.SessionUtils;
-import org.hisp.dhis.workbook.WorkbookService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class GetDataCompletenessWorkbookAction
-    implements Action
-{
-    private static final String KEY_DATA_COMPLETENESS = "dataSetCompletenessResults";
-    private static final String KEY_DATA_COMPLETENESS_DATASET = "dataSetCompletenessDataSet";
-    
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private WorkbookService workbookService;
-
-    public void setWorkbookService( WorkbookService workbookService )
-    {
-        this.workbookService = workbookService;
-    }
-    
-    private SelectionTreeManager selectionTreeManager;
-
-    public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager )
-    {
-        this.selectionTreeManager = selectionTreeManager;
-    }
-    
-    private I18n i18n;
-
-    public void setI18n( I18n i18n )
-    {
-        this.i18n = i18n;
-    }
-
-    // -------------------------------------------------------------------------
-    // Output
-    // -------------------------------------------------------------------------
-
-    private InputStream inputStream;
-
-    public InputStream getInputStream()
-    {
-        return inputStream;
-    }
-    
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    @SuppressWarnings( "unchecked" )
-    public String execute()
-        throws Exception
-    {
-        OrganisationUnit unit = selectionTreeManager.getSelectedOrganisationUnit();
-        
-        if ( unit == null )
-        {
-            return ERROR;
-        }
-
-        DataSet dataSet = (DataSet) SessionUtils.getSessionVar( KEY_DATA_COMPLETENESS_DATASET );
-        
-        Collection<DataSetCompletenessResult> results = 
-            (Collection<DataSetCompletenessResult>) SessionUtils.getSessionVar( KEY_DATA_COMPLETENESS );
-
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        
-        workbookService.writeDataSetCompletenessResult( results, out, i18n, unit, dataSet );
-        
-        inputStream = new ByteArrayInputStream( out.toByteArray() );
-                
-        return SUCCESS;
-    }
-}

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml	2010-12-26 18:47:16 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/META-INF/dhis/beans.xml	2010-12-26 23:25:10 +0000
@@ -422,25 +422,7 @@
 	<property name="selectionTreeManager"
       ref="org.hisp.dhis.oust.manager.SelectionTreeManager"/>
   </bean>
-  
-  <bean id="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessPDFAction"
-    class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessPDFAction"
-    scope="prototype">
-    <property name="selectionTreeManager"
-      ref="org.hisp.dhis.oust.manager.SelectionTreeManager"/>
-    <property name="pdfService"
-      ref="org.hisp.dhis.pdf.PdfService"/>
-  </bean>
-  
-  <bean id="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessWorkbookAction"
-    class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessWorkbookAction"
-    scope="prototype">
-    <property name="selectionTreeManager"
-      ref="org.hisp.dhis.oust.manager.SelectionTreeManager"/>
-    <property name="workbookService"
-      ref="org.hisp.dhis.workbook.WorkbookService"/>
-  </bean>
-  
+    
   <bean id="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessConfigurationAction"
     class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessConfigurationAction"
     scope="prototype">

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml	2010-12-26 18:47:16 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/struts.xml	2010-12-26 23:25:10 +0000
@@ -250,6 +250,7 @@
     <action name="exportTable" class="org.hisp.dhis.reporting.tablecreator.action.ExportTableAction">
       <result name="csv" type="gridCsvResult"/>
       <result name="xls" type="gridXlsResult"/>
+      <result name="pdf" type="gridPdfResult"/>
       <result name="html" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-commons/ajax/htmlGrid.vm</param>
       <param name="menu">/dhis-web-reporting/menu.vm</param>      
@@ -294,42 +295,12 @@
     </action>
     
     <action name="getDataCompleteness" class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessAction">
-      <result name="success" type="velocity-xml">/dhis-web-reporting/responseDataCompleteness.vm</result>
-      <param name="onExceptionReturn">plainTextError</param>
-    </action>
-    
-    <action name="getDataCompletenessPDF" class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessPDFAction">
-      <result name="success" type="stream">
-        <param name="contentType">application/pdf</param>
-        <param name="inputName">inputStream</param>
-        <param name="contentDisposition">filename="DataCompletenessReport.pdf"</param>
-        <param name="bufferSize">10240</param>        
-      </result>
-	  <result name="error" type="redirect">dataCompletenessPDFError.action</result>
-    </action>
-    
-	<action name="dataCompletenessPDFError" class="org.hisp.dhis.reporting.action.NoAction">
-		<result name="success" type="velocity">/main.vm</result>
-		<param name="page">/dhis-web-commons/oust/selectedOrgunitError.vm</param>
-		<param name="menu">/dhis-web-reporting/menu.vm</param>
-	</action>
-	
-	<action name="dataCompletenessWorkbookError" class="org.hisp.dhis.reporting.action.NoAction">
-		<result name="success" type="velocity">/main.vm</result>
-		<param name="page">/dhis-web-commons/oust/selectedOrgunitError.vm</param>
-		<param name="menu">/dhis-web-reporting/menu.vm</param>
-	</action>
-	
-    <action name="getDataCompletenessWorkbook" class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessWorkbookAction">
-      <result name="success" type="stream">
-        <param name="contentType">application/vnd.ms-excel</param>
-        <param name="inputName">inputStream</param>
-        <param name="contentDisposition">filename="DataCompletenessReport.xls"</param>
-        <param name="bufferSize">10240</param>        
-      </result>
-      <result name="error" type="redirect">dataCompletenessWorkbookError.action</result>
-    </action>
-    
+      <result name="csv" type="gridCsvResult"/>
+      <result name="xls" type="gridXlsResult"/>
+      <result name="pdf" type="gridPdfResult"/>
+      <result name="html" type="velocity">/dhis-web-commons/ajax/htmlGrid.vm</result>
+    </action> 
+        
     <action name="displayConfigureDataCompletenessForm" class="org.hisp.dhis.reporting.completeness.action.GetDataCompletenessConfigurationAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-reporting/configureDataCompletenessForm.vm</param>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/inputReportParamsForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/inputReportParamsForm.vm	2010-12-26 15:38:45 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/inputReportParamsForm.vm	2010-12-26 23:25:10 +0000
@@ -54,7 +54,7 @@
         <th>$i18n.getString( "organisation_unit" )</th>
     </tr>
     <td>
-		<div id="selectionTree" style="width:325px; height:240px"></div>	            
+		<div id="selectionTree" style="width:325px; height:200px"></div>	            
 		<script type="text/javascript">
 			selectionTreeSelection.setMultipleSelectionAllowed( false );
 			selectionTreeSelection.setListenerFunction( paramOrganisationUnitSet );
@@ -75,7 +75,8 @@
         #if ( $mode == "table" )
             <input type="button" value="$i18n.getString( 'get_report' )" onclick="generateReport( 'html' )" style="width:140px">
             <input type="button" value="$i18n.getString( 'back' )" onclick="javascript:window.location.href='displayManageTableForm.action'" style="width:140px"><br><br>
-            <input type="button" value="$i18n.getString( 'get_report_as_xls' )" onclick="generateReport( 'xls' )" style="width:140px">
+            <input type="button" value="$i18n.getString( 'get_report_as_pdf' )" onclick="generateReport( 'pdf' )" style="width:140px">
+            <input type="button" value="$i18n.getString( 'get_report_as_xls' )" onclick="generateReport( 'xls' )" style="width:140px"><br>            
             <input type="button" value="$i18n.getString( 'get_report_as_csv' )" onclick="generateReport( 'csv' )" style="width:140px">
         #end
         #if ( $mode == "report" )

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataCompleteness.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataCompleteness.js	2010-10-15 08:32:53 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataCompleteness.js	2010-12-26 23:25:10 +0000
@@ -2,13 +2,12 @@
 function getPeriods( periodTypeList, availableList, selectedList, timespan )
 {
 	getAvailablePeriods( periodTypeList, availableList, selectedList, timespan );
-	displayCompleteness();
 }
 
 function displayCompleteness()
 {
     var criteria = $( "input[name='criteria']:checked" ).val();
-    var dataSetList = byId( "dataSetId" );    
+    var dataSetList = byId( "dataSetId" ); //TODO simplify
     var dataSetId = dataSetList.options[ dataSetList.selectedIndex ].value;    
     var periodList = byId( "periodId" );
     var periodId = null;
@@ -20,151 +19,19 @@
     
     if ( periodId != null )
     {
-        clearTable( "resultTable" );
         showLoader();
         
-        var request = new Request();   
-        var url = "getDataCompleteness.action" 
-				+ "?periodId=" + periodId 
-				+ "&criteria=" + criteria;
-        
-        request.setResponseTypeXML( "dataSetCompletenessResult" );
-                    
-        if ( dataSetId == "ALL" )
-        {            
-            // -----------------------------------------------------------------
-            // Display completeness by DataSets
-            // -----------------------------------------------------------------
-            
-            request.setCallbackSuccess( displayCompletenessByDataSetReceived );
-        }
-        else
-        {
-            // -----------------------------------------------------------------
-            // Display completeness by child OrganisationUnits for a DataSet
-            // -----------------------------------------------------------------
-            
-            url += "&dataSetId=" + dataSetId;
-            
-            request.setCallbackSuccess( displayCompletenessByOrganisationUnitReceived );
-        }
-        request.send( url );
-    }
-}
-
-function clearTable( tableId )
-{
-    var table = byId( tableId );
-    
-    while ( table.rows.length >  0 )
-    {
-        table.deleteRow( 0 );
-    }
-}
-
-function displayCompletenessByDataSetReceived( xmlObject )
-{
-    var headerText = i18n_dataset;
-    
-    displayCompletenessTable( xmlObject, headerText );
-}
-
-function displayCompletenessByOrganisationUnitReceived( xmlObject )
-{
-    var headerText = i18n_organisation_unit;
-    
-    displayCompletenessTable( xmlObject, headerText );
-}
-
-function displayCompletenessTable( xmlObject, headerText )
-{
-    hideLoader();
-    
-    var table = byId( "resultTable" );
-    
-    // -------------------------------------------------------------------------
-    // Adding header
-    // -------------------------------------------------------------------------
-    
-    var headerRow = table.insertRow( 0 );
-    var columnWidth = "55px";
-    
-    var headerA = document.createElement( "th" );
-    headerA.innerHTML = headerText;
-    headerRow.appendChild( headerA );
-    
-    var headerB = document.createElement( "th" );
-    headerB.innerHTML = i18n_actual;
-    headerB.width = columnWidth;
-    headerRow.appendChild( headerB );
-    
-    var headerC = document.createElement( "th" );
-    headerC.innerHTML = i18n_target;
-    headerC.width = columnWidth;
-    headerRow.appendChild( headerC );
-    
-    var headerD = document.createElement( "th" );
-    headerD.innerHTML = i18n_percent;
-    headerD.width = columnWidth;
-    headerRow.appendChild( headerD );
-    
-    var headerE = document.createElement( "th" );
-    headerE.innerHTML = i18n_on_time;
-    headerE.width = columnWidth;
-    headerRow.appendChild( headerE );
-    
-    var headerF = document.createElement( "th" );
-    headerF.innerHTML = i18n_percent;
-    headerF.width = columnWidth;
-    headerRow.appendChild( headerF );    
-    
-    // -------------------------------------------------------------------------
-    // Adding rows
-    // -------------------------------------------------------------------------
-    
-    var results = xmlObject.getElementsByTagName( "dataSetCompletenessResult" );
-    var mark = false;
-    var rowIndex = 1;
-    var className = "";
-    
-    for ( var i = 0; i < results.length; i++ )
-    {
-		className = mark ? "listAlternateRow" : "listRow" ;
-	
-        var resultName = results[i].getElementsByTagName( "name" )[0].firstChild.nodeValue;
-        var sources = results[i].getElementsByTagName( "sources" )[0].firstChild.nodeValue;
-        var registrations = results[i].getElementsByTagName( "registrations" )[0].firstChild.nodeValue;
-        var percentage = results[i].getElementsByTagName( "percentage" )[0].firstChild.nodeValue;
-        var registrationsOnTime = results[i].getElementsByTagName( "registrationsOnTime" )[0].firstChild.nodeValue;
-        var percentageOnTime = results[i].getElementsByTagName( "percentageOnTime" )[0].firstChild.nodeValue;
-        
-        var row = table.insertRow( rowIndex++ );
-        
-        var cellA = row.insertCell( 0 );
-        cellA.style.height = "32px";
-        cellA.innerHTML = resultName;
-        cellA.className = className
-        
-        var cellB = row.insertCell( 1 );
-        cellB.innerHTML = registrations;
-        cellB.className = className
-        
-        var cellC = row.insertCell( 2 );
-        cellC.innerHTML = sources;
-        cellC.className = className
-        
-        var cellD = row.insertCell( 3 );
-        cellD.innerHTML = percentage;
-        cellD.className = className
-        
-        var cellE = row.insertCell( 4 );
-        cellE.innerHTML = registrationsOnTime;
-        cellE.className = className
-                
-        var cellF = row.insertCell( 5 );
-        cellF.innerHTML = percentageOnTime;
-        cellF.className = className
-        
-        mark = !mark;
-	}
-}
+        var url = "getDataCompleteness.action" + "?periodId=" + periodId + "&criteria=" + criteria + 
+        	"&dataSetId=" + dataSetId + "&type=html";
+        
+        $( "#contentDiv" ).load( url, function() {
+        	hideLoader();
+        	pageInit();
+        } );
+    }
+}
+
+function getCompleteness( type )
+{
+	window.location.href = "getDataCompleteness.action?type=" + type;
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/orgUnitDistribution.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/orgUnitDistribution.js	2010-12-26 18:47:16 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/orgUnitDistribution.js	2010-12-26 23:25:10 +0000
@@ -11,7 +11,6 @@
 }
 
 function displayOrgUnitDistribution() {
-	alert(selectedOrganisationUnit);
 	if ( inputInvalid() ) {
 		return false;
 	}

=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseBlankReportTableData.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseBlankReportTableData.vm	2009-05-20 08:31:50 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseBlankReportTableData.vm	1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
-<html>
-  <head>
-    <title>DHIS 2</title>
-    <link type="text/css" rel="stylesheet" media="screen" href="../dhis-web-commons/css/blue/blue.css">
-    <link type="text/css" rel="stylesheet" media="screen" href="../dhis-web-commons/css/widgets.css">
-  </head>
-  
-  <body>
-  	<div class="page" style="margin: 20px">  	
-  	  #parse( "dhis-web-reporting/responseReportTableData.vm" )
-  	</div>
-  </body>
-</html>

=== removed file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseReportTableData.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseReportTableData.vm	2010-12-15 17:52:50 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/responseReportTableData.vm	1970-01-01 00:00:00 +0000
@@ -1,30 +0,0 @@
-
-#macro( alternate $mark )
-    #if( $mark ) class="listAlternateRow"#else class="listRow"#end
-#end
-
-<p><input type="button" value="$i18n.getString( 'back' )" onclick="javascript:window.location.href='displayManageTableForm.action'" style="width:120px"></p>
-
-<table class="listTable">
-    <tr>
-        <td style="text-align:center" colspan="$data.columns.values().size()"><h3>$data.name</h3></td>
-    </tr>
-    <tr>
-    #foreach( $column in $data.prettyPrintColumns )
-        <td class="reportTableHeader" style="min-width:100px">$column</td>
-    #end
-    </tr>
-    #set( $mark = false )
-    #foreach( $row in $data.rows )
-        <tr>
-        #foreach( $value in $row.values() )
-            <td#alternate( $mark )>$value</td>
-        #end
-        </tr>
-        #if( $mark )
-            #set( $mark = false )
-        #else
-            #set( $mark = true )
-        #end
-    #end
-</table>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm	2010-12-14 05:45:00 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm	2010-12-26 23:25:10 +0000
@@ -1,32 +1,23 @@
-<script type="text/javascript">
-	jQuery(document).ready( function(){
-		selectionTreeSelection.setListenerFunction( displayCompleteness );
-		jQuery("#selectionTree").resizable();
-	});
-</script>
 
 <h3>$i18n.getString( "data_completeness_report" )</h3>
 
 <table>
     <col width="330"/>
     <col width="5"/>
-    <col width="330"/>    
-    <tr>
-	    <td><div id="selectionTree" style="width:325px; height:220px"></div>				
-			<script type="text/javascript">
-				selectionTreeSelection.setMultipleSelectionAllowed( false );
-				selectionTree.clearSelectedOrganisationUnits();
-				selectionTree.buildSelectionTree();
-			</script>
-        </td>
+    <col width="330"/>
+    <tr>
+    	<th>$i18n.getString( "select_org_unit" )</th>
+    	<td></td>
+    	<td></td>
+    </tr>
+    <tr>
+	    <td><div id="selectionTree" style="width:325px; height:240px"></div></td>
         <td></td>
         <td valign="bottom">
-        	<input type="button" value="$i18n.getString( 'configuration' )" style="width:150px"
-        	   onclick="window.location.href='displayConfigureDataCompletenessForm.action'"/><br/>
-        	<input type="button" value="$i18n.getString( 'generate_pdf' )" style="width:150px"
-                onclick="window.location.href='getDataCompletenessPDF.action'"/><input 
-                type="button" value="$i18n.getString( 'generate_workbook' )" style="width:150px"
-                onclick="window.location.href='getDataCompletenessWorkbook.action'"/><br/><br/>
+        	<input type="button" value="$i18n.getString( 'get_report_as_pdf' )" style="width:140px" onclick="getCompleteness( 'pdf' )"/>
+            <input type="button" value="$i18n.getString( 'get_report_as_xls' )" style="width:140px" onclick="getCompleteness( 'xls' )"/><br>
+        	<input type="button" value="$i18n.getString( 'get_report_as_csv' )" style="width:140px" onclick="getCompleteness( 'csv' )"/>
+            <input type="button" value="$i18n.getString( 'configuration' )" style="width:140px" onclick="window.location.href='displayConfigureDataCompletenessForm.action'"/><br><br>        	
                 	
             <input type="radio" name="criteria" id="registrationRadio" value="registration" checked="checked" onclick="displayCompleteness()"/>
             <label for="registrationRadio">$i18n.getString( 'based_on_registration' )</label><br/>
@@ -38,11 +29,11 @@
             <!-- DataSet -->
             
         	<select id="dataSetId" name="dataSetId" style="width:325px" onchange="displayCompleteness()">
-			<option value="ALL">[ $i18n.getString( "select_dataset_all" ) ]</option>
+			<option value="0">[ $i18n.getString( "select_dataset_all" ) ]</option>
 			#foreach( $dataSet in $dataSets )
 				<option value="$dataSet.id">$dataSet.name</option>
 			#end
-			</select><br/><br/>
+			</select><br><br>
             
             <!-- PeriodType -->
             
@@ -53,7 +44,7 @@
 				#foreach ( $type in $periodTypes )
 					<option value="$type.name">$type.name</option>
 				#end
-			</select><br/><br/>
+			</select><br><br>
 			
 			<!-- Period -->
 			
@@ -68,11 +59,7 @@
 
 #parse( "dhis-web-commons/loader/loader.vm" )
 
-<div id="contentDiv">
-
-<table id="resultTable" name="resultTable" style="width:95%" class="listTable"></table>
-
-</div>
+<div id="contentDiv"></div>
 
 <script type="text/javascript">
 	var i18n_processing = '$encoder.jsEscape( $i18n.getString( "processing" ) , "'")';
@@ -83,3 +70,10 @@
     var i18n_percent = '$encoder.jsEscape( $i18n.getString( "percent" ) , "'")';
     var i18n_on_time = '$encoder.jsEscape( $i18n.getString( "on_time" ) , "'")';
 </script>
+
+<script type="text/javascript">
+	selectionTreeSelection.setListenerFunction( displayCompleteness );
+	selectionTreeSelection.setMultipleSelectionAllowed( false );
+	selectionTree.clearSelectedOrganisationUnits();
+	selectionTree.buildSelectionTree();
+</script>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewOrgUnitDistribution.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewOrgUnitDistribution.vm	2010-12-26 18:47:16 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewOrgUnitDistribution.vm	2010-12-26 23:25:10 +0000
@@ -25,9 +25,10 @@
 <input type="button" value="$i18n.getString( 'get_report' )" style="width:140px" onclick="displayOrgUnitDistribution( 'html' )">
 <input type="button" value="$i18n.getString( 'get_chart' )" style="width:140px" onclick="displayOrgUnitDistributionChart()"><br><br>
 
-<input type="button" value="$i18n.getString( 'get_report_as_xls' )" style="width:140px" onclick="getOrgUnitDistribution( 'xls' )">
-<input type="button" value="$i18n.getString( 'get_report_as_csv' )" style="width:140px" onclick="getOrgUnitDistribution( 'csv' )"><br>
 <input type="button" value="$i18n.getString( 'get_report_as_pdf' )" style="width:140px" onclick="getOrgUnitDistribution( 'pdf' )">
+<input type="button" value="$i18n.getString( 'get_report_as_xls' )" style="width:140px" onclick="getOrgUnitDistribution( 'xls' )"><br>
+<input type="button" value="$i18n.getString( 'get_report_as_csv' )" style="width:140px" onclick="getOrgUnitDistribution( 'csv' )">
+
 </td>
 </tr>