← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2944: Merging changes from 2.0.6

 

------------------------------------------------------------
revno: 2944
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-03-01 14:07:19 +0530
message:
  Merging changes from 2.0.6
added:
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/nbits/
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/nbits/action/
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/nbits/action/NBITSReportFormAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/nbits/action/NBITSReportResultAction.java
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/nbitsReportsForm.vm
modified:
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/GetPeriodsAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/periodwiseprogress/action/GeneratePeriodWiseProgressAnalyserResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/portal/action/PortalReportsResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/routine/action/GenerateRoutineReportAnalyserResultAction.java
  local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-reports-national/src/main/resources/struts.xml
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/activePlanReportsForm.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menu.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForActivePlan.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForAdvanced.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForAggregationReport.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForAutoReport.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForBenificiaryInfo.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForCSReviewReport.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForDataSetLockReports.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForDatasetReport.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForFeedback.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForGOIReports.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForLineListingReport.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForMalaryaReports.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForMobileReport.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForNLEPReports.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForOuWiseProgress.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForPeriodWiseProgressReport.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForPortalReport.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForRankingReport.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForRoutineReport.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForTwentyPoint.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithmetaDataReports.vm
  local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithphysicaOutputReports.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-reports-national/src/main/java/org/hisp/dhis/reports/action/GetPeriodsAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/GetPeriodsAction.java	2010-11-01 11:14:31 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/action/GetPeriodsAction.java	2011-03-01 08:37:19 +0000
@@ -157,8 +157,9 @@
                 int year;
                 for ( Period p1 : periods )
                 {
-                    year = Integer.parseInt( simpleDateFormat1.format( p1.getStartDate() ) ) + 1;
-                    periodNameList.add( simpleDateFormat1.format( p1.getStartDate() ) + "-" + year );
+                    //year = Integer.parseInt( simpleDateFormat1.format( p1.getStartDate() ) ) + 1;
+                    //periodNameList.add( simpleDateFormat1.format( p1.getStartDate() ) + "-" + year );
+                    periodNameList.add( simpleDateFormat1.format( p1.getStartDate() ) );
                 }
             }
             else if ( periodType.getName().equalsIgnoreCase( "daily" ) )

=== added directory 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/nbits'
=== added directory 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/nbits/action'
=== added file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/nbits/action/NBITSReportFormAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/nbits/action/NBITSReportFormAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/nbits/action/NBITSReportFormAction.java	2011-03-01 08:37:19 +0000
@@ -0,0 +1,44 @@
+package org.hisp.dhis.reports.nbits.action;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramService;
+
+import com.opensymphony.xwork2.Action;
+
+public class NBITSReportFormAction implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private ProgramService programService;
+    
+    public void setProgramService( ProgramService programService )
+    {
+        this.programService = programService;
+    }
+    
+    // -------------------------------------------------------------------------
+    // Getter & Setter
+    // -------------------------------------------------------------------------
+
+    private List<Program> programList;
+    
+    public List<Program> getProgramList()
+    {
+        return programList;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+    public String execute() throws Exception
+    {
+        programList = new ArrayList<Program>( programService.getAllPrograms() );
+        
+        return SUCCESS;
+    }
+}

=== added file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/nbits/action/NBITSReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/nbits/action/NBITSReportResultAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/nbits/action/NBITSReportResultAction.java	2011-03-01 08:37:19 +0000
@@ -0,0 +1,461 @@
+package org.hisp.dhis.reports.nbits.action;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import jxl.Workbook;
+import jxl.write.Label;
+import jxl.write.WritableSheet;
+import jxl.write.WritableWorkbook;
+
+import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
+import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientAttribute;
+import org.hisp.dhis.patient.PatientAttributeService;
+import org.hisp.dhis.patient.PatientIdentifier;
+import org.hisp.dhis.patient.PatientIdentifierService;
+import org.hisp.dhis.patient.PatientIdentifierType;
+import org.hisp.dhis.patient.PatientIdentifierTypeService;
+import org.hisp.dhis.patient.PatientService;
+import org.hisp.dhis.patient.comparator.PatientAttributeComparator;
+import org.hisp.dhis.patient.comparator.PatientIdentifierTypeComparator;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
+import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
+import org.hisp.dhis.patientdatavalue.PatientDataValue;
+import org.hisp.dhis.patientdatavalue.PatientDataValueService;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramInstance;
+import org.hisp.dhis.program.ProgramInstanceService;
+import org.hisp.dhis.program.ProgramService;
+import org.hisp.dhis.program.ProgramStage;
+import org.hisp.dhis.program.ProgramStageDataElement;
+import org.hisp.dhis.program.ProgramStageInstance;
+import org.hisp.dhis.program.ProgramStageInstanceService;
+import org.hisp.dhis.program.comparator.ProgramStageNameComparator;
+import org.hisp.dhis.reports.util.ReportService;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.support.rowset.SqlRowSet;
+
+import com.opensymphony.xwork2.Action;
+
+public class NBITSReportResultAction implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private StatementManager statementManager;
+
+    public void setStatementManager( StatementManager statementManager )
+    {
+        this.statementManager = statementManager;
+    }
+
+    private ReportService reportService;
+
+    public void setReportService( ReportService reportService )
+    {
+        this.reportService = reportService;
+    }
+
+    private OrganisationUnitService organisationUnitService;
+    
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
+    private PatientService patientService;
+
+    public void setPatientService( PatientService patientService )
+    {
+        this.patientService = patientService;
+    }
+
+    private PatientIdentifierService patientIdentifierService;
+    
+    public void setPatientIdentifierService( PatientIdentifierService patientIdentifierService )
+    {
+        this.patientIdentifierService = patientIdentifierService;
+    }
+
+    private PatientIdentifierTypeService patientIdentifierTypeService;
+    
+    public void setPatientIdentifierTypeService( PatientIdentifierTypeService patientIdentifierTypeService )
+    {
+        this.patientIdentifierTypeService = patientIdentifierTypeService;
+    }
+
+    private PatientAttributeService patientAttributeService;
+
+    public void setPatientAttributeService( PatientAttributeService patientAttributeService )
+    {
+        this.patientAttributeService = patientAttributeService;
+    }
+
+    private PatientAttributeValueService patientAttributeValueService;
+
+    public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
+    {
+        this.patientAttributeValueService = patientAttributeValueService;
+    }
+
+    private PatientDataValueService patientDataValueService;
+
+    public void setPatientDataValueService( PatientDataValueService patientDataValueService )
+    {
+        this.patientDataValueService = patientDataValueService;
+    }
+
+    private ProgramService programService;
+    
+    public void setProgramService( ProgramService programService )
+    {
+        this.programService = programService;
+    }
+
+    private ProgramInstanceService programInstanceService;
+
+    public void setProgramInstanceService( ProgramInstanceService programInstanceService )
+    {
+        this.programInstanceService = programInstanceService;
+    }
+
+    private ProgramStageInstanceService programStageInstanceService;
+
+    public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
+    {
+        this.programStageInstanceService = programStageInstanceService;
+    }
+
+    private JdbcTemplate jdbcTemplate;
+
+    public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
+    {
+        this.jdbcTemplate = jdbcTemplate;
+    }
+
+    private I18nFormat format;
+
+    public void setFormat( I18nFormat format )
+    {
+        this.format = format;
+    }
+
+    // -------------------------------------------------------------------------
+    // Getter & Setter
+    // -------------------------------------------------------------------------
+    
+    private InputStream inputStream;
+
+    public InputStream getInputStream()
+    {
+        return inputStream;
+    }
+
+    private String fileName;
+
+    public String getFileName()
+    {
+        return fileName;
+    }
+
+    private int programList;
+    
+    public void setProgramList( int programList )
+    {
+        this.programList = programList;
+    }
+
+    private int ouIDTB;
+
+    public void setOuIDTB( int ouIDTB )
+    {
+        this.ouIDTB = ouIDTB;
+    }
+
+    private String startDate;
+
+    public void setStartDate( String startDate )
+    {
+        this.startDate = startDate;
+    }
+
+    private String endDate;
+
+    public void setEndDate( String endDate )
+    {
+        this.endDate = endDate;
+    }
+    
+    private Boolean includePeriod;
+
+    public void setIncludePeriod( Boolean includePeriod )
+    {
+        this.includePeriod = includePeriod;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+    public String execute() throws Exception 
+    {
+        statementManager.initialise();
+        
+        
+        Program selProgram = programService.getProgram( programList );
+        
+        List<OrganisationUnit> orgUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( ouIDTB )  );
+
+        List<OrganisationUnit> programOrgUnits = new ArrayList<OrganisationUnit>( selProgram.getOrganisationUnits() );
+        
+        orgUnitList.retainAll( programOrgUnits );
+        
+        Date sDate = format.parseDate( startDate );
+        
+        Date eDate = format.parseDate( endDate );
+
+        System.out.println("NBITS Report_" + orgUnitList.get( 0 ) + "_" + selProgram.getName() + "_StartTime: " + new Date() );
+        
+        generateReport( selProgram, orgUnitList, sDate, eDate );
+
+        System.out.println("NBITS Report_" + orgUnitList.get( 0 ) + "_" + selProgram.getName() + "_EndTime: " + new Date() );
+
+        statementManager.destroy();
+        
+        return SUCCESS;
+    }
+    
+    public void generateReport( Program selProgram, List<OrganisationUnit> orgUnitList, Date sDate, Date eDate ) throws Exception
+    {
+        String raFolderName = reportService.getRAFolderName();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        String query = "";
+        int rowStart = 3;
+        int colStart = 1;
+        int rowCount = rowStart;
+        int colCount = colStart;
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
+        WritableSheet sheet0 = outputReportWorkbook.createSheet( selProgram.getName(), 0 );
+
+        try
+        {
+            List<PatientIdentifierType> patientIdentifierTypes = new ArrayList<PatientIdentifierType>( patientIdentifierTypeService.getAllPatientIdentifierTypes() );
+            Collections.sort( patientIdentifierTypes, new PatientIdentifierTypeComparator() );
+            
+            List<PatientAttribute> patientAttributes = new ArrayList<PatientAttribute>( patientAttributeService.getAllPatientAttributes() );
+            Collections.sort( patientAttributes, new PatientAttributeComparator() );
+            
+            List<ProgramStage> programStages = new ArrayList<ProgramStage>( selProgram.getProgramStages() );
+            Collections.sort( programStages, new ProgramStageNameComparator() );
+            
+            Map<ProgramStage, List<DataElement>> programStageDataElementMap = new HashMap<ProgramStage, List<DataElement>>();
+            for( ProgramStage programStage : programStages )
+            {
+                List<ProgramStageDataElement> programStageDataElements = new ArrayList<ProgramStageDataElement>( programStage.getProgramStageDataElements() );
+                
+                List<DataElement> dataElements =  new ArrayList<DataElement>();
+                for( ProgramStageDataElement programStageDataElement : programStageDataElements )
+                {
+                    dataElements.add( programStageDataElement.getDataElement() );
+                }
+                
+                Collections.sort( dataElements, new DataElementNameComparator() );
+                programStageDataElementMap.put( programStage, dataElements );
+            }
+            
+            // Printing Header Information
+            sheet0.addCell( new Label( colCount, rowCount, "OrgUnit" ) );
+            colCount++;
+            for( PatientIdentifierType patientIdentifierType : patientIdentifierTypes )
+            {
+                sheet0.addCell( new Label( colCount, rowCount, patientIdentifierType.getName() ) );
+                colCount++;
+            }
+            sheet0.addCell( new Label( colCount, rowCount, "Benificiary Name" ) );
+            colCount++;
+            sheet0.addCell( new Label( colCount, rowCount, "Gender" ) );
+            colCount++;
+            sheet0.addCell( new Label( colCount, rowCount, "Age" ) );
+            colCount++;
+            sheet0.addCell( new Label( colCount, rowCount, "Data of Birth" ) );
+            colCount++;
+            sheet0.addCell( new Label( colCount, rowCount, "Blood Group" ) );
+            colCount++;
+            for( PatientAttribute patientAttribute : patientAttributes )
+            {
+                sheet0.addCell( new Label( colCount, rowCount, patientAttribute.getName() ) );
+                colCount++;
+            }
+            sheet0.addCell( new Label( colCount, rowCount, "Incident Date" ) );
+            colCount++;
+            sheet0.addCell( new Label( colCount, rowCount, "Enrollment Date" ) );
+            colCount++;
+            for( ProgramStage programStage : programStages )
+            {
+                for( DataElement dataElement : programStageDataElementMap.get( programStage ) )
+                {
+                    sheet0.addCell( new Label( colCount, rowCount, dataElement.getName() ) );
+                    colCount++;
+                }
+                sheet0.addCell( new Label( colCount, rowCount, "Due Date" ) );
+                colCount++;
+                sheet0.addCell( new Label( colCount, rowCount, "Execution Date" ) );
+                colCount++;
+            }
+            rowCount++;
+            
+            for( OrganisationUnit orgUnit : orgUnitList )
+            {
+                query = "SELECT patient.patientid, programinstance.programinstanceid,programinstance.dateofincident,programinstance.enrollmentdate FROM programinstance INNER JOIN patient " +
+                		" ON programinstance.patientid = patient.patientid " +
+                		" WHERE patient.organisationunitid = "+ orgUnit.getId() +
+                		" AND programinstance.programid = "+ selProgram.getId() +
+                		" AND enddate IS NULL";
+
+                SqlRowSet sqlResultSet = jdbcTemplate.queryForRowSet( query );
+                if ( sqlResultSet != null )
+                {
+                    sqlResultSet.beforeFirst();
+                    while ( sqlResultSet.next() )
+                    {
+                        colCount = colStart;
+                        sheet0.addCell( new Label( colCount, rowCount, orgUnit.getName() ) );
+                        colCount++;
+
+                        int patientId = sqlResultSet.getInt( 1 );
+                        int programInstanceId = sqlResultSet.getInt( 2 );
+                        ProgramInstance programInstance = programInstanceService.getProgramInstance( programInstanceId );
+                        Date dateOfIncident = sqlResultSet.getDate( 3 );
+                        Date dateOfEnrollment = sqlResultSet.getDate( 4 );
+                        
+                        Patient patient = patientService.getPatient( patientId );
+                        
+                        //Patient Identifier Details
+                        for( PatientIdentifierType patientIdentifierType : patientIdentifierTypes )
+                        {
+                            PatientIdentifier patientIdentifier = patientIdentifierService.getPatientIdentifier( patientIdentifierType, patient );
+                            if( patientIdentifier != null && patientIdentifier.getIdentifier() != null )
+                            {
+                                sheet0.addCell( new Label( colCount, rowCount, patientIdentifier.getIdentifier() ) );
+                            }
+                            else
+                            {
+                                sheet0.addCell( new Label( colCount, rowCount, "-" ) );
+                            }
+                            colCount++;
+                        }
+                        
+                        //Patient Properties
+                        sheet0.addCell( new Label( colCount, rowCount, patient.getFullName() ) );
+                        colCount++;
+                        sheet0.addCell( new Label( colCount, rowCount, patient.getTextGender() ) );
+                        colCount++;
+                        sheet0.addCell( new Label( colCount, rowCount, patient.getAge() ) );
+                        colCount++;
+                        sheet0.addCell( new Label( colCount, rowCount, simpleDateFormat.format( patient.getBirthDate() ) ) );
+                        colCount++;
+                        sheet0.addCell( new Label( colCount, rowCount, patient.getBloodGroup() ) );
+                        colCount++;
+
+                        //Patient Attribute Values
+                        for( PatientAttribute patientAttribute : patientAttributes )
+                        {
+                            PatientAttributeValue patientAttributeValue = patientAttributeValueService.getPatientAttributeValue( patient, patientAttribute );
+                            if( patientAttributeValue != null && patientAttributeValue.getValue() != null )
+                            {
+                                sheet0.addCell( new Label( colCount, rowCount, patientAttributeValue.getValue() ) );
+                            }
+                            else
+                            {
+                                sheet0.addCell( new Label( colCount, rowCount, "-" ) );
+                            }
+                            colCount++;
+                        }
+                        
+                        //Program Enrollment Details
+                        sheet0.addCell( new Label( colCount, rowCount, simpleDateFormat.format( dateOfIncident ) ) );
+                        colCount++;
+                        sheet0.addCell( new Label( colCount, rowCount, simpleDateFormat.format( dateOfEnrollment ) ) );
+                        colCount++;
+                        
+                        
+                        //ProgramStage Values
+                        for( ProgramStage programStage : programStages )
+                        {
+                            ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance( programInstance, programStage );
+
+                            for( DataElement dataElement : programStageDataElementMap.get( programStage ) )
+                            {
+                                PatientDataValue patientDataValue = patientDataValueService.getPatientDataValue( programStageInstance, dataElement, orgUnit );
+                                
+                                if( patientDataValue != null && patientDataValue.getValue() != null )
+                                {
+                                    sheet0.addCell( new Label( colCount, rowCount, patientDataValue.getValue() ) );    
+                                }
+                                else
+                                {
+                                    sheet0.addCell( new Label( colCount, rowCount, "-" ) );
+                                }
+                                colCount++;
+                            }
+                            if( programStageInstance.getDueDate() != null )
+                            {
+                                sheet0.addCell( new Label( colCount, rowCount, simpleDateFormat.format( programStageInstance.getDueDate() ) ) );
+                            }
+                            else
+                            {
+                                sheet0.addCell( new Label( colCount, rowCount, " " ) );
+                            }
+                            colCount++;
+                            
+                            if( programStageInstance.getExecutionDate() != null )
+                            {
+                                sheet0.addCell( new Label( colCount, rowCount, simpleDateFormat.format( programStageInstance.getExecutionDate() ) ) );
+                            }
+                            else
+                            {
+                                sheet0.addCell( new Label( colCount, rowCount, " " ) );
+                            }
+                            colCount++;
+                        }
+                        
+                        rowCount++;
+                    }
+                }
+
+            }
+
+        }
+        catch( Exception e )
+        {
+            System.out.println( "Exception: "+e.getMessage() );
+            e.printStackTrace();
+        }
+
+        outputReportWorkbook.write();
+        outputReportWorkbook.close();
+        fileName = selProgram.getName() + ".xls";
+        File outputReportFile = new File( outputReportPath );
+        inputStream = new BufferedInputStream( new FileInputStream( outputReportFile ) );
+        outputReportFile.deleteOnExit();
+
+    }
+}

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/periodwiseprogress/action/GeneratePeriodWiseProgressAnalyserResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/periodwiseprogress/action/GeneratePeriodWiseProgressAnalyserResultAction.java	2010-11-09 15:02:39 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/periodwiseprogress/action/GeneratePeriodWiseProgressAnalyserResultAction.java	2011-03-01 08:37:19 +0000
@@ -156,7 +156,7 @@
 
     Integer endMonth;
 
-    private Map<Integer, Integer> mapOfTotalValues;
+    private Map<Integer, Double> mapOfTotalValues;
 
     private int startRowNumber;
 
@@ -186,7 +186,7 @@
         simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
         monthFormat = new SimpleDateFormat( "MMMM" );
         yearFormat = new SimpleDateFormat( "yyyy" );
-        mapOfTotalValues = new HashMap<Integer, Integer>();
+        mapOfTotalValues = new HashMap<Integer, Double>();
         List<Integer> totalRowList = new ArrayList<Integer>();
         
         startMonth = 0;
@@ -421,22 +421,40 @@
                             tempStr = reportService.getResultDataValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit, reportModelTB );
                         }
                         
-                        int totalRowValue = 0;
+                        double totalRowValue = 0.0;
     
                         if( mapOfTotalValues.get( tempRowNo ) != null )
                         {
                             totalRowValue = mapOfTotalValues.get( tempRowNo );
     
+                            try
+                            {
+                                totalRowValue += Double.parseDouble( tempStr );
+                            }
+                            catch( Exception e )
+                            {
+                                
+                            }
+                            
+                            /*
                             if ( !( tempStr.equalsIgnoreCase( " " ) || tempStr.equalsIgnoreCase( "" ) ) )
                             {
                                 totalRowValue += Integer.valueOf( tempStr );
                             }
+                            */
     
                             mapOfTotalValues.put( tempRowNo, totalRowValue );
                         } 
                         else if( !( tempStr.equalsIgnoreCase( " " ) || tempStr.equalsIgnoreCase( "" ) ) )
                         {
-                                totalRowValue += Integer.valueOf( tempStr );
+                            try
+                            {
+                                totalRowValue += Double.parseDouble( tempStr );
+                            }
+                            catch( Exception e )
+                            {
+                                
+                            }
                         }
                         mapOfTotalValues.put( tempRowNo, totalRowValue );
                     } 
@@ -528,7 +546,7 @@
         while( rowIterator.hasNext() )
         {
             Integer currentRow = (Integer) rowIterator.next();
-            int value = 0;
+            double value = 0;
 
             if( mapOfTotalValues.containsKey( currentRow ) )
             {

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/portal/action/PortalReportsResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/portal/action/PortalReportsResultAction.java	2010-12-29 16:17:28 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/portal/action/PortalReportsResultAction.java	2011-03-01 08:37:19 +0000
@@ -80,40 +80,37 @@
 
 public class PortalReportsResultAction implements Action
 {
-
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
-    // <editor-fold defaultstate="collapsed" desc="dependencies">
     private StatementManager statementManager;
 
     public void setStatementManager( StatementManager statementManager )
     {
         this.statementManager = statementManager;
     }
+
     private ReportService reportService;
 
     public void setReportService( ReportService reportService )
     {
         this.reportService = reportService;
     }
+    
     private OrganisationUnitService organisationUnitService;
 
-    public OrganisationUnitService getOrganisationUnitService()
-    {
-        return organisationUnitService;
-    }
-
     public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
     {
         this.organisationUnitService = organisationUnitService;
     }
+
     private DataElementService dataElementService;
 
     public void setDataElementService( DataElementService dataElementService )
     {
         this.dataElementService = dataElementService;
     }
+
     private DataElementCategoryService dataElementCategoryOptionComboService;
 
     public void setDataElementCategoryOptionComboService(
@@ -121,82 +118,93 @@
     {
         this.dataElementCategoryOptionComboService = dataElementCategoryOptionComboService;
     }
+    
     private PeriodService periodService;
 
     public void setPeriodService( PeriodService periodService )
     {
         this.periodService = periodService;
     }
+    
     private PatientService patientService;
 
     public void setPatientService( PatientService patientService )
     {
         this.patientService = patientService;
     }
+    
     private ProgramService programService;
 
     public void setProgramService( ProgramService programService )
     {
         this.programService = programService;
     }
+
     private ProgramInstanceService programInstanceService;
 
     public void setProgramInstanceService( ProgramInstanceService programInstanceService )
     {
         this.programInstanceService = programInstanceService;
     }
+
     private ProgramStageService programStageService;
 
     public void setProgramStageService( ProgramStageService programStageService )
     {
         this.programStageService = programStageService;
     }
+
     private ProgramStageInstanceService programStageInstanceService;
 
     public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
     {
         this.programStageInstanceService = programStageInstanceService;
     }
+
     private PatientIdentifierService patientIdentifierService;
 
     public void setPatientIdentifierService( PatientIdentifierService patientIdentifierService )
     {
         this.patientIdentifierService = patientIdentifierService;
     }
+
     private PatientAttributeValueService patientAttributeValueService;
 
     public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
     {
         this.patientAttributeValueService = patientAttributeValueService;
     }
+
     private PatientAttributeService patientAttributeService;
 
     public void setPatientAttributeService( PatientAttributeService patientAttributeService )
     {
         this.patientAttributeService = patientAttributeService;
     }
+
     private PatientDataValueService patientDataValueService;
 
     public void setPatientDataValueService( PatientDataValueService patientDataValueService )
     {
         this.patientDataValueService = patientDataValueService;
     }
+
     private PatientIdentifierTypeService patientIdentifierTypeService;
 
     public void setPatientIdentifierTypeService( PatientIdentifierTypeService patientIdentifierTypeService )
     {
         this.patientIdentifierTypeService = patientIdentifierTypeService;
     }
+
     private I18nFormat format;
 
     public void setFormat( I18nFormat format ) {
         this.format = format;
     }
-    // </editor-fold>
+
     // -------------------------------------------------------------------------
     // Properties
     // -------------------------------------------------------------------------
-    // <editor-fold defaultstate="collapsed" desc="properties">
     private Map<Patient, Set<ProgramStageInstance>> visitsByPatients = new HashMap<Patient, Set<ProgramStageInstance>>();
 
     public Map<Patient, Set<ProgramStageInstance>> getVisitsByPatients()
@@ -215,12 +223,6 @@
     {
         return fileName;
     }
-    private MathTool mathTool;
-
-    public MathTool getMathTool()
-    {
-        return mathTool;
-    }
     private OrganisationUnit selectedOrgUnit;
 
     public OrganisationUnit getSelectedOrgUnit()
@@ -329,19 +331,18 @@
     private int rowCount;
     private Date sDate;
     private Date eDate;
-    // </editor-fold>
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
 
     public String execute()
-            throws Exception {
-        //con = ( new DBConnection() ).openConnection();
+            throws Exception 
+    {
         statementManager.initialise();
         raFolderName = reportService.getRAFolderName();
 
         // Initialization
-        mathTool = new MathTool();
         services = new ArrayList<String>();
         slNos = new ArrayList<String>();
         simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
@@ -375,11 +376,672 @@
         return SUCCESS;
     }
 
-    // <editor-fold defaultstate="collapsed" desc="generatPortalReport() method">
+    
     public void generatPortalReport() throws Exception
     {
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ), templateWorkbook );
+
+        // Cell formatting
+        WritableCellFormat wCellformat = new WritableCellFormat();
+        wCellformat.setBorder( Border.ALL, BorderLineStyle.THIN );
+        wCellformat.setAlignment( Alignment.CENTRE );
+        wCellformat.setVerticalAlignment( VerticalAlignment.CENTRE );
+        wCellformat.setWrap( true );
+
+        WritableCellFormat deWCellformat = new WritableCellFormat();
+        deWCellformat.setBorder( Border.ALL, BorderLineStyle.THIN );
+        deWCellformat.setAlignment( Alignment.CENTRE );
+        deWCellformat.setVerticalAlignment( VerticalAlignment.JUSTIFY );
+        deWCellformat.setWrap( true );
+
+        WritableSheet sheet = outputReportWorkbook.getSheet( 0 );
+        
+        // OrgUnit Related Info
+        selectedOrgUnit = new OrganisationUnit();
+        selectedOrgUnit = organisationUnitService.getOrganisationUnit( ouIDTB );
+
+        // Getting Programs
+        rowCount = 0;
+        List<String> deCodesList = getDECodes( deCodesXMLFileName );
+        String[] programIds = reportLevelTB.split( "," );
+
+        String tempStr = "";
+        String dataelementWithStage = "";
+        Collection<ProgramStage> programStagesList = new ArrayList<ProgramStage>();
+        if ( programIds.length != 0 )
+        {
+            for ( int pn = 0; pn < programIds.length; pn++ )
+            {
+                Program curProgram = programService.getProgram( Integer.parseInt( programIds[pn] ) );
+
+                if ( curProgram != null )
+                {
+                    int count1 = 0;
+
+                    Map<String, String> childPhoneNo = new HashMap<String, String>();
+                    childPhoneNo.put( "Others", "Immediate Relations" );
+                    childPhoneNo.put( "Neighbor", "Neighbor" );
+                    childPhoneNo.put( "Mother", "Parents" );
+                    childPhoneNo.put( "Father", "Parents" );
+                    childPhoneNo.put( "Husband", "Immediate Relations" );
+
+                    Map<String, String> dhisPortalMap = new HashMap<String, String>();
+
+                    //phone no of whom
+                    dhisPortalMap.put( "Others", "Others" );
+                    dhisPortalMap.put( "Neighbor", "Neighbor" );
+                    dhisPortalMap.put( "Mother", "Relative" );
+                    dhisPortalMap.put( "Father", "Relative" );
+                    dhisPortalMap.put( "Husband", "Relative" );
+                    dhisPortalMap.put( "Self", "Self" );
+
+                    //putting jsy beneficiary / rti/sti / complication / pnc checkup / breast feeded in map
+                    dhisPortalMap.put( "true", "Yes" );
+                    dhisPortalMap.put( "false", "No" );
+
+                    //putting linked facility / place of delivery
+                    dhisPortalMap.put( "(Sub Centre)", "Sub-center" );
+                    dhisPortalMap.put( "(PHC)", "PHC" );
+                    dhisPortalMap.put( "(CHC)", "CH" );
+                    dhisPortalMap.put( "(SDH)", "SDH" );
+                    dhisPortalMap.put( "(DH)", "DH" );
+                    //anemia
+                    dhisPortalMap.put( "(Normal)", "Normal" );
+                    dhisPortalMap.put( "(Moderate <11)", "( Moderate<11" );
+                    dhisPortalMap.put( "(Severe <7)", "Severe<7" );
+                    //anc Complication
+                    dhisPortalMap.put( "(ANC None)", "None" );
+                    dhisPortalMap.put( "(Hypertensive)", "Hypertensive" );
+                    dhisPortalMap.put( "(Diabetics)", "Diabetics" );
+                    dhisPortalMap.put( "(APH)", "APH" );
+                    dhisPortalMap.put( "(Malaria)", "Malaria" );
+                    //place of delivery home type
+                    dhisPortalMap.put( "(Home non SBA)", "Non SBA" );
+                    dhisPortalMap.put( "(Home SBA)", "SBA" );
+                    //place of delivery public
+                    dhisPortalMap.put( "(Sub Centre)", "Sub Centre" );
+                    dhisPortalMap.put( "(PHC.)", "PHC" );
+                    dhisPortalMap.put( "(CHC.)", "CH" );
+                    dhisPortalMap.put( "(SDH.)", "SDH" );
+                    dhisPortalMap.put( "(DH.)", "DH" );
+                    //place of delivery private
+                    dhisPortalMap.put( "(Private)", "Private" );
+                    List<String> podHomeList = new ArrayList<String>();
+                    podHomeList.add( "Non SBA" );
+                    podHomeList.add( "SBA" );
+
+                    List<String> podPublicList = new ArrayList<String>();
+                    podPublicList.add( "Sub Centre" );
+                    podPublicList.add( "PHC" );
+                    podPublicList.add( "CH" );
+                    podPublicList.add( "SDH" );
+                    podPublicList.add( "DH" );
+
+                    List<String> podPrivateList = new ArrayList<String>();
+                    podPrivateList.add( "Private" );
+                    
+                    //delivery type
+                    dhisPortalMap.put( "(Normal.)", "Normal" );
+                    dhisPortalMap.put( "(C Section)", "CS" );
+                    dhisPortalMap.put( "(Instrumental)", "Instrumental" );
+                    //abortion
+                    dhisPortalMap.put( "(MTP < 12 Weeks)", "MTP<12" );
+                    dhisPortalMap.put( "(MTP > 12 Weeks)", "MTP>12" );
+                    dhisPortalMap.put( "(Spontaneous)", "Spontaneous" );//not thr in excel sheet
+                    dhisPortalMap.put( "(None)", "None" );
+                    //pnc visit
+                    dhisPortalMap.put( "(with in 7 days)", "Within 7 days" );
+                    dhisPortalMap.put( "(With in 48 hrs)", "Within 48 hours" );
+                    //pnc complications
+                    dhisPortalMap.put( "(None.)", "None" );
+                    dhisPortalMap.put( "(Sepsis)", "Sepsis" );
+                    dhisPortalMap.put( "(PPH)", "PPH" );
+                    dhisPortalMap.put( "(Death)", "PPH" );
+                    dhisPortalMap.put( "(Others.)", "Others" );
+                    //pp contrapception
+                    dhisPortalMap.put( "(Other method)", "None" );
+                    dhisPortalMap.put( "(Sterilisation)", "Sterilisation" );
+                    dhisPortalMap.put( "(IUD)", "IUD" );
+                    dhisPortalMap.put( "(Injectibles)", "Injectibles" );
+                    //child health
+                    //blood group
+                    dhisPortalMap.put( "A+", "A+" );
+                    dhisPortalMap.put( "A-", "A-" );
+                    dhisPortalMap.put( "AB+", "AB+" );
+                    dhisPortalMap.put( "AB-", "AB-" );
+                    dhisPortalMap.put( "B+", "B+" );
+                    dhisPortalMap.put( "B-", "B-" );
+                    dhisPortalMap.put( "O+", "O+" );
+                    dhisPortalMap.put( "O-", "O-" );
+                    //gender
+                    dhisPortalMap.put( "M", "Male" );
+                    dhisPortalMap.put( "F", "Female" );
+
+                    Map<String, String> mFNameMap = new HashMap<String, String>();
+                    mFNameMap.put( "Father", "Father's" );
+                    mFNameMap.put( "Mother", "Mother's" );
+
+                    programStagesList = curProgram.getProgramStages();
+                    if ( programStagesList == null || programStagesList.isEmpty() )
+                    {
+                    }
+
+                    List<Patient> patientList = new ArrayList<Patient>();
+                    Map<Patient, ProgramInstance> patientPIList = new HashMap<Patient, ProgramInstance>();
+                    Map<ProgramInstance, Collection<ProgramStageInstance>> PIPSIList = new HashMap<ProgramInstance, Collection<ProgramStageInstance>>();
+                    Map<ProgramInstance, Collection<ProgramStageInstance>> PIAllPSIList = new HashMap<ProgramInstance, Collection<ProgramStageInstance>>();
+                    Map<Patient, OrganisationUnit> patientOuList = new HashMap<Patient, OrganisationUnit>();
+                    
+                    orgUnitList = getChildOrgUnitTree( selectedOrgUnit );
+
+                    for ( OrganisationUnit ou : orgUnitList )
+                    {
+                        Collection<Patient> patientListByOrgUnit = new ArrayList<Patient>();
+                        patientListByOrgUnit.addAll( patientService.getPatients( ou ) );
+                        
+                        Iterator<Patient> patientIterator = patientListByOrgUnit.iterator();
+                        while ( patientIterator.hasNext() )
+                        {
+                            Patient patient = patientIterator.next();
+                            
+                            //checking if patient is enrolled to curprog then adding them in one list
+                            Collection<ProgramInstance> programInstances = new ArrayList<ProgramInstance>();
+                            programInstances = programInstanceService.getProgramInstances( patient, curProgram );
+
+                            for ( ProgramInstance pi : programInstances )
+                            {
+                                Collection<ProgramStageInstance> programStageInstances = new ArrayList<ProgramStageInstance>();
+                                Collection<ProgramStageInstance> allProgramStageInstances = new ArrayList<ProgramStageInstance>();
+                                
+                                Iterator<ProgramStage> itr1 = programStagesList.iterator();
+                                while ( itr1.hasNext() )
+                                {
+                                    ProgramStage PSName = ( ProgramStage ) itr1.next();
+                                    ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance( pi, PSName );
+                                    if ( programStageInstance != null )
+                                    {
+                                        //putting all stageinstances in one list
+                                        allProgramStageInstances.add( programStageInstance );
+
+                                        //taking programstageinstace which are between startdate and enddate
+                                        if ( includePeriod != null )
+                                        {
+                                            if ( programStageInstance.getExecutionDate() != null )
+                                            {
+                                                if ( programStageInstance.getExecutionDate().after( sDate ) && programStageInstance.getExecutionDate().before( eDate ) )
+                                                {
+                                                    programStageInstances.add( programStageInstance );
+                                                }
+                                            }
+                                        } 
+                                        else
+                                        {
+                                            programStageInstances.add( programStageInstance );
+                                        }
+                                    }
+                                }
+                                if ( pi != null )
+                                {
+                                    //putting pi and psi together
+                                    PIPSIList.put( pi, programStageInstances );
+                                    PIAllPSIList.put( pi, allProgramStageInstances );
+                                    //putting patient and pi together
+                                    patientPIList.put( patient, pi );
+                                    patientOuList.put(patient, ou);
+                                    patientList.add( patient );
+
+                                }
+                            }
+                        }
+                    }
+
+                    int sheetNo = 0;
+                    rowCount = 0;
+                    //running patient loop
+                    for ( Patient patient : patientList )
+                    {
+                        ProgramInstance programInstance = patientPIList.get( patient );
+
+                        String cAPhoneNumberName = "";
+                        count1 = 0;
+                        int rowNo = rowList.get( 1 ) + rowCount;
+                        for ( String deCodeString : deCodesList )
+                        {
+                            int tempColNo = colList.get( count1 );
+                            sheetNo = sheetList.get( count1 );
+                            tempStr = "";
+                            String sType = ( String ) serviceType.get( count1 );
+                            if ( progList.get( count1 ) == curProgram.getId() )
+                            {
+                                if ( sType.equalsIgnoreCase( "srno" ) )
+                                {
+                                    int tempNum = 1 + rowCount;
+                                    tempStr = String.valueOf( tempNum );
+                                }
+                                if ( !deCodeString.equalsIgnoreCase( "NA" ) )
+                                {
+                                    if ( sType.equalsIgnoreCase( "identifiertype" ) )
+                                    {
+                                        int deCodeInt = Integer.parseInt( deCodeString );
+                                        PatientIdentifierType patientIdentifierType = patientIdentifierTypeService.getPatientIdentifierType( deCodeInt );
+                                        if ( patientIdentifierType != null ) {
+                                            PatientIdentifier patientIdentifier = patientIdentifierService.getPatientIdentifier( patientIdentifierType, patient );
+                                            if ( patientIdentifier != null ) {
+                                                tempStr = patientIdentifier.getIdentifier();
+                                            } else {
+                                                tempStr = " ";
+                                            }
+                                        }
+                                    } // </editor-fold>
+                                    else if ( sType.equalsIgnoreCase( "caseAttribute" ) )
+                                    {
+                                        int deCodeInt = Integer.parseInt( deCodeString );
+
+                                        PatientAttribute patientAttribute = patientAttributeService.getPatientAttribute( deCodeInt );
+                                        PatientAttributeValue patientAttributeValue = patientAttributeValueService.getPatientAttributeValue( patient, patientAttribute );
+                                        if ( patientAttributeValue != null ) {
+                                            tempStr = patientAttributeValue.getValue();
+                                            if ( dhisPortalMap.containsKey( tempStr ) ) {
+                                                tempStr = dhisPortalMap.get( tempStr );
+                                            }
+                                        } else {
+                                            tempStr = " ";
+                                        }
+                                    } // </editor-fold>
+                                    else if ( sType.equalsIgnoreCase( "dataelementstage" ) || sType.equalsIgnoreCase( "dataelementstagePODPublic" ) || sType.equalsIgnoreCase( "dataelementstagePODPrivate" ) || sType.equalsIgnoreCase( "dataelementstagePODHome" ) )
+                                    {
+                                        dataelementWithStage = deCodeString;
+                                        String[] deAndPs = dataelementWithStage.split( "\\." );
+                                        int psId = Integer.parseInt( deAndPs[0] );
+                                        int deId = Integer.parseInt( deAndPs[1] );
+                                        DataElement d1e = dataElementService.getDataElement( deId );
+                                        ProgramStageInstance pStageInstance = programStageInstanceService.getProgramStageInstance( programInstance, programStageService.getProgramStage( psId ) );
+                                        if ( pStageInstance != null && ( PIPSIList.get( programInstance ).contains( pStageInstance ) || programInstance.isCompleted() == false ) ) {
+                                            if ( pStageInstance.getExecutionDate() != null ) {
+                                                if ( includePeriod != null ) {
+                                                    if ( pStageInstance.getExecutionDate().before( eDate ) ) {
+                                                        PatientDataValue patientDataValue1 = patientDataValueService.getPatientDataValue( pStageInstance, d1e, patientOuList.get(patient) );
+
+                                                        if ( patientDataValue1 == null ) {
+                                                            tempStr = " ";
+                                                        } else if ( d1e.getType().equalsIgnoreCase( DataElement.VALUE_TYPE_STRING ) && d1e.isMultiDimensional() ) {
+                                                            DataElementCategoryOptionCombo dataElementCategoryOptionCombo = dataElementCategoryOptionComboService.getDataElementCategoryOptionCombo( Integer.parseInt( patientDataValue1.getValue() ) );
+                                                            String decocName = dataElementCategoryOptionCombo.getName();
+                                                            if ( dhisPortalMap.containsKey( decocName ) ) {
+                                                                decocName = dhisPortalMap.get( decocName );
+                                                                if ( sType.equalsIgnoreCase( "dataelementstagePODPublic" ) ) {
+                                                                    if ( podPublicList.contains( decocName ) ) {
+                                                                        tempStr = decocName;
+                                                                    }
+                                                                } else if ( sType.equalsIgnoreCase( "dataelementstagePODPrivate" ) ) {
+                                                                    if ( podPrivateList.contains( decocName ) ) {
+                                                                        tempStr = decocName;
+                                                                    }
+                                                                } else if ( sType.equalsIgnoreCase( "dataelementstagePODHome" ) ) {
+                                                                    if ( podHomeList.contains( decocName ) ) {
+                                                                        tempStr = decocName;
+                                                                    }
+                                                                } else {
+                                                                    tempStr = decocName;
+                                                                }
+                                                            }
+                                                        } else {
+                                                            tempStr = patientDataValue1.getValue();
+                                                            if ( dhisPortalMap.containsKey( tempStr ) ) {
+                                                                tempStr = dhisPortalMap.get( tempStr );
+                                                            }
+                                                        }
+                                                    }
+                                                } else {
+                                                    PatientDataValue patientDataValue1 = patientDataValueService.getPatientDataValue( pStageInstance, d1e, patientOuList.get(patient) );
+
+                                                    if ( patientDataValue1 == null ) {
+                                                        tempStr = " ";
+                                                    } else if ( d1e.getType().equalsIgnoreCase( DataElement.VALUE_TYPE_STRING ) && d1e.isMultiDimensional() ) {
+                                                        DataElementCategoryOptionCombo dataElementCategoryOptionCombo = dataElementCategoryOptionComboService.getDataElementCategoryOptionCombo( Integer.parseInt( patientDataValue1.getValue() ) );
+                                                        String decocName = dataElementCategoryOptionCombo.getName();
+                                                        if ( dhisPortalMap.containsKey( decocName ) ) {
+                                                            decocName = dhisPortalMap.get( decocName );
+                                                            if ( sType.equalsIgnoreCase( "dataelementstagePODPublic" ) ) {
+                                                                if ( podPublicList.contains( decocName ) ) {
+                                                                    tempStr = decocName;
+                                                                }
+                                                            } else if ( sType.equalsIgnoreCase( "dataelementstagePODPrivate" ) ) {
+                                                                if ( podPrivateList.contains( decocName ) ) {
+                                                                    tempStr = decocName;
+                                                                }
+                                                            } else if ( sType.equalsIgnoreCase( "dataelementstagePODHome" ) ) {
+                                                                if ( podHomeList.contains( decocName ) ) {
+                                                                    tempStr = decocName;
+                                                                }
+                                                            } else {
+                                                                tempStr = decocName;
+                                                            }
+                                                        }
+                                                    } else {
+                                                        tempStr = patientDataValue1.getValue();
+                                                        if ( dhisPortalMap.containsKey( tempStr ) ) {
+                                                            tempStr = dhisPortalMap.get( tempStr );
+                                                        }
+                                                    }
+                                                }
+                                            }
+                                        } else {
+                                            tempStr = " ";
+                                        }
+                                    } // </editor-fold>
+                                    // <editor-fold defaultstate="collapsed" desc="sType = dataelement">
+                                    else if ( sType.equalsIgnoreCase( "dataelement" ) )
+                                    {
+                                        if ( deCodeString.equalsIgnoreCase( "FACILITY" ) )
+                                        {
+                                            tempStr = patientOuList.get(patient).getName();
+                                        } 
+                                        else
+                                        {
+                                            int deCodeInt = Integer.parseInt( deCodeString );
+                                            //System.out.println("deCode = "+deCodeString);
+                                            DataElement d1e = dataElementService.getDataElement( deCodeInt );
+                                            Collection<ProgramStageInstance> programStageInstances = PIAllPSIList.get( programInstance );
+                                            Iterator<ProgramStageInstance> itrPSI = programStageInstances.iterator();
+                                            while ( itrPSI.hasNext() )
+                                            {
+                                                ProgramStageInstance programStageInstance = itrPSI.next();
+
+                                                PatientDataValue patientDataValue = patientDataValueService.getPatientDataValue( programStageInstance, d1e, patientOuList.get(patient) );
+                                                //System.out.println("psi = "+programStageInstance.getId() + " de = "+d1e + " ou = "+patientOuList.get(patient));
+                                                if ( patientDataValue != null )
+                                                {
+                                                    //System.out.println("tempStr = "+patientDataValue.getValue() + " de = "+d1e.getId());
+                                                    if ( d1e.getType().equalsIgnoreCase( DataElement.VALUE_TYPE_STRING ) && d1e.isMultiDimensional() )
+                                                    {
+
+                                                        DataElementCategoryOptionCombo dataElementCategoryOptionCombo = dataElementCategoryOptionComboService.getDataElementCategoryOptionCombo( Integer.parseInt( patientDataValue.getValue() ) );
+                                                        tempStr = dataElementCategoryOptionCombo.getName();
+                                                        
+                                                        if ( dhisPortalMap.containsKey( tempStr ) )
+                                                        {
+                                                            tempStr = dhisPortalMap.get( tempStr );
+                                                        }
+                                                    } 
+                                                    else if ( d1e.getType().equalsIgnoreCase( DataElement.VALUE_TYPE_DATE ) )
+                                                    {
+                                                        String str = patientDataValue.getValue();
+                                                        if ( str != null )
+                                                        {
+                                                            SimpleDateFormat simpleLmpDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+                                                            Date doseDate = simpleLmpDateFormat.parse( str );
+                                                            if ( includePeriod != null )
+                                                            {
+                                                                if ( doseDate.before( eDate ) )
+                                                                {
+                                                                    tempStr = simpleLmpDateFormat.format( doseDate );
+                                                                } 
+                                                                
+                                                            } 
+                                                            else
+                                                            {
+                                                                tempStr = simpleLmpDateFormat.format( doseDate );
+                                                            }
+
+                                                        } 
+                                                        
+                                                    } 
+                                                    else
+                                                    {
+
+                                                        tempStr = patientDataValue.getValue();
+                                                        if ( dhisPortalMap.containsKey( tempStr ) )
+                                                        {
+                                                            tempStr = dhisPortalMap.get( tempStr );
+                                                        }
+
+                                                    }
+                                                   
+                                                } 
+                                                else
+                                                {
+                                                    continue;
+                                                }
+                                                
+                                            }
+                                            if(tempStr.trim().equals(""))
+                                            {
+                                                tempStr = "";
+                                            }
+                                        }
+                                        //
+                                    } // </editor-fold>
+                                    // <editor-fold defaultstate="collapsed" desc="sType = caseProperty">
+                                    else if ( sType.equalsIgnoreCase( "caseProperty" ) )
+                                    {
+                                        if ( deCodeString.equalsIgnoreCase( "Name" ) )
+                                        {
+                                            tempStr = patient.getFullName();
+                                        } 
+                                        else if ( deCodeString.equalsIgnoreCase( "DOB" ) )
+                                        {
+                                            Date patientDate = patient.getBirthDate();
+                                            SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat( "yyyy-MM-dd" );
+                                            tempStr = simpleDateFormat1.format( patientDate );
+                                        } 
+                                        else if ( deCodeString.equalsIgnoreCase( "LMP" ) )
+                                        {
+                                            Date lmpDate = programInstance.getDateOfIncident();
+                                            SimpleDateFormat simpleLmpDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+                                            tempStr = simpleLmpDateFormat.format( lmpDate );
+                                        } 
+                                        else if ( deCodeString.equalsIgnoreCase( "PNCCheck" ) )
+                                        {
+                                            ProgramStage ps = programStageService.getProgramStage( 7 );
+                                            if ( curProgram.getProgramStages().contains( ps ) )
+                                            {
+                                                ProgramStageInstance psi = programStageInstanceService.getProgramStageInstance( programInstance, ps );
+                                                if ( psi.getExecutionDate() != null )
+                                                {
+                                                    if ( includePeriod != null )
+                                                    {
+                                                        if ( psi.getExecutionDate().before( eDate ) )
+                                                        {
+                                                            tempStr = "Yes";
+                                                        }
+                                                    } 
+                                                    else
+                                                    {
+                                                        tempStr = "Yes";
+                                                    }
+                                                } 
+                                                else
+                                                {
+                                                    tempStr = "No";
+                                                }
+                                            }
+                                        } 
+                                        else if ( deCodeString.equalsIgnoreCase( "BloodGroup" ) )
+                                        {
+                                            String bloodGroup = patient.getBloodGroup();
+                                            if ( !bloodGroup.trim().equalsIgnoreCase( "" ) )
+                                            {
+                                                if ( dhisPortalMap.containsKey( bloodGroup ) )
+                                                {
+                                                    tempStr = dhisPortalMap.get( bloodGroup );
+                                                }
+                                            } 
+                                            else
+                                            {
+                                                tempStr = "N.A";
+                                            }
+                                        } 
+                                        else if ( deCodeString.equalsIgnoreCase( "MotherId" ) )
+                                        {
+                                            Patient representative = patient.getRepresentative();
+                                            if ( representative != null )
+                                            {
+                                                String gender = representative.getGender();
+                                                if ( gender.equalsIgnoreCase( "F" ) )
+                                                {
+                                                    tempStr = patientIdentifierService.getPatientIdentifier( representative ).getIdentifier();
+                                                }
+                                            }
+                                        }
+                                    } // </editor-fold>
+                                    // <editor-fold defaultstate="collapsed" desc="sType = dataelementIFADate">
+                                    else if ( sType.equalsIgnoreCase( "dataelementIFADate" ) )
+                                    {
+                                        int deCodeInt = Integer.parseInt( deCodeString );
+                                        DataElement d1e = dataElementService.getDataElement( deCodeInt );
+                                        Collection<ProgramStageInstance> programStageInstances = PIAllPSIList.get( programInstance );
+                                        Iterator<ProgramStageInstance> itrPSI = programStageInstances.iterator();
+                                        while ( itrPSI.hasNext() )
+                                        {
+                                            ProgramStageInstance programStageInstance = itrPSI.next();
+                                            PatientDataValue patientDataValue = patientDataValueService.getPatientDataValue( programStageInstance, d1e, patientOuList.get(patient) );
+                                            if ( patientDataValue != null )
+                                            {
+                                                if ( d1e.getType().equalsIgnoreCase( DataElement.VALUE_TYPE_DATE ) )
+                                                {
+                                                    String str = patientDataValue.getValue();
+                                                    if ( str != null )
+                                                    {
+                                                        SimpleDateFormat simpleLmpDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+                                                        Date doseDate = simpleLmpDateFormat.parse( str );
+                                                        if ( includePeriod != null )
+                                                        {
+                                                            if ( doseDate.before( eDate ) )
+                                                            {
+                                                                tempStr = simpleLmpDateFormat.format( doseDate );
+                                                            } 
+                                                            else
+                                                            {
+                                                                tempStr = "";
+                                                            }
+                                                        } 
+                                                        else
+                                                        {
+                                                            tempStr = simpleLmpDateFormat.format( doseDate );
+                                                        }
+
+                                                    } 
+                                                    else
+                                                    {
+                                                        tempStr = "";
+                                                    }
+                                                }
+                                            } 
+                                            else
+                                            {
+                                                continue;
+                                            }
+                                        }
+                                    } // </editor-fold>
+                                    // <editor-fold defaultstate="collapsed" desc="sType = dataelementIFA">
+                                    else if ( sType.equalsIgnoreCase( "dataelementIFA" ) )
+                                    {
+                                        int deCodeInt = Integer.parseInt( deCodeString );
+                                        DataElement d1e = dataElementService.getDataElement( deCodeInt );
+                                        Collection<ProgramStageInstance> programStageInstances = PIAllPSIList.get( programInstance );
+                                        Iterator<ProgramStageInstance> itrPSI = programStageInstances.iterator();
+                                        int ifaCount = 0;
+
+                                        while ( itrPSI.hasNext() )
+                                        {
+
+                                            ProgramStageInstance programStageInstance = itrPSI.next();
+                                            PatientDataValue patientDataValue1 = patientDataValueService.getPatientDataValue( programStageInstance, d1e, patientOuList.get(patient) );
+                                            if ( patientDataValue1 != null )
+                                            {
+                                                ifaCount = Integer.parseInt( patientDataValue1.getValue() ) + ifaCount;
+                                                SimpleDateFormat simpleIfaDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+                                                if ( ifaCount >= 100 )
+                                                {
+                                                    tempStr = simpleIfaDateFormat.format( programStageInstance.getExecutionDate() );
+                                                    break;
+                                                }
+                                            }
+                                        }
+                                    } // </editor-fold>
+                                    // <editor-fold defaultstate="collapsed" desc="sType = caseAttributePN,caseAttributeHusband,caseAttributeMFName">
+                                    else if ( sType.equalsIgnoreCase( "caseAttributePN" ) || sType.equalsIgnoreCase( "caseAttributeHusband" ) || sType.equalsIgnoreCase( "caseAttributeMFName" ) )
+                                    {
+                                        int deCodeInt = Integer.parseInt( deCodeString );
+                                        PatientAttribute patientAttribute = patientAttributeService.getPatientAttribute( deCodeInt );
+                                        PatientAttributeValue patientAttributeValue = patientAttributeValueService.getPatientAttributeValue( patient, patientAttribute );
+                                        //System.out.println("patient "+patient +" pattr = "+patientAttribute.getName());
+
+                                        String name = "";
+                                        if ( patientAttributeValue != null )
+                                        {
+                                            if ( sType.equalsIgnoreCase( "caseAttributePN" ) )
+                                            {
+                                                name = patientAttributeValue.getValue();
+                                                System.out.println("name = "+name);
+                                                if ( curProgram.getId() == 1 && dhisPortalMap.containsKey( name ) )
+                                                {
+                                                    cAPhoneNumberName = name;
+                                                    tempStr = dhisPortalMap.get( name );
+                                                }
+                                                if ( curProgram.getId() == 2 && childPhoneNo.containsKey( name ) )
+                                                {
+                                                    cAPhoneNumberName = name;
+                                                    tempStr = childPhoneNo.get( name );
+                                                }
+                                            }
+                                            if ( sType.equalsIgnoreCase( "caseAttributeHusband" ) )
+                                            {
+                                                name = patientAttributeValue.getValue();
+                                                if ( cAPhoneNumberName.equals( "Husband" ) )
+                                                {
+                                                    tempStr = name;
+                                                }
+                                            }
+                                            if ( sType.equalsIgnoreCase( "caseAttributeMFName" ) )
+                                            {
+                                                name = patientAttributeValue.getValue();
+                                                if ( cAPhoneNumberName.equals( "Mother" ) || cAPhoneNumberName.equals( "Father" ) )
+                                                {
+                                                    tempStr = mFNameMap.get( cAPhoneNumberName );
+                                                }
+                                            }
+                                        } 
+                                        else
+                                        {
+                                            tempStr = " ";
+                                        }
+                                    }
+                                    // </editor-fold>
+                                }// end of if for excluding NA and program stages
+                                sheet = outputReportWorkbook.getSheet( sheetNo );
+                                WritableCell cell = sheet.getWritableCell( tempColNo, rowNo );
+                                sheet.addCell( new Label( tempColNo, rowNo, tempStr, wCellformat ) );
+                                //System.out.println(  "tempColNo = " + tempColNo + " rowNo = " + rowNo + " value = " + tempStr  );
+                            }// end of checking program no is same or not
+                            count1++;
+                        }//end of decodelist for loop
+                        // </editor-fold>
+                        rowCount++;
+                        rowNo++;
+                    }//end of patient for loop
+                    // </editor-fold>
+                }//end of curprogram if loop
+                // </editor-fold>
+            }//end of for loop for programs
+        }//end of programs if   
+
+        outputReportWorkbook.write();
+        outputReportWorkbook.close();
+        fileName = reportFileNameTB.replace( ".xls", "" );
+        fileName += "_" + selectedOrgUnit.getShortName() + ".xls";
+        File outputReportFile = new File( outputReportPath );
+        inputStream = new BufferedInputStream( new FileInputStream( outputReportFile ) );
+        outputReportFile.deleteOnExit();
+    }
+    
+    
+    public void generatPortalReport1() throws Exception
+    {
+        Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
+        WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ), templateWorkbook );
         // Cell formatting
         WritableCellFormat wCellformat = new WritableCellFormat();
         wCellformat.setBorder( Border.ALL, BorderLineStyle.THIN );
@@ -1295,5 +1957,4 @@
 
         return calendarList;
     }
-    // </editor-fold>
 }

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/routine/action/GenerateRoutineReportAnalyserResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/routine/action/GenerateRoutineReportAnalyserResultAction.java	2010-12-29 12:19:53 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/routine/action/GenerateRoutineReportAnalyserResultAction.java	2011-03-01 08:37:19 +0000
@@ -51,6 +51,7 @@
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
+    
     private StatementManager statementManager;
 
     public void setStatementManager( StatementManager statementManager )
@@ -96,6 +97,7 @@
     // -------------------------------------------------------------------------
     // Properties
     // -------------------------------------------------------------------------
+
     private InputStream inputStream;
 
     public InputStream getInputStream()
@@ -184,7 +186,6 @@
     public String execute()
         throws Exception
     {
-
         statementManager.initialise();
 
         // Initialization
@@ -203,9 +204,6 @@
         reportModelTB = selReportObj.getModel();
         reportFileNameTB = selReportObj.getExcelTemplateName();
         
-        System.out.println( "Report name is : " + selReportObj.getName()+ " , Report Model is  " + selReportObj.getModel() + " , Excel template name is : " + selReportObj.getExcelTemplateName() );
-        System.out.println( " , Report XML file  is : " + selReportObj.getXmlTemplateName()+ " , Report Type is :  " + selReportObj.getReportType() );
-        
         String inputTemplatePath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
             + "template" + File.separator + reportFileNameTB;
         String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
@@ -218,7 +216,6 @@
             Collections.sort( orgUnitList, new OrganisationUnitNameComparator() );
         }
         else if( reportModelTB.equalsIgnoreCase( "dynamicwithrootfacility" ) )
-        //else if( reportModelTB.equalsIgnoreCase( "dynamicwithroot" ) )
         {
             OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit( ouIDTB );
             orgUnitList = new ArrayList<OrganisationUnit>( orgUnit.getChildren() );
@@ -226,8 +223,6 @@
             orgUnitList.add( orgUnit );
 
             parentUnit = orgUnit.getName();
-            
-            System.out.println( " orgUnitList size is  : " + orgUnitList.size()+ " , Parent orgUnit is  : " + orgUnit.getName() );
         }
         else if( reportModelTB.equalsIgnoreCase( "STATIC" ) || reportModelTB.equalsIgnoreCase( "STATIC-DATAELEMENTS" ) || reportModelTB.equalsIgnoreCase( "STATIC-FINANCIAL" ) )
         {
@@ -251,16 +246,12 @@
             orgUnitGroup = organisationUnitGroupService.getOrganisationUnitGroup( Integer.parseInt( organisationUnitGroupId ) );
             orgGroupMembers = new ArrayList<OrganisationUnit>( orgUnitGroup.getMembers() );
         }
-
         
         selectedPeriod = periodService.getPeriod( availablePeriods );
-
         sDate = format.parseDate( String.valueOf( selectedPeriod.getStartDate() ) );
-
         eDate = format.parseDate( String.valueOf( selectedPeriod.getEndDate() ) );
 
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
-
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ), templateWorkbook );
 
         // Getting DataValues
@@ -273,7 +264,6 @@
             OrganisationUnit currentOrgUnit = (OrganisationUnit) it.next();
 
             Iterator<Report_inDesign> reportDesignIterator = reportDesignList.iterator();
-            int count1 = 0;
             while ( reportDesignIterator.hasNext() )
             {
                 Report_inDesign report_inDesign = (Report_inDesign) reportDesignIterator.next();
@@ -362,7 +352,6 @@
                 else if ( deCodeString.equalsIgnoreCase( "PERIOD-QUARTER" ) )
                 {
                     String startMonth = "";
-
                     startMonth = monthFormat.format( sDate );
 
                     if ( startMonth.equalsIgnoreCase( "April" ) )
@@ -385,7 +374,6 @@
                 else if ( deCodeString.equalsIgnoreCase( "SIMPLE-QUARTER" ) )
                 {
                     String startMonth = "";
-
                     startMonth = monthFormat.format( sDate );
 
                     if ( startMonth.equalsIgnoreCase( "April" ) )
@@ -408,7 +396,6 @@
                 else if ( deCodeString.equalsIgnoreCase( "QUARTER-MONTHS-SHORT" ) )
                 {
                     String startMonth = "";
-
                     startMonth = monthFormat.format( sDate );
 
                     if ( startMonth.equalsIgnoreCase( "April" ) )
@@ -705,6 +692,35 @@
                     tempStr = startYear + " - " + endYear;
 
                 }
+                else if ( deCodeString.equalsIgnoreCase( "PERIOD-MONTH-PREV" ) )
+                {
+                    tempStr = monthFormat.format( sDate );
+                    sDateTemp = sDate;
+                    Calendar tempCalendar = Calendar.getInstance();
+                    tempCalendar.setTime( sDateTemp );
+                    String startMonth = "";
+                    startMonth = monthFormat.format( sDateTemp );
+
+                    if ( startMonth.equalsIgnoreCase("January") )
+                    {
+                        tempCalendar.set(Calendar.MONTH, Calendar.DECEMBER);
+                        tempCalendar.roll( Calendar.YEAR, -1 );
+                        sDateTemp = tempCalendar.getTime();
+                    }
+                    else
+                    {
+                        tempCalendar.roll( Calendar.MONTH, -1 );
+                        sDateTemp = tempCalendar.getTime();
+                    }
+                }
+                else if ( deCodeString.equalsIgnoreCase( "BFYEAR-FROM-TO" ) )
+                {
+                    tempStr = "" + (orgUnitCount + 1);
+                }
+                else if ( deCodeString.equalsIgnoreCase( "BFYEAR" ) )
+                {
+                    tempStr = "" + (orgUnitCount + 1);
+                }
                 else if ( deCodeString.equalsIgnoreCase( "SLNO" ) )
                 {
                     tempStr = "" + (orgUnitCount + 1);
@@ -751,8 +767,137 @@
 
                             tempNum = temp;
                             tempStr = String.valueOf( (int) temp );
-                            //System.out.println( tempStr );
-                        }
+                        }
+                    }
+                    else if ( sType.equalsIgnoreCase( "de-text-agg" ) )
+                    {
+                        if ( organisationUnitGroupId.equalsIgnoreCase( "ALL" ) )
+                        {
+                            tempStr = reportService.getAggCountForTextData( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit );
+                        }
+                        else if ( organisationUnitGroupId.equalsIgnoreCase( "Selected_Only" ) )
+                        {
+                            tempStr = reportService.getCountForTextData( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit );
+                        }
+                        else
+                        {
+                            List<OrganisationUnit> orgUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( currentOrgUnit.getId() ) );
+                            
+                            orgUnitList.retainAll( orgGroupMembers );
+                            
+                            double temp = 0.0;
+                            double value = 0.0;
+                            for ( OrganisationUnit unit : orgUnitList )
+                            {
+                                tempStr = reportService.getAggCountForTextData( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), unit );
+
+                                try
+                                {
+                                    value = Double.valueOf( tempStr );
+                                }
+                                catch ( Exception e )
+                                {
+                                    value = 0.0;
+                                    System.out.println( e );
+                                }
+                                temp += value;
+                            }
+
+                            tempNum = temp;
+                            tempStr = String.valueOf( (int) temp );
+                        }
+                    }
+                    else if ( sType.equalsIgnoreCase( "progressivede" ) )
+                    {
+                        int year = Integer.parseInt( deType );
+                        tempStartDate.set( year, 1, 1, 0, 0, 0 );
+                        tempEndDate.setTime( selectedPeriod.getEndDate() );
+                        
+                        if ( organisationUnitGroupId.equalsIgnoreCase( "ALL" ) )
+                        {
+                            tempStr = reportService.getResultDataValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit, reportModelTB );
+                        }
+                        else if ( organisationUnitGroupId.equalsIgnoreCase( "Selected_Only" ) )
+                        {
+                            tempStr = reportService.getIndividualResultDataValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit, reportModelTB );
+                        }
+                        else
+                        {
+                            List<OrganisationUnit> orgUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( currentOrgUnit.getId() ) );
+                            orgUnitList.retainAll( orgGroupMembers );
+                            
+                            double temp = 0.0;
+                            double value = 0.0;
+                            for ( OrganisationUnit unit : orgUnitList )
+                            {
+                                tempStr = reportService.getResultDataValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), unit, reportModelTB );
+                                try
+                                {
+                                    value = Double.valueOf( tempStr );
+                                }
+                                catch ( Exception e )
+                                {
+                                    value = 0.0;
+                                    System.out.println( e );
+                                }
+                                temp += value;
+                            }
+                            tempNum = temp;
+                            tempStr = String.valueOf( (int) temp );
+                        }
+                    }
+                    else if ( sType.equalsIgnoreCase( "financialprogressivede" ) )
+                    {
+                        int year = Integer.parseInt( deType );
+                        tempStartDate.set( year, 1, 1, 0, 0, 0 );
+                        
+                        tempEndDate.setTime( selectedPeriod.getEndDate() );
+                        if ( tempEndDate.get( Calendar.MONTH ) < Calendar.JULY )
+                        {
+                            tempEndDate.roll( Calendar.YEAR, -1 );
+                        }
+                        tempEndDate.set( Calendar.MONTH, Calendar.JULY );
+
+                        if ( organisationUnitGroupId.equalsIgnoreCase( "ALL" ) )
+                        {
+                            tempStr = reportService.getResultDataValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit, reportModelTB );
+                        }
+                        else if ( organisationUnitGroupId.equalsIgnoreCase( "Selected_Only" ) )
+                        {
+                            tempStr = reportService.getIndividualResultDataValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit, reportModelTB );
+                        }
+                        else
+                        {
+                            List<OrganisationUnit> orgUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( currentOrgUnit.getId() ) );
+                            orgUnitList.retainAll( orgGroupMembers );
+                            
+                            double temp = 0.0;
+                            double value = 0.0;
+                            for ( OrganisationUnit unit : orgUnitList )
+                            {
+                                tempStr = reportService.getResultDataValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), unit, reportModelTB );
+                                try
+                                {
+                                    value = Double.valueOf( tempStr );
+                                }
+                                catch ( Exception e )
+                                {
+                                    value = 0.0;
+                                    System.out.println( e );
+                                }
+                                temp += value;
+                            }
+                            tempNum = temp;
+                            tempStr = String.valueOf( (int) temp );
+                        }
+                    }
+                    else if( sType.equalsIgnoreCase( "survey" ))
+                    {
+                        tempStr = reportService.getResultSurveyValue( deCodeString, currentOrgUnit );
+                    }
+                    else if( sType.equalsIgnoreCase( "surveydesc" ) )
+                    {
+                        tempStr = reportService.getSurveyDesc( deCodeString );
                     }
                     else if ( sType.equalsIgnoreCase( "dataelement-boolean" ) )
                     {
@@ -767,13 +912,39 @@
                     }
                     else
                     {
-                        if ( aggCB == null )
+                        if ( organisationUnitGroupId.equalsIgnoreCase( "ALL" ) )
+                        {
+                            tempStr = reportService.getResultIndicatorValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit );
+                        }
+                        else if ( organisationUnitGroupId.equalsIgnoreCase( "Selected_Only" ) )
                         {
                             tempStr = reportService.getIndividualResultIndicatorValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit );
                         }
                         else
                         {
-                            tempStr = reportService.getResultIndicatorValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit );
+                            List<OrganisationUnit> orgUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( currentOrgUnit.getId() ) );
+                            orgUnitList.retainAll( orgGroupMembers );
+                            
+                            double temp = 0.0;
+                            double value = 0.0;
+                            for ( OrganisationUnit unit : orgUnitList )
+                            {
+                                tempStr = reportService.getResultIndicatorValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), unit );
+
+                                try
+                                {
+                                    value = Double.valueOf( tempStr );
+                                }
+                                catch ( Exception e )
+                                {
+                                    value = 0.0;
+                                    System.out.println( e );
+                                }
+                                temp += value;
+                            }
+
+                            tempNum = temp;
+                            tempStr = String.valueOf( temp );
                         }
                     }
                 }
@@ -785,7 +956,6 @@
                
                 if ( tempStr == null || tempStr.equals( " " ) )
                 {
-                    //tempColNo += orgUnitCount;
                     tempRowNo += orgUnitCount;
                     
                     WritableCellFormat wCellformat = new WritableCellFormat();
@@ -796,7 +966,6 @@
                     sheet0.addCell( new Blank( tempColNo, tempRowNo, wCellformat ) );
                 }
                else 
-               // if ( tempStr != null || tempStr != " " )
                 {
                     if ( reportModelTB.equalsIgnoreCase( "DYNAMIC-ORGUNIT" ) )
                     {
@@ -836,7 +1005,6 @@
                         }
                     }
                     else if ( reportModelTB.equalsIgnoreCase( "dynamicwithrootfacility" ) )
-                    //else if ( reportModelTB.equalsIgnoreCase( "dynamicwithroot" ) )    
                     {
                         if ( deCodeString.equalsIgnoreCase( "FACILITYP" )
                             || deCodeString.equalsIgnoreCase( "FACILITY-NOREPEAT" )
@@ -902,9 +1070,7 @@
                             sheet0.addCell( new Label( tempColNo, tempRowNo, tempStr, wCellformat ) );
                         }
                     }
-
                 }
-                count1++;
             }// inner while loop end
             orgUnitCount++;
         }// outer while loop end
@@ -926,5 +1092,4 @@
 
         return SUCCESS;
     }
-
 }

=== modified file 'local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml	2011-01-13 04:53:40 +0000
+++ local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml	2011-03-01 08:37:19 +0000
@@ -338,12 +338,8 @@
 		<property name="dataSetLockService">
 			<ref bean="org.hisp.dhis.datalock.DataSetLockService"/>
 		</property>
-		<!-- added report service 23/08/2010-->
 		<property name="reportService" ref="org.hisp.dhis.reports.ReportService">
 		</property>
-		<!--    <property name="reportService">
-		<ref bean="org.hisp.dhis.reports.util.ReportService"/>
-		</property>-->
 	</bean>
 	
 	<bean id="org.hisp.dhis.reports.datasetlock.action.GetPeriodsForLockAction"
@@ -484,14 +480,8 @@
 		id="org.hisp.dhis.reports.advanced.action.GenerateAdvancedReportsFormAction"
 		class="org.hisp.dhis.reports.advanced.action.GenerateAdvancedReportsFormAction"
 		scope="prototype">
-		<!-- added report service 21/08/2010-->
-		<!--	<property name="reportService">
-		<ref bean="org.hisp.dhis.reports.util.ReportService"/>
-		</property>-->
-		
 		<property name="reportService" ref="org.hisp.dhis.reports.ReportService">
 		</property>
-		
 	</bean>
 	
 	<bean
@@ -500,11 +490,6 @@
 		scope="prototype">
 		
 		<property name="statementManager" ref="statementManager"/>
-		
-		<!-- added report service 21/08/2010-->
-		<!--	<property name="reportService">
-		<ref bean="org.hisp.dhis.reports.util.ReportService"/>
-		</property>-->
 		<property name="reportService" ref="org.hisp.dhis.reports.ReportService">
 		</property>
 		<property name="organisationUnitService">
@@ -1059,24 +1044,16 @@
 		<property name="organisationUnitService">
 			<ref bean="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
 		</property>
-		<!-- added report service 20/08/2010-->
 		<property name="reportService" ref="org.hisp.dhis.reports.ReportService">
 		</property>
 		<property name="periodService" ref="org.hisp.dhis.period.PeriodService">
 		</property>
-		<!--	<property name="reportService">
-		<ref bean="org.hisp.dhis.reports.util.ReportService"/>
-		</property>-->
 	</bean>
 	<bean id="org.hisp.dhis.reports.action.GetProgressReportsAction"
 		class="org.hisp.dhis.reports.action.GetProgressReportsAction"
 		scope="prototype">
-		<!-- added report service 20/08/2010-->
 		<property name="reportService" ref="org.hisp.dhis.reports.ReportService">
 		</property>
-		<!--	<property name="reportService">
-		<ref bean="org.hisp.dhis.reports.util.ReportService"/>
-		</property> -->
 	</bean>
 	
 	<bean id="org.hisp.dhis.reports.action.GetOrgUnitGroupsAction"
@@ -1100,19 +1077,63 @@
 		scope="prototype">
 	</bean>
 	
-	
+    <!--physical reports -->
+    <bean id="org.hisp.dhis.reports.physical.action.PhysicalReportFormAction"
+        class="org.hisp.dhis.reports.physical.action.PhysicalReportFormAction" scope="prototype">
+        <property name="reportService" ref="org.hisp.dhis.reports.ReportService" />    
+        <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+    </bean>
+    
+    <bean id="org.hisp.dhis.reports.physical.action.GeneratePhysicalReportResultAction"
+        class="org.hisp.dhis.reports.physical.action.GeneratePhysicalReportResultAction" scope="prototype">
+        <property name="statementManager" ref="statementManager" />
+        <property name="reportService" ref="org.hisp.dhis.reports.ReportService" />
+        <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+        <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+    </bean>
+    
+    <!-- CS Review Reports Start 09/08/2010-->
+    <bean
+        id="org.hisp.dhis.reports.csreview.action.GenerateCSReviewReportFormAction"
+        class="org.hisp.dhis.reports.csreview.action.GenerateCSReviewReportFormAction"
+        scope="prototype">
+        <property name="reportService" ref="org.hisp.dhis.reports.ReportService">
+        </property>
+    </bean>
+    <bean
+        id="org.hisp.dhis.reports.csreview.action.GenerateCSReviewReportResultAction"
+        class="org.hisp.dhis.reports.csreview.action.GenerateCSReviewReportResultAction"
+        scope="prototype">
+        <property name="reportService" ref="org.hisp.dhis.reports.ReportService">
+        </property>
+        <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService">
+        </property>
+        <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService">
+        </property>
+        <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService">
+        </property>
+        <property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService">
+        </property>
+        <property name="statementManager" ref="statementManager">
+        </property>
+        <property name="periodService" ref="org.hisp.dhis.period.PeriodService">
+        </property>
+        <property name="aggregationService" ref="org.hisp.dhis.aggregation.AggregationService">
+        </property>
+       <property name="dataElementCategoryOptionComboService"
+            ref ="org.hisp.dhis.dataelement.DataElementCategoryService">
+            </property>
+    </bean>
+
+<!-- NBITS Reports Section -->	
 	<!-- NBITS : Activity Plan Report -->
 	
 	<bean
 		id="org.hisp.dhis.reports.activeplan.action.ActivePlanReportsFormAction"
 		class="org.hisp.dhis.reports.activeplan.action.ActivePlanReportsFormAction"
 		scope="prototype">
-		<!-- added report service 20/08/2010-->
 		<property name="reportService" ref="org.hisp.dhis.reports.ReportService">
 		</property>
-		<!--	<property name="reportService">
-		<ref bean="org.hisp.dhis.reports.util.ReportService"/>
-		</property>-->
 		<property name="periodService">
 			<ref bean="org.hisp.dhis.period.PeriodService"/>
 		</property>
@@ -1124,12 +1145,8 @@
 		scope="prototype">
 		
 		<property name="statementManager" ref="statementManager"/>
-		<!-- added report service 20/08/2010-->
 		<property name="reportService" ref="org.hisp.dhis.reports.ReportService">
 		</property>
-		<!--		<property name="reportService">
-		<ref bean="org.hisp.dhis.reports.util.ReportService"/>
-		</property>-->
 		<property name="organisationUnitService">
 			<ref bean="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
 		</property>
@@ -1305,54 +1322,30 @@
 		</property>
 		
 	</bean>
-	
-	<!--physical reports -->
-    <bean id="org.hisp.dhis.reports.physical.action.PhysicalReportFormAction"
-        class="org.hisp.dhis.reports.physical.action.PhysicalReportFormAction" scope="prototype">
-		<property name="reportService" ref="org.hisp.dhis.reports.ReportService" />    
-		<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
-    </bean>
-    
-	<bean id="org.hisp.dhis.reports.physical.action.GeneratePhysicalReportResultAction"
-		class="org.hisp.dhis.reports.physical.action.GeneratePhysicalReportResultAction" scope="prototype">
-		<property name="statementManager" ref="statementManager" />
-		<property name="reportService" ref="org.hisp.dhis.reports.ReportService" />
-		<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
-		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
-    </bean>
-	
-	<!-- CS Review Reports Start 09/08/2010-->
-    <bean
-        id="org.hisp.dhis.reports.csreview.action.GenerateCSReviewReportFormAction"
-        class="org.hisp.dhis.reports.csreview.action.GenerateCSReviewReportFormAction"
-        scope="prototype">
-        <property name="reportService" ref="org.hisp.dhis.reports.ReportService">
-        </property>
-    </bean>
-    <bean
-        id="org.hisp.dhis.reports.csreview.action.GenerateCSReviewReportResultAction"
-        class="org.hisp.dhis.reports.csreview.action.GenerateCSReviewReportResultAction"
-        scope="prototype">
-        <property name="reportService" ref="org.hisp.dhis.reports.ReportService">
-        </property>
-        <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService">
-        </property>
-        <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService">
-        </property>
-        <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService">
-        </property>
-        <property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService">
-        </property>
-        <property name="statementManager" ref="statementManager">
-        </property>
-        <property name="periodService" ref="org.hisp.dhis.period.PeriodService">
-        </property>
-        <property name="aggregationService" ref="org.hisp.dhis.aggregation.AggregationService">
-        </property>
-       <property name="dataElementCategoryOptionComboService"
-            ref ="org.hisp.dhis.dataelement.DataElementCategoryService">
-            </property>
-    </bean>
-    <!-- CS Review Reports End 09/08/2010-->
+
+	<!-- NBITS Reports -->
+    <bean id="org.hisp.dhis.reports.nbits.action.NBITSReportFormAction"
+        class="org.hisp.dhis.reports.nbits.action.NBITSReportFormAction"
+        scope="prototype">
+        <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+    </bean>
+    <bean id="org.hisp.dhis.reports.nbits.action.NBITSReportResultAction"
+        class="org.hisp.dhis.reports.nbits.action.NBITSReportResultAction"
+        scope="prototype">
+        <property name="statementManager" ref="statementManager" />
+        <property name="reportService" ref="org.hisp.dhis.reports.util.ReportService" />
+        <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+        <property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
+        <property name="patientIdentifierService" ref="org.hisp.dhis.patient.PatientIdentifierService" />
+        <property name="patientIdentifierTypeService" ref="org.hisp.dhis.patient.PatientIdentifierTypeService" />
+        <property name="patientAttributeService" ref="org.hisp.dhis.patient.PatientAttributeService" />
+        <property name="patientAttributeValueService" ref="org.hisp.dhis.patientattributevalue.PatientAttributeValueService" />
+        <property name="patientDataValueService" ref="org.hisp.dhis.patientdatavalue.PatientDataValueService" />
+        <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+        <property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
+        <property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
+        <property name="jdbcTemplate" ref="jdbcTemplate"/>
+    </bean>
+
 	
 </beans>

=== modified file 'local/in/dhis-web-reports-national/src/main/resources/struts.xml'
--- local/in/dhis-web-reports-national/src/main/resources/struts.xml	2011-01-11 12:10:34 +0000
+++ local/in/dhis-web-reports-national/src/main/resources/struts.xml	2011-03-01 08:37:19 +0000
@@ -172,87 +172,6 @@
 			</result>
 		</action>
 		
-		<!-- ActivityPlan Reports -->
-		<action name="activePlanReportsAnalyser"
-			class="org.hisp.dhis.reports.activeplan.action.ActivePlanReportsFormAction">
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-reports/activePlanReportsForm.vm</param>
-			<param name="menu">/dhis-web-reports/menuWithTreeForActivePlan.vm</param>
-			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/calendar/calendar.js,../dhis-web-commons/calendar/calendar-lang.js,../dhis-web-commons/calendar/calendar-setup.js,../dhis-web-commons/lists/lists.js,javascript/reports.js,javascript/hashtable.js</param>
-			<param name="stylesheets">css/StylesForTags.css</param>
-			<param name="requiredAuthorities">F_REPORT_ACTIVITYPLAN</param>
-			<interceptor-ref name="organisationUnitTreeStack"/>
-		</action>
-		<action name="generateActivePlanReport"
-			class="org.hisp.dhis.reports.activeplan.action.ActivePlanReportsResultAction">
-			<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>
-		<action name="activePlanFeedbackReportsAnalyser"
-			class="org.hisp.dhis.reports.activeplan.action.ActivePlanFeedBackFormAction">
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-reports/activePlanFeedBackForm.vm</param>
-			<param name="menu">/dhis-web-reports/menuWithTreeForActivePlan.vm</param>
-			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/reports.js,javascript/hashtable.js</param>
-			<param name="stylesheets">css/StylesForTags.css</param>
-			<interceptor-ref name="organisationUnitTreeStack"/>
-		</action>
-		<action name="generateActivePlanFeedbackReport"
-			class="org.hisp.dhis.reports.activeplan.action.ActivePlanFeedBackResultAction">
-			<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>
-		
-		<!-- BenificiaryInfo Reports -->
-		<action name="benificiaryInfoReportsAnalyser"
-			class="org.hisp.dhis.reports.benificiaryinfo.action.BenificiaryInfoReportsFormAction">
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-reports/benificiaryInfoReportsForm.vm</param>
-			<param name="menu">/dhis-web-reports/menuWithTreeForBenificiaryInfo.vm</param>
-			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/calendar/calendar.js,../dhis-web-commons/calendar/calendar-lang.js,../dhis-web-commons/calendar/calendar-setup.js,../dhis-web-commons/lists/lists.js,javascript/reports.js,javascript/hashtable.js</param>
-			<param name="stylesheets">css/StylesForTags.css</param>
-			<param name="requiredAuthorities">F_REPORT_BENIFICIARY_INFO</param>
-			<interceptor-ref name="organisationUnitTreeStack"/>
-		</action>
-		<action name="generateBenificiaryInfoReport"
-			class="org.hisp.dhis.reports.benificiaryinfo.action.BenificiaryInfoReportsResultAction">
-			<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>
-		
-		<!-- Portal Reports -->
-		<action name="portalReportsAnalyser"
-			class="org.hisp.dhis.reports.portal.action.PortalReportsFormAction">
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-reports/portalReportForm.vm</param>
-			<param name="menu">/dhis-web-reports/menuWithTreeForPortalReport.vm</param>
-			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/calendar/calendar.js,../dhis-web-commons/calendar/calendar-lang.js,../dhis-web-commons/calendar/calendar-setup.js,../dhis-web-commons/lists/lists.js,javascript/reports.js,javascript/hashtable.js</param>
-			<param name="stylesheets">css/StylesForTags.css</param>
-			<param name="requiredAuthorities">F_REPORT_NBITS_PORTAL</param>
-			<interceptor-ref name="organisationUnitTreeStack"/>
-		</action>
-		<action name="generatePortalReport"
-			class="org.hisp.dhis.reports.portal.action.PortalReportsResultAction">
-			<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>
-		
 		<!-- Auto Reports -->
 		<action name="autoReportAnalyser"
 			class="org.hisp.dhis.reports.auto.action.GenerateAutoReportAnalyserFormAction">
@@ -653,6 +572,174 @@
 			<param name="requiredAuthorities">F_REPORT_POPULATE_USERS</param>
 			<interceptor-ref name="organisationUnitTreeStack"/>
 		</action>
+        <!-- Quarterly PhysicalOutput Reports -->
+        <action name="quarterlyPhysicalReport" 
+            class="org.hisp.dhis.reports.physical.action.PhysicalReportFormAction">
+            <result name="success" type="velocity">/main.vm</result>
+            <param name="page">/dhis-web-reports/physicalReportform.vm</param>
+            <param name="menu">/dhis-web-reports/menuWithphysicaOutputReports.vm</param>
+            <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/reportManagement.js,javascript/hashtable.js</param>
+            <param name="stylesheets">css/StylesForTags.css</param>
+            <param name="requiredAuthorities">F_REPORT_PHYSICALOP</param>
+            <interceptor-ref name="organisationUnitTreeStack"/>
+        </action>
+        <action name="generatePhysicalReport"
+            class="org.hisp.dhis.reports.physical.action.GeneratePhysicalReportResultAction">
+            <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>
+        
+        <!--Mobile Report-->
+        <action name="mobileReportAnalyser"
+            class="org.hisp.dhis.reports.mobile.action.GenerateMobileReportAnalyserFormAction">
+            <result name="success" type="velocity">/main.vm</result>
+            <param name="page">
+                /dhis-web-reports/mobileReportAnalysisFront.vm</param>
+            <param name="menu">
+                /dhis-web-reports/menuWithTreeForMobileReport.vm</param>
+            <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/datasetLockReport.js,javascript/reportManagement.js,javascript/hashtable.js</param>
+            <param name="stylesheets">css/StylesForTags.css</param>
+            <interceptor-ref name="organisationUnitTreeStack"/>
+        </action>
+        
+        <action name="generateMobileReport"
+            class="org.hisp.dhis.reports.mobile.action.GenerateMobileReportAnalyserResultAction">
+            <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>S </result>
+        </action>
+        
+        <!-- CS Review Reports Start -->
+        <action name="csReviewReportForm"
+            class="org.hisp.dhis.reports.csreview.action.GenerateCSReviewReportFormAction">
+            <result name="success" type="velocity">/main.vm</result>
+            <param name="page">/dhis-web-reports/csReviewReportFront.vm</param>
+            <param name="menu">/dhis-web-reports/menuWithTreeForCSReviewReport.vm</param>
+            <param name="javascripts">../dhis-web-commons/calendar/calendar.js,../dhis-web-commons/calendar/calendar-lang.js,../dhis-web-commons/calendar/calendar-setup.js,../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/util/lists.js,javascript/reportManagement.js,javascript/hashtable.js,../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js</param>
+            <param name="stylesheets">css/StylesForTags.css</param>
+            <param name="requiredAuthorities">F_REPORT_CSREVIEW</param>
+            <interceptor-ref name="organisationUnitTreeStack"/>
+        </action>
+        <action name="generateCSReviewReportResult" class="org.hisp.dhis.reports.csreview.action.GenerateCSReviewReportResultAction">
+            <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>
+
+
+<!-- NBITS Reports Section -->        
+        <!-- ActivityPlan Reports -->
+        <action name="activePlanReportsAnalyser"
+            class="org.hisp.dhis.reports.activeplan.action.ActivePlanReportsFormAction">
+            <result name="success" type="velocity">/main.vm</result>
+            <param name="page">/dhis-web-reports/activePlanReportsForm.vm</param>
+            <param name="menu">/dhis-web-reports/menuWithTreeForActivePlan.vm</param>
+            <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/calendar/calendar.js,../dhis-web-commons/calendar/calendar-lang.js,../dhis-web-commons/calendar/calendar-setup.js,../dhis-web-commons/lists/lists.js,javascript/reports.js,javascript/hashtable.js</param>
+            <param name="stylesheets">css/StylesForTags.css</param>
+            <param name="requiredAuthorities">F_REPORT_ACTIVITYPLAN</param>
+            <interceptor-ref name="organisationUnitTreeStack"/>
+        </action>
+        <action name="generateActivePlanReport"
+            class="org.hisp.dhis.reports.activeplan.action.ActivePlanReportsResultAction">
+            <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>
+        <action name="activePlanFeedbackReportsAnalyser"
+            class="org.hisp.dhis.reports.activeplan.action.ActivePlanFeedBackFormAction">
+            <result name="success" type="velocity">/main.vm</result>
+            <param name="page">/dhis-web-reports/activePlanFeedBackForm.vm</param>
+            <param name="menu">/dhis-web-reports/menuWithTreeForActivePlan.vm</param>
+            <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/reports.js,javascript/hashtable.js</param>
+            <param name="stylesheets">css/StylesForTags.css</param>
+            <interceptor-ref name="organisationUnitTreeStack"/>
+        </action>
+        <action name="generateActivePlanFeedbackReport"
+            class="org.hisp.dhis.reports.activeplan.action.ActivePlanFeedBackResultAction">
+            <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>
+        
+        <!-- BenificiaryInfo Reports -->
+        <action name="benificiaryInfoReportsAnalyser"
+            class="org.hisp.dhis.reports.benificiaryinfo.action.BenificiaryInfoReportsFormAction">
+            <result name="success" type="velocity">/main.vm</result>
+            <param name="page">/dhis-web-reports/benificiaryInfoReportsForm.vm</param>
+            <param name="menu">/dhis-web-reports/menuWithTreeForBenificiaryInfo.vm</param>
+            <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/calendar/calendar.js,../dhis-web-commons/calendar/calendar-lang.js,../dhis-web-commons/calendar/calendar-setup.js,../dhis-web-commons/lists/lists.js,javascript/reports.js,javascript/hashtable.js</param>
+            <param name="stylesheets">css/StylesForTags.css</param>
+            <param name="requiredAuthorities">F_REPORT_BENIFICIARY_INFO</param>
+            <interceptor-ref name="organisationUnitTreeStack"/>
+        </action>
+        <action name="generateBenificiaryInfoReport"
+            class="org.hisp.dhis.reports.benificiaryinfo.action.BenificiaryInfoReportsResultAction">
+            <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>
+        
+        <!-- Portal Reports -->
+        <action name="portalReportsAnalyser"
+            class="org.hisp.dhis.reports.portal.action.PortalReportsFormAction">
+            <result name="success" type="velocity">/main.vm</result>
+            <param name="page">/dhis-web-reports/portalReportForm.vm</param>
+            <param name="menu">/dhis-web-reports/menuWithTreeForPortalReport.vm</param>
+            <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/calendar/calendar.js,../dhis-web-commons/calendar/calendar-lang.js,../dhis-web-commons/calendar/calendar-setup.js,../dhis-web-commons/lists/lists.js,javascript/reports.js,javascript/hashtable.js</param>
+            <param name="stylesheets">css/StylesForTags.css</param>
+            <param name="requiredAuthorities">F_REPORT_NBITS_PORTAL</param>
+            <interceptor-ref name="organisationUnitTreeStack"/>
+        </action>
+        <action name="generatePortalReport"
+            class="org.hisp.dhis.reports.portal.action.PortalReportsResultAction">
+            <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>
+
+        <!-- NBITS Reports -->
+        <action name="nbitsReportsAnalyser"
+            class="org.hisp.dhis.reports.nbits.action.NBITSReportFormAction">
+            <result name="success" type="velocity">/main.vm</result>
+            <param name="page">/dhis-web-reports/nbitsReportsForm.vm</param>
+            <param name="menu">/dhis-web-reports/menuWithTreeForPortalReport.vm</param>
+            <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/calendar/calendar.js,../dhis-web-commons/calendar/calendar-lang.js,../dhis-web-commons/calendar/calendar-setup.js,../dhis-web-commons/lists/lists.js,javascript/reports.js,javascript/hashtable.js</param>
+            <param name="stylesheets">css/StylesForTags.css</param>
+            <param name="requiredAuthorities">F_REPORT_NBITS_REPORTS</param>
+            <interceptor-ref name="organisationUnitTreeStack"/>
+        </action>
+        <action name="generateNBITSReport"
+            class="org.hisp.dhis.reports.nbits.action.NBITSReportResultAction">
+            <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>
+
+
 		
 		<!-- AJAX Requests -->
 		<action name="getDataElements"
@@ -671,8 +758,6 @@
 			class="org.hisp.dhis.reports.action.GetReportsAction">
 			<result name="success" type="velocity-xml">/dhis-web-reports/responseReport.vm</result>
 			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/reportManagement.js,javascript/hashtable.js</param>
-	<!--	<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/reports.js,javascript/hashtable.js</param>-->
-			<!--<interceptor-ref name="transactionStack"/>-->
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 		
@@ -682,7 +767,6 @@
 				/dhis-web-reports/responseReport.vm</result>
 			<param name="javascripts">
 				../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/reports.js,javascript/hashtable.js</param>
-			<!--<interceptor-ref name="transactionStack"/>-->
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 		
@@ -690,7 +774,6 @@
 			class="org.hisp.dhis.reports.action.GetOrgUnitGroupsAction">
 			<result name="success" type="velocity-xml">
 				/dhis-web-reports/responseOrgUnitGroup.vm</result>
-			<!--<interceptor-ref name="transactionStack"/>-->
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 		
@@ -698,12 +781,11 @@
 			class="org.hisp.dhis.reports.action.GetOrgUnitsAction">
 			<result name="success" type="velocity-xml">
 				/dhis-web-reports/responseOrgUnit.vm</result>
-			<!--<interceptor-ref name="transactionStack"/>-->
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 		
 		<!-- ReportTable -->
-		
+<!--		
 		<action name="displayManageTableForm"
 			class="org.hisp.dhis.reports.tablecreator.action.GetAllTablesAction">
 			<result name="success" type="velocity">/main.vm</result>
@@ -758,7 +840,6 @@
 			class="org.hisp.dhis.reports.tablecreator.action.GetTableAction">
 			<result name="success" type="velocity-xml">
 				/dhis-web-reports/responseTable.vm</result>
-			<!--<interceptor-ref name="transactionStack"/>-->
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 		
@@ -777,9 +858,9 @@
 				/dhis-web-reports/responseInput.vm</result>
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
-		
+-->		
 		<!-- dataset report -->
-		
+<!--		
 		<action name="dataSetReport"
 			class="org.hisp.dhis.commons.action.NoAction">
 			<result name="success" type="redirect">
@@ -912,9 +993,9 @@
 				<param name="bufferSize">1024</param>
 			</result>
 		</action>
-		
+-->		
 		<!-- pivot table -->
-		
+<!--		
 		<action name="displayPivotTableForm"
 			class="org.hisp.dhis.reports.action.NoAction">
 			<result name="success" type="velocity">/main.vm</result>
@@ -952,9 +1033,9 @@
 				/dhis-web-reports/responseIndicatorGroup.vm</result>
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
-		
+-->		
 		<!-- charts -->
-		
+<!--		
 		<action name="createChart"
 			class="org.hisp.dhis.reports.chart.action.CreateChartAction">
 			<result name="success" type="velocity-xml">
@@ -1030,69 +1111,7 @@
 				<param name="bufferSize">1024</param>
 			</result>
 		</action>
-		
-		<!-- Quarterly PhysicalOutput Reports -->
-        <action name="quarterlyPhysicalReport" 
-			class="org.hisp.dhis.reports.physical.action.PhysicalReportFormAction">
-            <result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-reports/physicalReportform.vm</param>
-            <param name="menu">/dhis-web-reports/menuWithphysicaOutputReports.vm</param>
-            <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/reportManagement.js,javascript/hashtable.js</param>
-            <param name="stylesheets">css/StylesForTags.css</param>
-			<param name="requiredAuthorities">F_REPORT_PHYSICALOP</param>
-            <interceptor-ref name="organisationUnitTreeStack"/>
-        </action>
-        <action name="generatePhysicalReport"
-			class="org.hisp.dhis.reports.physical.action.GeneratePhysicalReportResultAction">
-            <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>
-		
-		<!--Mobile Report-->
-		<action name="mobileReportAnalyser"
-			class="org.hisp.dhis.reports.mobile.action.GenerateMobileReportAnalyserFormAction">
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">
-				/dhis-web-reports/mobileReportAnalysisFront.vm</param>
-			<param name="menu">
-				/dhis-web-reports/menuWithTreeForMobileReport.vm</param>
-			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/datasetLockReport.js,javascript/reportManagement.js,javascript/hashtable.js</param>
-			<param name="stylesheets">css/StylesForTags.css</param>
-			<interceptor-ref name="organisationUnitTreeStack"/>
-		</action>
-		
-		<action name="generateMobileReport"
-			class="org.hisp.dhis.reports.mobile.action.GenerateMobileReportAnalyserResultAction">
-			<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>S </result>
-        </action>
-		
-		<!-- CS Review Reports Start -->
-        <action name="csReviewReportForm"
-            class="org.hisp.dhis.reports.csreview.action.GenerateCSReviewReportFormAction">
-            <result name="success" type="velocity">/main.vm</result>
-            <param name="page">/dhis-web-reports/csReviewReportFront.vm</param>
-            <param name="menu">/dhis-web-reports/menuWithTreeForCSReviewReport.vm</param>
-            <param name="javascripts">../dhis-web-commons/calendar/calendar.js,../dhis-web-commons/calendar/calendar-lang.js,../dhis-web-commons/calendar/calendar-setup.js,../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/util/lists.js,javascript/reportManagement.js,javascript/hashtable.js,../dhis-web-commons/util/validate/jquery.validate.js,../dhis-web-commons/util/jquery.metadata.js,../dhis-web-commons/util/validate/additional-methods.js,../dhis-web-commons/util/validate/messages_locale.js</param>
-            <param name="stylesheets">css/StylesForTags.css</param>
-			<param name="requiredAuthorities">F_REPORT_CSREVIEW</param>
-            <interceptor-ref name="organisationUnitTreeStack"/>
-        </action>
-        <action name="generateCSReviewReportResult" class="org.hisp.dhis.reports.csreview.action.GenerateCSReviewReportResultAction">
-            <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>
+-->		
 		
 	</package>
 </struts>

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/activePlanReportsForm.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/activePlanReportsForm.vm	2011-01-13 04:53:40 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/activePlanReportsForm.vm	2011-03-01 08:37:19 +0000
@@ -36,13 +36,13 @@
 
 </script>
 
-<h1>NBITS Report Analyser</h1><hr /><br />
+<h3>NBITS ActivityPlan</h3><hr /><br />
 
 <form id="reportForm" name="reportForm" action="generateActivePlanReport.action" method="post" onsubmit="return formValidations()" target="_blank">
 	<table align="center" style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="730" border=0>
 		<tr>
 			<td class="NormalB">
-				Reports :<br />
+				ActivityPlan Reports :<br />
                 <select id="reportList" name="reportList" style="width:200px">
 				#foreach($report in $reportList)
 					<option value="$report.id">$report.name</option>

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menu.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menu.vm	2011-01-11 12:10:34 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menu.vm	2011-03-01 08:37:19 +0000
@@ -68,11 +68,14 @@
 				<li><a href = "benificiaryInfoReportsAnalyser.action">NBITS Benificiary Info</a></li>
 			#end
 			#if( $auth.hasAccess( "dhis-web-reports", "activePlanReportsAnalyser") )
-				<li><a href = "activePlanReportsAnalyser.action">NBITS Reports</a></li>
+				<li><a href = "activePlanReportsAnalyser.action">NBITS ActivityPlan</a></li>
 			#end
 			#if( $auth.hasAccess( "dhis-web-reports", "portalReportsAnalyser") )
 				<li><a href = "portalReportsAnalyser.action">NBITS Portal Reports</a></li>
 			#end
+            #if( $auth.hasAccess( "dhis-web-reports", "nbitsReportsAnalyser") )
+                <li><a href = "nbitsReportsAnalyser.action">NBITS Reports</a></li>
+            #end
 		</ul>
 	</ul>
 #end
\ No newline at end of file

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForActivePlan.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForActivePlan.vm	2011-01-10 07:58:36 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForActivePlan.vm	2011-03-01 08:37:19 +0000
@@ -1,21 +1,17 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>NameBased Reports</li>
     <ul>
     	<li>
-            NBITS Reports
+            NBITS ActivityPlan
         </li>
     </ul>
 </ul>
 
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-	<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/orgunittreesearch.vm" )
 
-<!-- The script that registeres selctions in the orgunit tree -->
 <script type="text/javascript">
 
     function orgUnitHasBeenSelected( orgUnitIds )
@@ -30,7 +26,6 @@
 
         if( orgUnitIds != null )
         {
-            //getOUDetails(orgUnitIds);
             getSelectedOrgUnit( orgUnitIds );
         }
     }

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForAdvanced.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForAdvanced.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForAdvanced.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,5 @@
-<h2>Report Analyser</h2>
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -7,33 +8,27 @@
         </li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <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" )
 
-<!-- The script that registeres selctions in the orgunit tree -->
 <script type="text/javascript">
 
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-
-    document.reportForm.ouIDTB.value = orgUnitIds;
-	
-	if(orgUnitIds == null || orgUnitIds == "" )
-	{
-		return;
-	}
-	
-    if(orgUnitIds !=null)
-	   {
-	     getOUDetails(orgUnitIds);
-	   }
-	
-	}
-
-selection.setListenerFunction( orgUnitHasBeenSelected );
+	function orgUnitHasBeenSelected( orgUnitIds )
+	{    
+	
+		document.reportForm.ouIDTB.value = orgUnitIds;
+ 
+		if(orgUnitIds == null || orgUnitIds == "" )
+		{
+			return;
+		}
+		if(orgUnitIds !=null)
+		{
+			getOUDetails(orgUnitIds);
+		}
+	}
+	
+	selection.setListenerFunction( orgUnitHasBeenSelected );
 
 </script>
 

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForAggregationReport.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForAggregationReport.vm	2010-08-28 10:15:38 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForAggregationReport.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,5 @@
-<h2>Report Analyser</h2>
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -7,28 +8,24 @@
         </li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <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" )
-
-<!-- The script that registeres selctions in the orgunit tree -->
+
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )
+
 <script type="text/javascript">
 
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-    document.reportForm.ouIDTB.value = orgUnitIds;
-    
-    reportTypeName = document.reportForm.reportTypeNameTB.value;
-
-    if(orgUnitIds != null && orgUnitIds != "" )
-    {
-        getReports(orgUnitIds, reportTypeName)      
-    }
-}
-
-selection.setListenerFunction( orgUnitHasBeenSelected );
+	function orgUnitHasBeenSelected( orgUnitIds )
+	{    
+		document.reportForm.ouIDTB.value = orgUnitIds;
+		
+		reportTypeName = document.reportForm.reportTypeNameTB.value;
+	
+		if(orgUnitIds != null && orgUnitIds != "" )
+		{
+			getReports( orgUnitIds, reportTypeName )      
+		}
+	}
+	
+	selection.setListenerFunction( orgUnitHasBeenSelected );
 
 </script>
 

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForAutoReport.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForAutoReport.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForAutoReport.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,6 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -7,28 +9,23 @@
         </li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <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" )
-
-<!-- The script that registeres selctions in the orgunit tree -->
+
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )
+
 <script type="text/javascript">
 
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-    document.reportForm.ouIDTB.value = orgUnitIds;
+	function orgUnitHasBeenSelected( orgUnitIds )
+	{    
+		document.reportForm.ouIDTB.value = orgUnitIds;
+		
+		reportListFileName = document.reportForm.reportListFileNameTB.value;
 	
-	reportListFileName = document.reportForm.reportListFileNameTB.value;
-
-	if(orgUnitIds != null && orgUnitIds != "" )
-	{
-		getReports(orgUnitIds, reportListFileName)		
+		if(orgUnitIds != null && orgUnitIds != "" )
+		{
+			getReports(orgUnitIds, reportListFileName)		
+		}
 	}
-}
-
-selection.setListenerFunction( orgUnitHasBeenSelected );
+	
+	selection.setListenerFunction( orgUnitHasBeenSelected );
 
 </script>
-

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForBenificiaryInfo.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForBenificiaryInfo.vm	2011-01-10 07:58:36 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForBenificiaryInfo.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,6 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>NameBased Reports</li>
     <ul>
@@ -8,14 +10,8 @@
     </ul>
 </ul>
 
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-	<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/orgunittreesearch.vm" )
 
-<!-- The script that registeres selctions in the orgunit tree -->
 <script type="text/javascript">
 
 	function orgUnitHasBeenSelected( orgUnitIds )
@@ -30,7 +26,6 @@
 
 		if( orgUnitIds != null )
 		{
-			//getOUDetails(orgUnitIds);
 			getSelectedOrgUnit( orgUnitIds );
 		}
 	}
@@ -38,4 +33,3 @@
 	selection.setListenerFunction( orgUnitHasBeenSelected );
 
 </script>
-

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForCSReviewReport.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForCSReviewReport.vm	2010-09-13 10:03:14 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForCSReviewReport.vm	2011-03-01 08:37:19 +0000
@@ -1,44 +1,11 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
-      <li>
+		<li>
             CS Review Reports
         </li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <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" )
--->
-<!-- The script that registeres selctions in the orgunit tree -->
-<script type="text/javascript">
-/*
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-
-    document.reportForm.ouIDTB.value = orgUnitIds;
-
-    reportTypeName = document.reportForm.reportTypeNameTB.value;
-  
-  if(orgUnitIds == null || orgUnitIds == "" )
-  {
-    return;
-  }
-  
-    if(orgUnitIds !=null)
-     {
-       //getOUDetailsForOuWiseProgressReport(orgUnitIds);
-
-      getReports(orgUnitIds, reportTypeName );
-     }
-  
-  }
-
-selection.setListenerFunction( orgUnitHasBeenSelected );
-*/
-</script>
-

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForDataSetLockReports.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForDataSetLockReports.vm	2011-01-05 05:31:43 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForDataSetLockReports.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,6 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -8,14 +10,8 @@
     </ul>
 </ul>
 
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-	<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/orgunittreesearch.vm" )
 
-<!-- The script that registeres selctions in the orgunit tree -->
 <script type="text/javascript">
 	
 	function orgUnitHasBeenSelected( orgUnitIds )

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForDatasetReport.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForDatasetReport.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForDatasetReport.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,5 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -7,28 +8,24 @@
         </li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <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" )
 
-<!-- The script that registeres selctions in the orgunit tree -->
 <script type="text/javascript">
 
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-    document.reportForm.ouIDTB.value = orgUnitIds;
+	function orgUnitHasBeenSelected( orgUnitIds )
+	{    
+		document.reportForm.ouIDTB.value = orgUnitIds;
+		
+		reportListFileName = document.reportForm.reportListFileNameTB.value;
 	
-	reportListFileName = document.reportForm.reportListFileNameTB.value;
-
-	if(orgUnitIds != null && orgUnitIds != "" )
-	{
-		getReports(orgUnitIds, reportListFileName)		
+		if(orgUnitIds != null && orgUnitIds != "" )
+		{
+			getReports(orgUnitIds, reportListFileName)		
+		}
 	}
-}
-
-selection.setListenerFunction( orgUnitHasBeenSelected );
+	
+	selection.setListenerFunction( orgUnitHasBeenSelected );
 
 </script>
 

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForFeedback.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForFeedback.vm	2011-01-05 05:31:43 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForFeedback.vm	2011-03-01 08:37:19 +0000
@@ -1,5 +1,6 @@
 
-<h2>Report Analyser</h2>
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -7,13 +8,8 @@
     </ul>
 </ul>
 
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-	<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" )
-
-<!-- The script that registeres selctions in the orgunit tree -->
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )
+
 <script type="text/javascript">
 
 	function orgUnitHasBeenSelected( orgUnitIds )

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForGOIReports.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForGOIReports.vm	2010-08-28 10:15:38 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForGOIReports.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,6 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -7,28 +9,23 @@
         </li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <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" )
-
-<!-- The script that registeres selctions in the orgunit tree -->
+
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )
+
 <script type="text/javascript">
 
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-    document.reportForm.ouIDTB.value = orgUnitIds;
+	function orgUnitHasBeenSelected( orgUnitIds )
+	{    
+		document.reportForm.ouIDTB.value = orgUnitIds;
+		
+		reportTypeName = document.reportForm.reportTypeNameTB.value;
 	
-	reportTypeName = document.reportForm.reportTypeNameTB.value;
-
-	if(orgUnitIds != null && orgUnitIds != "" )
-	{
-		getReports(orgUnitIds, reportTypeName)		
+		if(orgUnitIds != null && orgUnitIds != "" )
+		{
+			getReports(orgUnitIds, reportTypeName)		
+		}
 	}
-}
-
-selection.setListenerFunction( orgUnitHasBeenSelected );
+	
+	selection.setListenerFunction( orgUnitHasBeenSelected );
 
 </script>
-

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForLineListingReport.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForLineListingReport.vm	2011-01-08 05:58:26 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForLineListingReport.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,6 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -8,13 +10,8 @@
     </ul>
 </ul>
 
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-	<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" )
-
-<!-- The script that registeres selctions in the orgunit tree -->
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )
+
 <script type="text/javascript">
 
 	function orgUnitHasBeenSelected( orgUnitIds )

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForMalaryaReports.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForMalaryaReports.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForMalaryaReports.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,6 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -7,33 +9,27 @@
         </li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <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" )
-
-<!-- The script that registeres selctions in the orgunit tree -->
+
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )
+
 <script type="text/javascript">
 
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-
-    document.reportForm.ouIDTB.value = orgUnitIds;
-    
-    if(orgUnitIds == null || orgUnitIds == "" )
-    {
-        return;
-    }
-    
-    if(orgUnitIds !=null)
-       {
-         getOUDetails(orgUnitIds);
-       }
-    
-    }
-
-selection.setListenerFunction( orgUnitHasBeenSelected );
+	function orgUnitHasBeenSelected( orgUnitIds )
+	{    
+	
+		document.reportForm.ouIDTB.value = orgUnitIds;
+		
+		if(orgUnitIds == null || orgUnitIds == "" )
+		{
+			return;
+		}
+		
+		if(orgUnitIds !=null)
+		{
+			getOUDetails(orgUnitIds);
+		}
+	}
+	
+	selection.setListenerFunction( orgUnitHasBeenSelected );
 
 </script>
-

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForMobileReport.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForMobileReport.vm	2011-01-11 12:10:34 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForMobileReport.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,6 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -7,26 +9,21 @@
         </li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <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/orgunittreesearch.vm" )
 
-<!-- The script that registeres selctions in the orgunit tree -->
 <script type="text/javascript">
 
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-    document.reportForm.ouIDTB.value = orgUnitIds;
-    
-    if(orgUnitIds != null && orgUnitIds != "" )
+	function orgUnitHasBeenSelected( orgUnitIds )
 	{
-		getSelectedOrgUnit( orgUnitIds );
+		document.reportForm.ouIDTB.value = orgUnitIds;
+
+		if(orgUnitIds != null && orgUnitIds != "" )
+		{
+			getSelectedOrgUnit( orgUnitIds );
+		}
 	}
-}
 
-selection.setListenerFunction( orgUnitHasBeenSelected );
+	selection.setListenerFunction( orgUnitHasBeenSelected );
 
 </script>
-

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForNLEPReports.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForNLEPReports.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForNLEPReports.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,6 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -7,33 +9,25 @@
         </li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <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" )
 
-<!-- The script that registeres selctions in the orgunit tree -->
 <script type="text/javascript">
 
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-
-    document.reportForm.ouIDTB.value = orgUnitIds;
-    
-    if(orgUnitIds == null || orgUnitIds == "" )
-    {
-        return;
-    }
-    
-    if(orgUnitIds !=null)
-       {
-         getOUDetails(orgUnitIds);
-       }
-    
-    }
-
-selection.setListenerFunction( orgUnitHasBeenSelected );
+	function orgUnitHasBeenSelected( orgUnitIds )
+	{    
+		document.reportForm.ouIDTB.value = orgUnitIds;
+		
+		if(orgUnitIds == null || orgUnitIds == "" )
+		{
+			return;
+		}
+		if(orgUnitIds !=null)
+		{
+			 getOUDetails(orgUnitIds);
+		}		
+	}
+	
+	selection.setListenerFunction( orgUnitHasBeenSelected );
 
 </script>
-

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForOuWiseProgress.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForOuWiseProgress.vm	2010-12-31 07:16:18 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForOuWiseProgress.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,6 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -8,13 +10,8 @@
     </ul>
 </ul>
 
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-	<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" )
-
-<!-- The script that registeres selctions in the orgunit tree -->
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )
+
 <script type="text/javascript">
 
 	function orgUnitHasBeenSelected( orgUnitIds )
@@ -36,4 +33,3 @@
 	selection.setListenerFunction( orgUnitHasBeenSelected );
 
 </script>
-

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForPeriodWiseProgressReport.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForPeriodWiseProgressReport.vm	2010-08-28 10:15:38 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForPeriodWiseProgressReport.vm	2011-03-01 08:37:19 +0000
@@ -1,32 +1,29 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
         <li>Periodwise Progress Reports</li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <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" )
-
-<!-- The script that registeres selctions in the orgunit tree -->
+
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )
+
 <script type="text/javascript">
 
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-    document.reportForm.ouIDTB.value = orgUnitIds;
-    
-    reportTypeName = document.reportForm.reportTypeNameTB.value;
-
-    if(orgUnitIds != null && orgUnitIds != "" )
-    {
-        getReports(orgUnitIds, reportTypeName)      
-    }
-}
-
-selection.setListenerFunction( orgUnitHasBeenSelected );
-
+	function orgUnitHasBeenSelected( orgUnitIds )
+	{    
+		document.reportForm.ouIDTB.value = orgUnitIds;
+		
+		reportTypeName = document.reportForm.reportTypeNameTB.value;
+	
+		if(orgUnitIds != null && orgUnitIds != "" )
+		{
+			getReports(orgUnitIds, reportTypeName)      
+		}
+	}
+	
+	selection.setListenerFunction( orgUnitHasBeenSelected );
+	
 </script>
-

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForPortalReport.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForPortalReport.vm	2011-01-10 07:58:36 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForPortalReport.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,6 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>NameBased Reports</li>
     <ul>
@@ -8,14 +10,8 @@
     </ul>
 </ul>
 
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-	<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/orgunittreesearch.vm" )
 
-<!-- The script that registeres selctions in the orgunit tree -->
 <script type="text/javascript">
 
     function orgUnitHasBeenSelected( orgUnitIds )
@@ -30,7 +26,6 @@
 
         if( orgUnitIds != null )
         {
-            //getOUDetails(orgUnitIds);
             getSelectedOrgUnit( orgUnitIds );
         }
     }

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForRankingReport.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForRankingReport.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForRankingReport.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,6 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -7,33 +9,28 @@
         </li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <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" )
-
-<!-- The script that registeres selctions in the orgunit tree -->
+
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )
+
 <script type="text/javascript">
 
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-
-    document.reportForm.ouIDTB.value = orgUnitIds;
-	
-	if(orgUnitIds == null || orgUnitIds == "" )
-	{
-		return;
-	}
-	
-    if(orgUnitIds !=null)
-	   {
-	     getOUDetails(orgUnitIds);
-	   }
-	
-	}
-
-selection.setListenerFunction( orgUnitHasBeenSelected );
+	function orgUnitHasBeenSelected( orgUnitIds )
+	{    
+	
+		document.reportForm.ouIDTB.value = orgUnitIds;
+		
+		if(orgUnitIds == null || orgUnitIds == "" )
+		{
+			return;
+		}
+		
+		if(orgUnitIds !=null)
+		{
+			 getOUDetails(orgUnitIds);
+		}
+	}
+	
+	selection.setListenerFunction( orgUnitHasBeenSelected );
 
 </script>
 

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForRoutineReport.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForRoutineReport.vm	2011-01-05 05:31:43 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForRoutineReport.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,6 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -7,13 +9,9 @@
         </li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-	<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/orgunittreesearch.vm" )
 
-<!-- The script that registeres selctions in the orgunit tree -->
 <script type="text/javascript">
 
 	function orgUnitHasBeenSelected( orgUnitIds )
@@ -31,4 +29,3 @@
 	selection.setListenerFunction( orgUnitHasBeenSelected );
 
 </script>
-

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForTwentyPoint.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForTwentyPoint.vm	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithTreeForTwentyPoint.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,6 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
     <li>Report Analysis</li>
     <ul>
@@ -7,33 +9,27 @@
         </li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <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" )
-
-<!-- The script that registeres selctions in the orgunit tree -->
+
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )
+
 <script type="text/javascript">
 
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-
-    document.reportForm.ouIDTB.value = orgUnitIds;
-	
-	if(orgUnitIds == null || orgUnitIds == "" )
-	{
-		return;
-	}
-	
-    if(orgUnitIds !=null)
-	   {
-	     getOUDetails(orgUnitIds);
-	   }
-	
-	}
-
-selection.setListenerFunction( orgUnitHasBeenSelected );
+	function orgUnitHasBeenSelected( orgUnitIds )
+	{    
+	
+		document.reportForm.ouIDTB.value = orgUnitIds;
+		
+		if(orgUnitIds == null || orgUnitIds == "" )
+		{
+			return;
+		}
+		
+		if(orgUnitIds !=null)
+		{
+			getOUDetails(orgUnitIds);
+		}
+	}
+	
+	selection.setListenerFunction( orgUnitHasBeenSelected );
 
 </script>
-

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithmetaDataReports.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithmetaDataReports.vm	2010-08-30 07:07:13 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithmetaDataReports.vm	2011-03-01 08:37:19 +0000
@@ -1,4 +1,5 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
 
 <ul>
     <li>Report Analysis</li>
@@ -8,30 +9,3 @@
         </li>
     </ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <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" )
---> 
-<!-- The script that registeres selctions in the orgunit tree -->
-
-<script type="text/javascript">
-
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-    document.reportForm.ouIDTB.value = orgUnitIds;
-    
-    reportListFileName = document.reportForm.reportListFileNameTB.value;
-
-    if(orgUnitIds != null && orgUnitIds != "" )
-    {
-        getReports(orgUnitIds, reportListFileName)      
-    }
-}
-
-selection.setListenerFunction( orgUnitHasBeenSelected );
-
-</script>

=== modified file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithphysicaOutputReports.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithphysicaOutputReports.vm	2010-09-13 10:03:14 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/menuWithphysicaOutputReports.vm	2011-03-01 08:37:19 +0000
@@ -1,36 +1,11 @@
-<h2>Report Analyser</h2>
+
+<a href="index.action"><h2>Report Analyser</h2></a>
+
 <ul>
-    <li>Report Analysis</li>
+	<li>Report Analysis</li>
     <ul>
-      <li>
-            Quarterly Physical Output Reports 
-        </li>
-    </ul>
+		<li>
+			Quarterly Physical Output Reports 
+		</li>
+	</ul>
 </ul>
-<div style=" float:right; font-size:6pt; cursor:pointer; margin-top:-15px; ">
-        <a href="index.action">
-          <img src="images/goback.png" width="25" height="25" alt="$i18n.getString( "go_back" )"></a>
-</div>
-        <!--
-#parse( "/dhis-web-commons/ouwt/orgunittree.vm" )
--->
-<!-- The script that registeres selctions in the orgunit tree -->
-      
-<script type="text/javascript">
-
-function orgUnitHasBeenSelected( orgUnitIds )
-{    
-    document.reportForm.ouIDTB.value = orgUnitIds;
-  
-  reportListFileName = document.reportForm.reportListFileNameTB.value;
-
-  if(orgUnitIds != null && orgUnitIds != "" )
-  {
-    getReports(orgUnitIds, reportListFileName)    
-  }
-}
-
-selection.setListenerFunction( orgUnitHasBeenSelected );
-
-</script>
-

=== added file 'local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/nbitsReportsForm.vm'
--- local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/nbitsReportsForm.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-reports-national/src/main/webapp/dhis-web-reports/nbitsReportsForm.vm	2011-03-01 08:37:19 +0000
@@ -0,0 +1,96 @@
+
+<script>
+
+    function showOrHideDates()
+    {
+        var includePeriodChecked = document.getElementById( "includePeriod" ).checked;
+
+        if( includePeriodChecked == true )
+        {
+            jQuery("#periodTR").show();
+        }
+        else
+        {
+            jQuery("#periodTR").hide();
+        }
+    }
+
+    function formValidations()
+    {
+        var includePeriodChecked = document.getElementById( "includePeriod" ).checked;
+        var programList = document.getElementById( "programList" );
+        var orgunitIdValue = document.reportForm.ouIDTB.value;
+        var startDateValue = document.reportForm.startDate.value;
+        var endDateValue = document.reportForm.endDate.value;
+
+        if( programList.selectedIndex < 0 || programList.options[programList.selectedIndex].text == null ) { alert("Please Select Report"); return false; }
+        else if( orgunitIdValue == null || orgunitIdValue == "" ) { alert("Please Select OrganisationUnit"); return false; }
+        else if( includePeriodChecked == true )
+        {
+            if( startDateValue == null || startDateValue== "" || endDateValue == null || endDateValue=="" ) { alert("Please Select Start Date And End Date"); return false; }
+            else if( startDateValue > endDateValue ) { alert("Start Date Is Greater Than End Date"); return false; }
+        }
+
+        return true;
+    }
+
+</script>
+
+<h3>NBITS Report Analyser</h3>
+<hr /><br />
+
+<form id="reportForm" name="reportForm" action="generateNBITSReport.action" method="post" onsubmit="return formValidations()" target="_blank">
+    <table align="center" style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="730" border=0>
+        <tr>
+            <td class="NormalB">
+                Program List :<br />
+                <select id="programList" name="programList" style="width:200px">
+                #foreach($program in $programList)
+                    <option value="$program.id">$program.name</option>
+                #end
+                </select>
+            </td>
+            <td class="NormalB">
+                OrganisationUnit : <br />
+                <input type="text" name="ouNameTB" id="ouNameTB" style="width:175px" disabled = "disabled">
+            </td>
+        </tr>
+        <tr>
+            <td>&nbsp;</td>
+            <td>&nbsp;</td>
+        </tr>
+        <tr id="periodTR">
+            <td class="NormalB">
+                <label for="startDate" id="lblStartDate">$i18n.getString( 'start_date' ) ($i18n.getString( "format.date.label" ))</label><br/>
+                <input type="text" id="startDate" name="startDate" style="width:175px">
+            </td>
+            <td class="NormalB">
+                <label for="endDate" id="lblEndDate">$i18n.getString( 'end_date' ) ($i18n.getString( "format.date.label" ))</label><br />
+                <input type="text" id="endDate" name="endDate" style="width:175px">
+            </td>
+        </tr>
+        <tr>
+            <td>&nbsp;</td>
+            <td>&nbsp;</td>
+        </tr>
+        <tr>
+            <td>&nbsp;</td>
+            <td>&nbsp;</td>
+        </tr>
+        <tr>
+            <td>&nbsp;</td>
+            <td>
+                <input type="checkbox" name="includePeriod" onChange="return showOrHideDates()" id="includePeriod" checked>Report With Specified Period
+                <br/><br/>
+                <input type="submit" name="generate" value='Generate Report' #if( $!programList.size() == 0 ) disabled="disabled" #end>
+                <input type="hidden" name="ouIDTB" id="ouIDTB" />
+            </td>
+        </tr>
+    </table>
+</form>
+
+<script type="text/javascript">
+    jQuery( function(){
+            datePickerInRange( "startDate", "endDate", false, false );
+    });
+</script>