← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4092: Changed ExcelTemp file path to DHIS2_HOME\temp from ra\output in India Report Module

 

------------------------------------------------------------
revno: 4092
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-07-07 16:26:12 +0530
message:
  Changed ExcelTemp file path to DHIS2_HOME\temp from ra\output in India Report Module
modified:
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/TwentyPoint/action/GenerateTwentyPointReportsResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/advanced/action/GenerateAdvancedReportResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/aggregation/action/GenerateAggregationReportAnalyserResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/BenificiaryInfoReportsResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/csreview/action/GenerateCSReviewReportResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/datasetlock/action/GenerateDataSetLockReportResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ed/action/EDReportResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/feedback/action/GenerateFeedbackReportAnalyserResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GenerateGradingReportResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GenerateImmChildGradingReportAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GenerateSelChildGradingReportAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GradingAbstractionResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/leprosy/action/LeprosyReportResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/linelisting/action/GenerateLinelistingReportAnalyserResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/linelisting/action/GenerateLinelistingWebPortalReportAnalyserResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/malarya/action/GenerateMalaryaReportResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/meta/action/GenerateMetaDataReportResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/mobile/action/GenerateMobileReportAnalyserResultAction.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/java/org/hisp/dhis/reports/orgunitgroupsetreport/action/GenerateOrgunitGroupsetReportsResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ouwiseprogress/action/GenerateOuWiseProgressReportResultAction.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/physical/action/GeneratePhysicalReportResultAction.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/ranking/action/GenerateRankingReportResultAction.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/java/org/hisp/dhis/reports/upward/action/GenerateUpwardReportAnalyserResultAction.java


--
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/TwentyPoint/action/GenerateTwentyPointReportsResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/TwentyPoint/action/GenerateTwentyPointReportsResultAction.java	2010-12-29 16:17:28 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/TwentyPoint/action/GenerateTwentyPointReportsResultAction.java	2011-07-07 10:56:12 +0000
@@ -36,6 +36,7 @@
 import org.amplecode.quick.StatementManager;
 import org.apache.velocity.tools.generic.MathTool;
 import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -396,9 +397,17 @@
 
         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
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator  + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
 
+        
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
 
         WritableWorkbook outputReportWorkbook = Workbook

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsResultAction.java	2011-04-29 13:45:23 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsResultAction.java	2011-07-07 10:56:12 +0000
@@ -33,7 +33,6 @@
 import java.io.InputStream;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Calendar;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
@@ -60,6 +59,7 @@
 
 import org.amplecode.quick.StatementManager;
 import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementService;
@@ -423,8 +423,16 @@
         */
         
         inputTemplatePath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "template" + File.separator + reportFileNameTB;
-        outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
 
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         //generatFeedbackReport();
         generateActivityPlanReport();
 

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/advanced/action/GenerateAdvancedReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/advanced/action/GenerateAdvancedReportResultAction.java	2010-08-28 10:15:38 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/advanced/action/GenerateAdvancedReportResultAction.java	2011-07-07 10:56:12 +0000
@@ -36,6 +36,7 @@
 import org.amplecode.quick.StatementManager;
 import org.apache.velocity.tools.generic.MathTool;
 import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -363,8 +364,16 @@
 
         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
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator  + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         
         //System.out.println("RA FOLDER IS : \t" + raFolderName);
         

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/aggregation/action/GenerateAggregationReportAnalyserResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/aggregation/action/GenerateAggregationReportAnalyserResultAction.java	2011-05-18 11:56:37 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/aggregation/action/GenerateAggregationReportAnalyserResultAction.java	2011-07-07 10:56:12 +0000
@@ -34,6 +34,7 @@
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -206,8 +207,16 @@
         String parentUnit = "";
 
         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 + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
-
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         if( reportModelTB.equalsIgnoreCase( "DYNAMIC-ORGUNIT" ) )
         {
             OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit( ouIDTB );

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/BenificiaryInfoReportsResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/BenificiaryInfoReportsResultAction.java	2011-01-05 05:31:43 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/BenificiaryInfoReportsResultAction.java	2011-07-07 10:56:12 +0000
@@ -36,6 +36,7 @@
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -345,9 +346,16 @@
         }
         inputTemplatePath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "template"
             + File.separator + reportFileNameTB;
-        outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output"
-            + File.separator + UUID.randomUUID().toString() + ".xls";
-
+        //outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output"  + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         generatFeedbackReport();
         statementManager.destroy();
 

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/csreview/action/GenerateCSReviewReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/csreview/action/GenerateCSReviewReportResultAction.java	2011-05-18 11:56:37 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/csreview/action/GenerateCSReviewReportResultAction.java	2011-07-07 10:56:12 +0000
@@ -34,6 +34,7 @@
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -243,8 +244,17 @@
 
         // Getting Exel Template
         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 + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
-
+       // String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+
+        
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ), templateWorkbook );
 

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/datasetlock/action/GenerateDataSetLockReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/datasetlock/action/GenerateDataSetLockReportResultAction.java	2011-04-27 17:15:13 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/datasetlock/action/GenerateDataSetLockReportResultAction.java	2011-07-07 10:56:12 +0000
@@ -20,9 +20,9 @@
 import jxl.write.Number;
 import jxl.write.WritableCellFormat;
 import jxl.write.WritableSheet;
-import jxl.write.WritableWorkbook; //import jxl.write.WriteException;
-//import jxl.write.biff.RowsExceededException;
+import jxl.write.WritableWorkbook;
 
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.datalock.DataSetLock;
 import org.hisp.dhis.datalock.DataSetLockService;
 import org.hisp.dhis.dataset.DataSet;
@@ -172,8 +172,16 @@
         dataSet = dataSetService.getDataSet( dataSets );
         dSetSource = dataSet.getSources();
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
         sheet0 = outputReportWorkbook.createSheet( "DataSetLockedReport", 0 );
         // Cell Format

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ed/action/EDReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ed/action/EDReportResultAction.java	2011-05-27 11:25:15 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ed/action/EDReportResultAction.java	2011-07-07 10:56:12 +0000
@@ -35,6 +35,7 @@
 
 import org.amplecode.quick.StatementManager;
 import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
@@ -170,7 +171,15 @@
         raFolderName = reportService.getRAFolderName();
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "MMM-yy" );
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
 
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "EDReport", 0 );

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/feedback/action/GenerateFeedbackReportAnalyserResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/feedback/action/GenerateFeedbackReportAnalyserResultAction.java	2011-04-15 11:39:32 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/feedback/action/GenerateFeedbackReportAnalyserResultAction.java	2011-07-07 10:56:12 +0000
@@ -32,6 +32,7 @@
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -240,7 +241,17 @@
         System.out.println( selOrgUnit.getName()+ " : " + selReportObj.getName()+" : Report Generation Start Time is : " + new Date() );
 
         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 + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+
+        
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
 
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ), templateWorkbook );

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GenerateGradingReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GenerateGradingReportResultAction.java	2010-07-13 09:28:43 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GenerateGradingReportResultAction.java	2011-07-07 10:56:12 +0000
@@ -40,6 +40,7 @@
 import org.amplecode.quick.StatementManager;
 import org.apache.velocity.tools.generic.MathTool;
 import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -346,8 +347,17 @@
 
         String inputTemplatePath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "template" + File.separator + "Grading.xls";
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
 
+        
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
 
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ), templateWorkbook );

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GenerateImmChildGradingReportAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GenerateImmChildGradingReportAction.java	2010-07-13 09:28:43 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GenerateImmChildGradingReportAction.java	2011-07-07 10:56:12 +0000
@@ -38,6 +38,7 @@
 import org.amplecode.quick.StatementManager;
 import org.apache.velocity.tools.generic.MathTool;
 import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -329,8 +330,17 @@
 
         String inputTemplatePath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "template" + File.separator + "Grading.xls";
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName +  File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
-
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName +  File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+
+        
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
 
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ), templateWorkbook );

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GenerateSelChildGradingReportAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GenerateSelChildGradingReportAction.java	2010-12-29 16:17:28 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GenerateSelChildGradingReportAction.java	2011-07-07 10:56:12 +0000
@@ -37,6 +37,7 @@
 import org.amplecode.quick.StatementManager;
 import org.apache.velocity.tools.generic.MathTool;
 import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -328,7 +329,15 @@
 
         String inputTemplatePath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "template" + File.separator + "Grading.xls";
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
 
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
 

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GradingAbstractionResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GradingAbstractionResultAction.java	2010-12-29 16:17:28 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/grading/action/GradingAbstractionResultAction.java	2011-07-07 10:56:12 +0000
@@ -39,6 +39,7 @@
 import org.amplecode.quick.StatementManager;
 import org.apache.velocity.tools.generic.MathTool;
 import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -354,8 +355,17 @@
         rowList = new ArrayList<Integer>();
         colList = new ArrayList<Integer>();
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
 
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ));
                                     
         // OrgUnit Related Info

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/leprosy/action/LeprosyReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/leprosy/action/LeprosyReportResultAction.java	2010-07-13 09:28:43 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/leprosy/action/LeprosyReportResultAction.java	2011-07-07 10:56:12 +0000
@@ -37,6 +37,7 @@
 import org.amplecode.quick.StatementManager;
 import org.apache.velocity.tools.generic.MathTool;
 import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -343,8 +344,16 @@
 
         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
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+       // String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+
         
         //System.out.println("RA FOLDER IS : \t" + raFolderName);
         

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/linelisting/action/GenerateLinelistingReportAnalyserResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/linelisting/action/GenerateLinelistingReportAnalyserResultAction.java	2010-09-24 06:24:45 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/linelisting/action/GenerateLinelistingReportAnalyserResultAction.java	2011-07-07 10:56:12 +0000
@@ -39,6 +39,7 @@
 import org.amplecode.quick.StatementManager;
 import org.apache.velocity.tools.generic.MathTool;
 import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -430,8 +431,18 @@
 
         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
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator  + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+       
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+
+        
+        
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
 
         WritableWorkbook outputReportWorkbook = Workbook

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/linelisting/action/GenerateLinelistingWebPortalReportAnalyserResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/linelisting/action/GenerateLinelistingWebPortalReportAnalyserResultAction.java	2011-06-27 07:31:04 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/linelisting/action/GenerateLinelistingWebPortalReportAnalyserResultAction.java	2011-07-07 10:56:12 +0000
@@ -37,6 +37,7 @@
 
 import org.amplecode.quick.StatementManager;
 import org.apache.velocity.tools.generic.MathTool;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -55,9 +56,10 @@
 
 import com.opensymphony.xwork2.Action;
 
-public class GenerateLinelistingWebPortalReportAnalyserResultAction implements Action
+public class GenerateLinelistingWebPortalReportAnalyserResultAction
+    implements Action
 {
-   // private static final String NULL_REPLACEMENT = "0";
+    // private static final String NULL_REPLACEMENT = "0";
 
     // -------------------------------------------------------------------------
     // Dependencies
@@ -68,14 +70,13 @@
     {
         this.statementManager = statementManager;
     }
-/*
-    private DataSetService dataSetService;
 
-    public void setDataSetService( DataSetService dataSetService )
-    {
-        this.dataSetService = dataSetService;
-    }
-*/
+    /*
+     * private DataSetService dataSetService;
+     * 
+     * public void setDataSetService( DataSetService dataSetService ) {
+     * this.dataSetService = dataSetService; }
+     */
     private ReportService reportService;
 
     public void setReportService( ReportService reportService )
@@ -108,46 +109,40 @@
     {
         return organisationUnitService;
     }
-/*
-    private AggregationService aggregationService;
-
-    public void setAggregationService( AggregationService aggregationService )
-    {
-        this.aggregationService = aggregationService;
-    }
-*/
-/*    
-    private IndicatorService indicatorService;
-
-    public void setIndicatorService( IndicatorService indicatorService )
-    {
-        this.indicatorService = indicatorService;
-    }
-*/
-/*  
-    private DataValueService dataValueService;
-
-    public void setDataValueService( DataValueService dataValueService )
-    {
-        this.dataValueService = dataValueService;
-    }
-*/    
+
+    /*
+     * private AggregationService aggregationService;
+     * 
+     * public void setAggregationService( AggregationService aggregationService
+     * ) { this.aggregationService = aggregationService; }
+     */
+    /*
+     * private IndicatorService indicatorService;
+     * 
+     * public void setIndicatorService( IndicatorService indicatorService ) {
+     * this.indicatorService = indicatorService; }
+     */
+    /*
+     * private DataValueService dataValueService;
+     * 
+     * public void setDataValueService( DataValueService dataValueService ) {
+     * this.dataValueService = dataValueService; }
+     */
     private DataElementCategoryService dataElementCategoryOptionComboService;
-    
-    
-    public void setDataElementCategoryOptionComboService( DataElementCategoryService dataElementCategoryOptionComboService )
+
+    public void setDataElementCategoryOptionComboService(
+        DataElementCategoryService dataElementCategoryOptionComboService )
     {
         this.dataElementCategoryOptionComboService = dataElementCategoryOptionComboService;
     }
 
     /*
-    private DataElementCategoryService dataElementCategoryService;
-
-    public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService )
-    {
-        this.dataElementCategoryService = dataElementCategoryService;
-    }
-*/
+     * private DataElementCategoryService dataElementCategoryService;
+     * 
+     * public void setDataElementCategoryService( DataElementCategoryService
+     * dataElementCategoryService ) { this.dataElementCategoryService =
+     * dataElementCategoryService; }
+     */
     private JdbcTemplate jdbcTemplate;
 
     public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
@@ -172,14 +167,12 @@
     // -------------------------------------------------------------------------
     // Properties
     // -------------------------------------------------------------------------
-/*   
-    private PeriodStore periodStore;
-
-    public void setPeriodStore( PeriodStore periodStore )
-    {
-        this.periodStore = periodStore;
-    }
-*/
+    /*
+     * private PeriodStore periodStore;
+     * 
+     * public void setPeriodStore( PeriodStore periodStore ) { this.periodStore
+     * = periodStore; }
+     */
     private InputStream inputStream;
 
     public InputStream getInputStream()
@@ -276,53 +269,44 @@
         return yearFormat;
     }
 
-   // private List<String> deCodeType;
+    // private List<String> deCodeType;
 
-    //private List<String> serviceType;
+    // private List<String> serviceType;
 
     private String reportFileNameTB;
-    
-/*
-    public void setReportFileNameTB( String reportFileNameTB )
-    {
-        this.reportFileNameTB = reportFileNameTB;
-    }
-*/
+
+    /*
+     * public void setReportFileNameTB( String reportFileNameTB ) {
+     * this.reportFileNameTB = reportFileNameTB; }
+     */
     private String reportModelTB;
-/*
-    public void setReportModelTB( String reportModelTB )
-    {
-        this.reportModelTB = reportModelTB;
-    }
-*/
+
+    /*
+     * public void setReportModelTB( String reportModelTB ) { this.reportModelTB
+     * = reportModelTB; }
+     */
     private String reportList;
 
     public void setReportList( String reportList )
     {
         this.reportList = reportList;
     }
-/*
-    private String startDate;
-
-    public void setStartDate( String startDate )
-    {
-        this.startDate = startDate;
-    }
-
-    private String endDate;
-
-    public void setEndDate( String endDate )
-    {
-        this.endDate = endDate;
-    }
-
-    private List<String> orgUnitListCB;
-
-    public void setOrgUnitListCB( List<String> orgUnitListCB )
-    {
-        this.orgUnitListCB = orgUnitListCB;
-    }
-*/
+
+    /*
+     * private String startDate;
+     * 
+     * public void setStartDate( String startDate ) { this.startDate =
+     * startDate; }
+     * 
+     * private String endDate;
+     * 
+     * public void setEndDate( String endDate ) { this.endDate = endDate; }
+     * 
+     * private List<String> orgUnitListCB;
+     * 
+     * public void setOrgUnitListCB( List<String> orgUnitListCB ) {
+     * this.orgUnitListCB = orgUnitListCB; }
+     */
     private int ouIDTB;
 
     public void setOuIDTB( int ouIDTB )
@@ -337,33 +321,34 @@
         this.availablePeriods = availablePeriods;
     }
 
-//        private Hashtable<String, String> serviceList;
-/*
-    private List<Integer> sheetList;
-
-    private List<Integer> rowList;
-
-    private List<Integer> colList;
-
-    private List<Integer> rowMergeList;
-
-    private List<Integer> colMergeList;
-*/
+    // private Hashtable<String, String> serviceList;
+    /*
+     * private List<Integer> sheetList;
+     * 
+     * private List<Integer> rowList;
+     * 
+     * private List<Integer> colList;
+     * 
+     * private List<Integer> rowMergeList;
+     * 
+     * private List<Integer> colMergeList;
+     */
     private Date sDate;
 
     private Date eDate;
 
-//        private List<Integer> totalOrgUnitsCountList;
+    // private List<Integer> totalOrgUnitsCountList;
 
     private OrganisationUnit currentOrgUnit;
 
     private Map<String, String> resMap;
-    
-    private Map<String, String>resMapForDeath;
+
+    private Map<String, String> resMapForDeath;
 
     Connection con = null;
 
     private String raFolderName;
+
     private SimpleDateFormat simpleMonthFormat;
 
     // -------------------------------------------------------------------------
@@ -384,26 +369,25 @@
         mathTool = new MathTool();
         services = new ArrayList<String>();
         slNos = new ArrayList<String>();
-       // deCodeType = new ArrayList<String>();
-       // serviceType = new ArrayList<String>();
-//            totalOrgUnitsCountList = new ArrayList<Integer>();
-        //String deCodesXMLFileName = "";
+        // deCodeType = new ArrayList<String>();
+        // serviceType = new ArrayList<String>();
+        // totalOrgUnitsCountList = new ArrayList<Integer>();
+        // String deCodesXMLFileName = "";
         simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
         monthFormat = new SimpleDateFormat( "MMMM" );
         yearFormat = new SimpleDateFormat( "yyyy" );
         simpleMonthFormat = new SimpleDateFormat( "MMM" );
-       // deCodesXMLFileName = reportList + "DECodes.xml";
+        // deCodesXMLFileName = reportList + "DECodes.xml";
 
         initializeResultMap();
-        
+
         initializeLLDeathResultMap();
 
         List<Integer> llrecordNos = new ArrayList<Integer>();
 
-//            String parentUnit = "";
-        
-        
-        // Getting Report Details       
+        // String parentUnit = "";
+
+        // Getting Report Details
         String deCodesXMLFileName = "";
 
         Report_in selReportObj = reportService.getReport( Integer.parseInt( reportList ) );
@@ -412,15 +396,16 @@
         reportModelTB = selReportObj.getModel();
         reportFileNameTB = selReportObj.getExcelTemplateName();
         String parentUnit = "";
-        
-        
-        if ( reportModelTB.equalsIgnoreCase( "DYNAMIC-ORGUNIT" ) || reportModelTB.equalsIgnoreCase( "DYNAMIC-DATAELEMENT" ) )
+
+        if ( reportModelTB.equalsIgnoreCase( "DYNAMIC-ORGUNIT" )
+            || reportModelTB.equalsIgnoreCase( "DYNAMIC-DATAELEMENT" ) )
         {
             OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit( ouIDTB );
             orgUnitList = new ArrayList<OrganisationUnit>( orgUnit.getChildren() );
             Collections.sort( orgUnitList, new OrganisationUnitNameComparator() );
         }
-        else if ( reportModelTB.equalsIgnoreCase( "STATIC" ) || reportModelTB.equalsIgnoreCase( "STATIC-DATAELEMENTS" ) || reportModelTB.equalsIgnoreCase( "STATIC-FINANCIAL" ) )
+        else if ( reportModelTB.equalsIgnoreCase( "STATIC" ) || reportModelTB.equalsIgnoreCase( "STATIC-DATAELEMENTS" )
+            || reportModelTB.equalsIgnoreCase( "STATIC-FINANCIAL" ) )
         {
             orgUnitList = new ArrayList<OrganisationUnit>();
             OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit( ouIDTB );
@@ -435,26 +420,36 @@
 
             parentUnit = orgUnit.getName();
         }
-        
-        
+
         System.out.println( reportModelTB + " : " + reportFileNameTB + " : " + deCodesXMLFileName + " : " + ouIDTB );
         System.out.println( "Report Generation Start Time is : \t" + new Date() );
         System.out.println( "Size of OrgUnit List is : " + orgUnitList.size() );
-        
+
         /*
-        sheetList = new ArrayList<Integer>();
-        rowList = new ArrayList<Integer>();
-        colList = new ArrayList<Integer>();
-        rowMergeList = new ArrayList<Integer>();
-        
-        colMergeList = new ArrayList<Integer>();
+         * sheetList = new ArrayList<Integer>(); rowList = new
+         * ArrayList<Integer>(); colList = new ArrayList<Integer>();
+         * rowMergeList = new ArrayList<Integer>();
+         * 
+         * colMergeList = new ArrayList<Integer>();
          */
-        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 + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
-       
+        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 + "output" +
+        // File.separator + UUID.randomUUID().toString() + ".xls";
+
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if ( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
 
-        WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ), templateWorkbook );
+        WritableWorkbook outputReportWorkbook = Workbook
+            .createWorkbook( new File( outputReportPath ), templateWorkbook );
 
         // Period Info
         selectedPeriod = periodService.getPeriod( availablePeriods );
@@ -464,154 +459,183 @@
 
         // OrgUnit Info
         currentOrgUnit = organisationUnitService.getOrganisationUnit( ouIDTB );
-        System.out.println("orgunit" + currentOrgUnit.getName() + ",Start Date " + sDate + ",End Date " + eDate + " XML File : " + deCodesXMLFileName + ",selected period is " + selectedPeriod.getId());
+        System.out.println( "orgunit" + currentOrgUnit.getName() + ",Start Date " + sDate + ",End Date " + eDate
+            + " XML File : " + deCodesXMLFileName + ",selected period is " + selectedPeriod.getId() );
         llrecordNos = reportService.getLinelistingRecordNos( currentOrgUnit, selectedPeriod, deCodesXMLFileName );
 
         // Getting DataValues
         dataValueList = new ArrayList<String>();
-       // List<String> deCodesList = getDECodes( deCodesXMLFileName );
-        System.out.println("Line Listing Death Record Count is :" + llrecordNos.size() );
-        
+        // List<String> deCodesList = getDECodes( deCodesXMLFileName );
+        System.out.println( "Line Listing Death Record Count is :" + llrecordNos.size() );
+
         // Getting DataValues
         List<Report_inDesign> reportDesignList = reportService.getReportDesign( deCodesXMLFileName );
         List<Report_inDesign> reportDesignListLLDeath = reportService.getReportDesign( deCodesXMLFileName );
         List<Report_inDesign> reportDesignListLLMaternalDeath = reportService.getReportDesign( deCodesXMLFileName );
         int orgUnitCount = 0;
-        
+
         Iterator<OrganisationUnit> it = orgUnitList.iterator();
         while ( it.hasNext() )
         {
             OrganisationUnit currentOrgUnit = (OrganisationUnit) it.next();
-    
+
             int count1 = 0;
             Iterator<Report_inDesign> reportDesignIterator = reportDesignList.iterator();
             while ( reportDesignIterator.hasNext() )
             {
                 Report_inDesign report_inDesign = (Report_inDesign) reportDesignIterator.next();
-    
+
                 String deType = report_inDesign.getPtype();
                 String sType = report_inDesign.getStype();
                 String deCodeString = report_inDesign.getExpression();
                 String tempStr = "";
-    
+
                 Calendar tempStartDate = Calendar.getInstance();
                 Calendar tempEndDate = Calendar.getInstance();
-                List<Calendar> calendarList = new ArrayList<Calendar>( reportService.getStartingEndingPeriods( deType, selectedPeriod ) );
-                if( calendarList == null || calendarList.isEmpty() )
+                List<Calendar> calendarList = new ArrayList<Calendar>( reportService.getStartingEndingPeriods( deType,
+                    selectedPeriod ) );
+                if ( calendarList == null || calendarList.isEmpty() )
                 {
                     tempStartDate.setTime( selectedPeriod.getStartDate() );
                     tempEndDate.setTime( selectedPeriod.getEndDate() );
                     return SUCCESS;
-                } 
+                }
                 else
                 {
                     tempStartDate = calendarList.get( 0 );
                     tempEndDate = calendarList.get( 1 );
                 }
-    
-                if( deCodeString.equalsIgnoreCase( "FACILITY" ) )
+
+                if ( deCodeString.equalsIgnoreCase( "FACILITY" ) )
                 {
                     tempStr = currentOrgUnit.getName();
-                } 
-                else if( deCodeString.equalsIgnoreCase( "FACILITY-NOREPEAT" ) )
+                }
+                else if ( deCodeString.equalsIgnoreCase( "FACILITY-NOREPEAT" ) )
                 {
                     tempStr = parentUnit;
-                } 
-                else if( deCodeString.equalsIgnoreCase( "FACILITYP" ) )
+                }
+                else if ( deCodeString.equalsIgnoreCase( "FACILITYP" ) )
                 {
                     tempStr = currentOrgUnit.getParent().getName();
-                } 
-                else if( deCodeString.equalsIgnoreCase( "FACILITYPP" ) )
+                }
+                else if ( deCodeString.equalsIgnoreCase( "FACILITYPP" ) )
                 {
                     tempStr = currentOrgUnit.getParent().getParent().getName();
-                } 
-                else if( deCodeString.equalsIgnoreCase( "FACILITYPPP" ) )
+                }
+                else if ( deCodeString.equalsIgnoreCase( "FACILITYPPP" ) )
                 {
                     tempStr = currentOrgUnit.getParent().getParent().getParent().getName();
-                } 
-                else if( deCodeString.equalsIgnoreCase( "FACILITYPPPP" ) )
+                }
+                else if ( deCodeString.equalsIgnoreCase( "FACILITYPPPP" ) )
                 {
                     tempStr = currentOrgUnit.getParent().getParent().getParent().getParent().getName();
-                } 
-                else if( deCodeString.equalsIgnoreCase( "PERIOD" ) || deCodeString.equalsIgnoreCase( "PERIOD-NOREPEAT" ) )
+                }
+                else if ( deCodeString.equalsIgnoreCase( "PERIOD" )
+                    || deCodeString.equalsIgnoreCase( "PERIOD-NOREPEAT" ) )
                 {
                     tempStr = simpleDateFormat.format( sDate );
-                } 
-                else if( deCodeString.equalsIgnoreCase( "PERIOD-MONTH" ) )
+                }
+                else if ( deCodeString.equalsIgnoreCase( "PERIOD-MONTH" ) )
                 {
                     tempStr = monthFormat.format( sDate );
                 }
-                else if( deCodeString.equalsIgnoreCase( "YEAR-FROMTO" ) )
+                else if ( deCodeString.equalsIgnoreCase( "YEAR-FROMTO" ) )
                 {
                     tempStr = yearFormat.format( sDate );
-                } 
-                else if( deCodeString.equalsIgnoreCase( "MONTH-START-SHORT" ) )
+                }
+                else if ( deCodeString.equalsIgnoreCase( "MONTH-START-SHORT" ) )
                 {
                     tempStr = simpleMonthFormat.format( sDate );
-                } 
-                else if( deCodeString.equalsIgnoreCase( "MONTH-END-SHORT" ) )
+                }
+                else if ( deCodeString.equalsIgnoreCase( "MONTH-END-SHORT" ) )
                 {
                     tempStr = simpleMonthFormat.format( eDate );
-                } 
-                else if( deCodeString.equalsIgnoreCase( "MONTH-START" ) )
+                }
+                else if ( deCodeString.equalsIgnoreCase( "MONTH-START" ) )
                 {
                     tempStr = monthFormat.format( sDate );
-                } 
-                else if( deCodeString.equalsIgnoreCase( "MONTH-END" ) )
+                }
+                else if ( deCodeString.equalsIgnoreCase( "MONTH-END" ) )
                 {
                     tempStr = monthFormat.format( eDate );
-                } 
-                else if( deCodeString.equalsIgnoreCase( "SLNO" ) )
+                }
+                else if ( deCodeString.equalsIgnoreCase( "SLNO" ) )
                 {
-                    tempStr = "" + ( orgUnitCount + 1 );
-                } 
-                else if( deCodeString.equalsIgnoreCase( "NA" ) )
+                    tempStr = "" + (orgUnitCount + 1);
+                }
+                else if ( deCodeString.equalsIgnoreCase( "NA" ) )
                 {
                     tempStr = " ";
-                } 
+                }
                 else
                 {
-                    if( sType.equalsIgnoreCase( "dataelement" ) )
+                    if ( sType.equalsIgnoreCase( "dataelement" ) )
                     {
-                        tempStr = reportService.getResultDataValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit, reportModelTB );
-                    } 
+                        tempStr = reportService.getResultDataValue( deCodeString, tempStartDate.getTime(), tempEndDate
+                            .getTime(), currentOrgUnit, reportModelTB );
+                    }
                     else if ( sType.equalsIgnoreCase( "dataelement-boolean" ) )
                     {
-                        tempStr = reportService.getBooleanDataValue(deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit, reportModelTB);
+                        tempStr = reportService.getBooleanDataValue( deCodeString, tempStartDate.getTime(), tempEndDate
+                            .getTime(), currentOrgUnit, reportModelTB );
                     }
                     else
                     {
-                        tempStr = reportService.getResultIndicatorValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit );
+                        tempStr = reportService.getResultIndicatorValue( deCodeString, tempStartDate.getTime(),
+                            tempEndDate.getTime(), currentOrgUnit );
                     }
                 }
-        
+
                 int tempRowNo = report_inDesign.getRowno();
                 int tempColNo = report_inDesign.getColno();
-                int sheetNo =   report_inDesign.getSheetno();
+                int sheetNo = report_inDesign.getSheetno();
                 WritableSheet sheet0 = outputReportWorkbook.getSheet( sheetNo );
-                
-               // System.out.println( ",Temp Row no is : " + tempRowNo + ", Temp Col No is : " + tempColNo );
-                
+
+                // System.out.println( ",Temp Row no is : " + tempRowNo +
+                // ", Temp Col No is : " + tempColNo );
+
                 if ( tempStr == null || tempStr.equals( " " ) )
                 {
                     tempColNo += orgUnitCount;
-        
+
                     WritableCellFormat wCellformat = new WritableCellFormat();
                     wCellformat.setBorder( Border.ALL, BorderLineStyle.THIN );
                     wCellformat.setWrap( true );
                     wCellformat.setAlignment( Alignment.CENTRE );
-                    
+
                     sheet0.addCell( new Blank( tempColNo, tempRowNo, wCellformat ) );
                 }
-                
+
                 else
                 {
                     if ( reportModelTB.equalsIgnoreCase( "DYNAMIC-ORGUNIT" ) )
                     {
-                        if ( deCodeString.equalsIgnoreCase( "FACILITYP" ) || deCodeString.equalsIgnoreCase( "FACILITYPP" ) || deCodeString.equalsIgnoreCase( "FACILITYPPP" ) || deCodeString.equalsIgnoreCase( "FACILITYPPPP" ) )
+                        if ( deCodeString.equalsIgnoreCase( "FACILITYP" )
+                            || deCodeString.equalsIgnoreCase( "FACILITYPP" )
+                            || deCodeString.equalsIgnoreCase( "FACILITYPPP" )
+                            || deCodeString.equalsIgnoreCase( "FACILITYPPPP" ) )
                         {
-                        } 
-                        else if ( deCodeString.equalsIgnoreCase( "PERIOD" ) || deCodeString.equalsIgnoreCase( "PERIOD-NOREPEAT" ) || deCodeString.equalsIgnoreCase( "PERIOD-WEEK" ) || deCodeString.equalsIgnoreCase( "PERIOD-MONTH" ) || deCodeString.equalsIgnoreCase( "PERIOD-QUARTER" ) || deCodeString.equalsIgnoreCase( "PERIOD-YEAR" ) || deCodeString.equalsIgnoreCase( "MONTH-START" ) || deCodeString.equalsIgnoreCase( "MONTH-END" ) || deCodeString.equalsIgnoreCase( "MONTH-START-SHORT" ) || deCodeString.equalsIgnoreCase( "MONTH-END-SHORT" ) || deCodeString.equalsIgnoreCase( "SIMPLE-QUARTER" ) || deCodeString.equalsIgnoreCase( "QUARTER-MONTHS-SHORT" ) || deCodeString.equalsIgnoreCase( "QUARTER-MONTHS" ) || deCodeString.equalsIgnoreCase( "QUARTER-START-SHORT" ) || deCodeString.equalsIgnoreCase( "QUARTER-END-SHORT" ) || deCodeString.equalsIgnoreCase( "QUARTER-START" ) || deCodeString.equalsIgnoreCase( "QUARTER-END" ) || deCodeString.equalsIgnoreCase( "SIMPLE-YEAR" ) || deCodeString.equalsIgnoreCase( "YEAR-END" ) || deCodeString.equalsIgnoreCase( "YEAR-FROMTO" ) )
+                        }
+                        else if ( deCodeString.equalsIgnoreCase( "PERIOD" )
+                            || deCodeString.equalsIgnoreCase( "PERIOD-NOREPEAT" )
+                            || deCodeString.equalsIgnoreCase( "PERIOD-WEEK" )
+                            || deCodeString.equalsIgnoreCase( "PERIOD-MONTH" )
+                            || deCodeString.equalsIgnoreCase( "PERIOD-QUARTER" )
+                            || deCodeString.equalsIgnoreCase( "PERIOD-YEAR" )
+                            || deCodeString.equalsIgnoreCase( "MONTH-START" )
+                            || deCodeString.equalsIgnoreCase( "MONTH-END" )
+                            || deCodeString.equalsIgnoreCase( "MONTH-START-SHORT" )
+                            || deCodeString.equalsIgnoreCase( "MONTH-END-SHORT" )
+                            || deCodeString.equalsIgnoreCase( "SIMPLE-QUARTER" )
+                            || deCodeString.equalsIgnoreCase( "QUARTER-MONTHS-SHORT" )
+                            || deCodeString.equalsIgnoreCase( "QUARTER-MONTHS" )
+                            || deCodeString.equalsIgnoreCase( "QUARTER-START-SHORT" )
+                            || deCodeString.equalsIgnoreCase( "QUARTER-END-SHORT" )
+                            || deCodeString.equalsIgnoreCase( "QUARTER-START" )
+                            || deCodeString.equalsIgnoreCase( "QUARTER-END" )
+                            || deCodeString.equalsIgnoreCase( "SIMPLE-YEAR" )
+                            || deCodeString.equalsIgnoreCase( "YEAR-END" )
+                            || deCodeString.equalsIgnoreCase( "YEAR-FROMTO" ) )
                         {
                         }
                         else
@@ -621,55 +645,82 @@
                     }
                     else if ( reportModelTB.equalsIgnoreCase( "dynamicwithrootfacility" ) )
                     {
-                        if ( deCodeString.equalsIgnoreCase( "FACILITYP" ) || deCodeString.equalsIgnoreCase( "FACILITY-NOREPEAT" ) ||  deCodeString.equalsIgnoreCase( "FACILITYPP" ) || deCodeString.equalsIgnoreCase( "FACILITYPPP" ) || deCodeString.equalsIgnoreCase( "FACILITYPPPP" ) )
-                        {
-                        } 
-                        else if ( deCodeString.equalsIgnoreCase( "PERIOD" ) || deCodeString.equalsIgnoreCase( "PERIOD-NOREPEAT" ) || deCodeString.equalsIgnoreCase( "PERIOD-WEEK" ) || deCodeString.equalsIgnoreCase( "PERIOD-MONTH" ) || deCodeString.equalsIgnoreCase( "PERIOD-QUARTER" ) || deCodeString.equalsIgnoreCase( "PERIOD-YEAR" ) || deCodeString.equalsIgnoreCase( "MONTH-START" ) || deCodeString.equalsIgnoreCase( "MONTH-END" ) || deCodeString.equalsIgnoreCase( "MONTH-START-SHORT" ) || deCodeString.equalsIgnoreCase( "MONTH-END-SHORT" ) || deCodeString.equalsIgnoreCase( "SIMPLE-QUARTER" ) || deCodeString.equalsIgnoreCase( "QUARTER-MONTHS-SHORT" ) || deCodeString.equalsIgnoreCase( "QUARTER-MONTHS" ) || deCodeString.equalsIgnoreCase( "QUARTER-START-SHORT" ) || deCodeString.equalsIgnoreCase( "QUARTER-END-SHORT" ) || deCodeString.equalsIgnoreCase( "QUARTER-START" ) || deCodeString.equalsIgnoreCase( "QUARTER-END" ) || deCodeString.equalsIgnoreCase( "SIMPLE-YEAR" ) || deCodeString.equalsIgnoreCase( "YEAR-END" ) || deCodeString.equalsIgnoreCase( "YEAR-FROMTO" ) )
-                        {
-                        } 
+                        if ( deCodeString.equalsIgnoreCase( "FACILITYP" )
+                            || deCodeString.equalsIgnoreCase( "FACILITY-NOREPEAT" )
+                            || deCodeString.equalsIgnoreCase( "FACILITYPP" )
+                            || deCodeString.equalsIgnoreCase( "FACILITYPPP" )
+                            || deCodeString.equalsIgnoreCase( "FACILITYPPPP" ) )
+                        {
+                        }
+                        else if ( deCodeString.equalsIgnoreCase( "PERIOD" )
+                            || deCodeString.equalsIgnoreCase( "PERIOD-NOREPEAT" )
+                            || deCodeString.equalsIgnoreCase( "PERIOD-WEEK" )
+                            || deCodeString.equalsIgnoreCase( "PERIOD-MONTH" )
+                            || deCodeString.equalsIgnoreCase( "PERIOD-QUARTER" )
+                            || deCodeString.equalsIgnoreCase( "PERIOD-YEAR" )
+                            || deCodeString.equalsIgnoreCase( "MONTH-START" )
+                            || deCodeString.equalsIgnoreCase( "MONTH-END" )
+                            || deCodeString.equalsIgnoreCase( "MONTH-START-SHORT" )
+                            || deCodeString.equalsIgnoreCase( "MONTH-END-SHORT" )
+                            || deCodeString.equalsIgnoreCase( "SIMPLE-QUARTER" )
+                            || deCodeString.equalsIgnoreCase( "QUARTER-MONTHS-SHORT" )
+                            || deCodeString.equalsIgnoreCase( "QUARTER-MONTHS" )
+                            || deCodeString.equalsIgnoreCase( "QUARTER-START-SHORT" )
+                            || deCodeString.equalsIgnoreCase( "QUARTER-END-SHORT" )
+                            || deCodeString.equalsIgnoreCase( "QUARTER-START" )
+                            || deCodeString.equalsIgnoreCase( "QUARTER-END" )
+                            || deCodeString.equalsIgnoreCase( "SIMPLE-YEAR" )
+                            || deCodeString.equalsIgnoreCase( "YEAR-END" )
+                            || deCodeString.equalsIgnoreCase( "YEAR-FROMTO" ) )
+                        {
+                        }
                         else
                         {
                             tempRowNo += orgUnitCount;
                         }
                     }
-                    
-                    //System.out.println( ",Temp Row no is : " + tempRowNo + ", Temp Col No is : " + tempColNo + ", Data Value is : "  + tempStr );
+
+                    // System.out.println( ",Temp Row no is : " + tempRowNo +
+                    // ", Temp Col No is : " + tempColNo + ", Data Value is : "
+                    // + tempStr );
                     WritableCell cell = sheet0.getWritableCell( tempColNo, tempRowNo );
-    
+
                     CellFormat cellFormat = cell.getCellFormat();
                     WritableCellFormat wCellformat = new WritableCellFormat();
                     wCellformat.setBorder( Border.ALL, BorderLineStyle.THIN );
                     wCellformat.setWrap( true );
                     wCellformat.setAlignment( Alignment.CENTRE );
-                    
-                   // System.out.println( ",Temp Row no is : " + tempRowNo + ", Temp Col No is : " + tempColNo );
-                    
+
+                    // System.out.println( ",Temp Row no is : " + tempRowNo +
+                    // ", Temp Col No is : " + tempColNo );
+
                     if ( cell.getType() == CellType.LABEL )
                     {
                         Label l = (Label) cell;
                         l.setString( tempStr );
                         l.setCellFormat( cellFormat );
-                    } 
+                    }
                     else
                     {
                         try
                         {
-                            sheet0.addCell( new Number( tempColNo, tempRowNo, Double.parseDouble( tempStr ), wCellformat ) );
+                            sheet0.addCell( new Number( tempColNo, tempRowNo, Double.parseDouble( tempStr ),
+                                wCellformat ) );
                         }
-                        catch( Exception e )
+                        catch ( Exception e )
                         {
                             sheet0.addCell( new Label( tempColNo, tempRowNo, tempStr, wCellformat ) );
                         }
                     }
                 }
-                
+
                 count1++;
             }// inner while loop end
             orgUnitCount++;
         }// outer while loop end
 
-     // for Line Listing Death DataElements      
-        
+        // for Line Listing Death DataElements
+
         int tempLLDeathRowNo = 0;
         int flag = 0;
         if ( llrecordNos.size() == 0 )
@@ -686,22 +737,22 @@
             }
             flag = 0;
 
-            //Iterator<String> it1 = deCodesList.iterator();
+            // Iterator<String> it1 = deCodesList.iterator();
             Iterator<Report_inDesign> reportDesignIterator = reportDesignListLLDeath.iterator();
             int count1 = 0;
             while ( reportDesignIterator.hasNext() )
             {
-               //String deCodeString = (String) it1.next();
-
-               //String deType = (String) deCodeType.get( count1 );
-               //String sType = (String) serviceType.get( count1 );
-               // int count = 0;
-                //double sum = 0.0;
-              //  int flag1 = 0;
-                //String tempStr = "";
-                
+                // String deCodeString = (String) it1.next();
+
+                // String deType = (String) deCodeType.get( count1 );
+                // String sType = (String) serviceType.get( count1 );
+                // int count = 0;
+                // double sum = 0.0;
+                // int flag1 = 0;
+                // String tempStr = "";
+
                 Report_inDesign report_inDesign = (Report_inDesign) reportDesignIterator.next();
-                
+
                 String deType = report_inDesign.getPtype();
                 String sType = report_inDesign.getStype();
                 String deCodeString = report_inDesign.getExpression();
@@ -712,8 +763,10 @@
 
                 Calendar tempStartDate = Calendar.getInstance();
                 Calendar tempEndDate = Calendar.getInstance();
-               // List<Calendar> calendarList = new ArrayList<Calendar>( getStartingEndingPeriods( deType ) );
-                List<Calendar> calendarList = new ArrayList<Calendar>( reportService.getStartingEndingPeriods( deType, selectedPeriod ) );
+                // List<Calendar> calendarList = new ArrayList<Calendar>(
+                // getStartingEndingPeriods( deType ) );
+                List<Calendar> calendarList = new ArrayList<Calendar>( reportService.getStartingEndingPeriods( deType,
+                    selectedPeriod ) );
                 if ( calendarList == null || calendarList.isEmpty() )
                 {
                     tempStartDate.setTime( selectedPeriod.getStartDate() );
@@ -725,8 +778,8 @@
                     tempStartDate = calendarList.get( 0 );
                     tempEndDate = calendarList.get( 1 );
                 }
-                
-               if ( deCodeString.equalsIgnoreCase( "NA" ) )
+
+                if ( deCodeString.equalsIgnoreCase( "NA" ) )
                 {
                     tempStr = " ";
                     tempLLDeathValuStr = " ";
@@ -737,53 +790,53 @@
                     {
                         tempStr = getLLDataValue( deCodeString, selectedPeriod, currentOrgUnit, recordNo );
                     }
-                    
+
                     else if ( sType.equalsIgnoreCase( "lldeathdataelementage" ) )
                     {
                         tempLLDeathValuStr = getLLDataValue( deCodeString, selectedPeriod, currentOrgUnit, recordNo );
                     }
                     else
                     {
-                        //tempStr = reportService.getResultIndicatorValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit );
-                        //System.out.println( tempStr );
+                        // tempStr = reportService.getResultIndicatorValue(
+                        // deCodeString, tempStartDate.getTime(),
+                        // tempEndDate.getTime(), currentOrgUnit );
+                        // System.out.println( tempStr );
                     }
                 }
-               tempLLDeathRowNo = report_inDesign.getRowno();
-               int tempRowNo = report_inDesign.getRowno();
-               //int tempRowNo = 136;
-               currentRowNo = tempLLDeathRowNo;
-               int tempColNo = report_inDesign.getColno();
-               int sheetNo = report_inDesign.getSheetno();
-              // System.out.println( ",Temp Row no is : " + tempRowNo  );
-               WritableSheet sheet0 = outputReportWorkbook.getSheet( sheetNo );
+                tempLLDeathRowNo = report_inDesign.getRowno();
+                int tempRowNo = report_inDesign.getRowno();
+                // int tempRowNo = 136;
+                currentRowNo = tempLLDeathRowNo;
+                int tempColNo = report_inDesign.getColno();
+                int sheetNo = report_inDesign.getSheetno();
+                // System.out.println( ",Temp Row no is : " + tempRowNo );
+                WritableSheet sheet0 = outputReportWorkbook.getSheet( sheetNo );
                 if ( tempStr == null || tempStr.equals( " " ) )
                 {
-                    
-                } 
+
+                }
                 else
                 {
 
-                    //System.out.println( deCodeString + " : " + tempStr );
-                    //System.out.println( deCodeString + " : " + tempStr );
-                    
+                    // System.out.println( deCodeString + " : " + tempStr );
+                    // System.out.println( deCodeString + " : " + tempStr );
+
                     /*
-                    String tstr = resMapForDeath.get( tempStr.trim() );
-                    
-                    if ( tstr != null )
-                    {
-                        String temp1 = tstr.split( ":" )[0].trim();
-                        String temp2 = tstr.split( ":" )[1].trim();
-                        
-                        tempStr1 = temp1;
-                        tempStr = temp2;
-                        
-                    }
-                    */
+                     * String tstr = resMapForDeath.get( tempStr.trim() );
+                     * 
+                     * if ( tstr != null ) { String temp1 = tstr.split( ":"
+                     * )[0].trim(); String temp2 = tstr.split( ":" )[1].trim();
+                     * 
+                     * tempStr1 = temp1; tempStr = temp2;
+                     * 
+                     * }
+                     */
                     String tstr1 = resMap.get( tempStr.trim() );
                     if ( tstr1 != null )
                         tempStr = tstr1;
 
-                    if ( reportModelTB.equalsIgnoreCase( "DYNAMIC-DATAELEMENT" ) || reportModelTB.equalsIgnoreCase( "STATIC-DATAELEMENTS" ) )
+                    if ( reportModelTB.equalsIgnoreCase( "DYNAMIC-DATAELEMENT" )
+                        || reportModelTB.equalsIgnoreCase( "STATIC-DATAELEMENTS" ) )
                     {
                         if ( deCodeString.equalsIgnoreCase( "FACILITYP" )
                             || deCodeString.equalsIgnoreCase( "FACILITYPP" ) )
@@ -821,9 +874,10 @@
                             tempRowNo += recordCount;
                         }
 
-                       // WritableCell cell = sheet0.getWritableCell( tempColNo, tempRowNo );
+                        // WritableCell cell = sheet0.getWritableCell(
+                        // tempColNo, tempRowNo );
 
-                        //CellFormat cellFormat = cell.getCellFormat();
+                        // CellFormat cellFormat = cell.getCellFormat();
 
                         WritableCellFormat wCellformat = new WritableCellFormat();
 
@@ -831,69 +885,65 @@
                         wCellformat.setWrap( true );
                         wCellformat.setAlignment( Alignment.CENTRE );
                         wCellformat.setVerticalAlignment( VerticalAlignment.CENTRE );
-/*                        
-                        if ( cell.getType() == CellType.LABEL )
-                        {
-                            Label l = (Label) cell;
-                            l.setString( tempStr );
-                            l.setCellFormat( cellFormat );
-                        } 
-                        
- */                       /*
-                        if ( cellFormat != null )
-                        {
-                            try
-                            {
-                                sheet0.addCell( new Number( tempColNo, tempRowNo, Integer.parseInt( tempStr ), cellFormat ) );
-                            }
-                            catch( Exception e )
-                            {
-                                sheet0.addCell( new Label( tempColNo, tempRowNo, tempStr, cellFormat ) );
-                            }
-                            
-                            //System.out.println( "In Pre-Formatted: " + tempStr );
-                        }
-                        */
-                        //else
-                        //{
-                            if ( sType.equalsIgnoreCase( "lldeathdataelementage" ) )
-                            {
-                                //System.out.println( "In Side lldeathdataelementage" );
-                                String tstr = resMapForDeath.get( tempLLDeathValuStr.trim() );
-                                
-                                //System.out.println( ",LL Death Map is : " + tstr + ", temp str is : " + tempLLDeathValuStr.trim() );
-                                if ( tstr != null )
-                                {
-                                    tempStr1  = tstr.split( ":" )[0].trim();
-                                    tempStr2  = tstr.split( ":" )[1].trim();
-                                    //System.out.println( "tempStr1 is : " + tempStr1 + ", tempStr2 is : " + tempStr2 );
-                                }
-                                try
-                                {
-                                    sheet0.addCell( new Label( tempColNo-1, tempRowNo, tempStr1, getCellFormat1() ) );
-                                    sheet0.addCell( new Label( tempColNo, tempRowNo, tempStr2, getCellFormat1() ) );
-                                }
-                                catch( Exception e )
-                                {
-                                    //System.out.println( "In Side lldeathdataelementage Exception" );
-                                    sheet0.addCell( new Label( tempColNo, tempRowNo, tempStr1, getCellFormat1() ) );
-                                }
-                            }                           
-                           else if ( sType.equalsIgnoreCase( "lldeathdataelement" ) )
-                           {
-                                try
-                                {
-                                    sheet0.addCell( new Number( tempColNo, tempRowNo, Integer.parseInt( tempStr ), getCellFormat1() ) );
-                                }
-                                catch( Exception e )
-                                {
-                                    sheet0.addCell( new Label( tempColNo, tempRowNo, tempStr, getCellFormat1() ) );
-                                }
-                            }
-
-
-                            //System.out.println( "In Cur-Formatted: " + tempStr );
-                        //}
+                        /*
+                         * if ( cell.getType() == CellType.LABEL ) { Label l =
+                         * (Label) cell; l.setString( tempStr );
+                         * l.setCellFormat( cellFormat ); }
+                         *//*
+                            * if ( cellFormat != null ) { try { sheet0.addCell(
+                            * new Number( tempColNo, tempRowNo,
+                            * Integer.parseInt( tempStr ), cellFormat ) ); }
+                            * catch( Exception e ) { sheet0.addCell( new Label(
+                            * tempColNo, tempRowNo, tempStr, cellFormat ) ); }
+                            * 
+                            * //System.out.println( "In Pre-Formatted: " +
+                            * tempStr ); }
+                            */
+                        // else
+                        // {
+                        if ( sType.equalsIgnoreCase( "lldeathdataelementage" ) )
+                        {
+                            // System.out.println(
+                            // "In Side lldeathdataelementage" );
+                            String tstr = resMapForDeath.get( tempLLDeathValuStr.trim() );
+
+                            // System.out.println( ",LL Death Map is : " + tstr
+                            // + ", temp str is : " + tempLLDeathValuStr.trim()
+                            // );
+                            if ( tstr != null )
+                            {
+                                tempStr1 = tstr.split( ":" )[0].trim();
+                                tempStr2 = tstr.split( ":" )[1].trim();
+                                // System.out.println( "tempStr1 is : " +
+                                // tempStr1 + ", tempStr2 is : " + tempStr2 );
+                            }
+                            try
+                            {
+                                sheet0.addCell( new Label( tempColNo - 1, tempRowNo, tempStr1, getCellFormat1() ) );
+                                sheet0.addCell( new Label( tempColNo, tempRowNo, tempStr2, getCellFormat1() ) );
+                            }
+                            catch ( Exception e )
+                            {
+                                // System.out.println(
+                                // "In Side lldeathdataelementage Exception" );
+                                sheet0.addCell( new Label( tempColNo, tempRowNo, tempStr1, getCellFormat1() ) );
+                            }
+                        }
+                        else if ( sType.equalsIgnoreCase( "lldeathdataelement" ) )
+                        {
+                            try
+                            {
+                                sheet0.addCell( new Number( tempColNo, tempRowNo, Integer.parseInt( tempStr ),
+                                    getCellFormat1() ) );
+                            }
+                            catch ( Exception e )
+                            {
+                                sheet0.addCell( new Label( tempColNo, tempRowNo, tempStr, getCellFormat1() ) );
+                            }
+                        }
+
+                        // System.out.println( "In Cur-Formatted: " + tempStr );
+                        // }
                     }
 
                     // }
@@ -901,24 +951,25 @@
                 count1++;
             }// inner while loop end
             recordCount++;
-           // System.out.println("End Row no for ll Death Death is  : " + recordCount );
+            // System.out.println("End Row no for ll Death Death is  : " +
+            // recordCount );
         }// outer while loop end
-        
-        
-        //int tempRowNollm = currentRowNo+1;
-        //System.out.println("Temp Row No is   : " + tempLLDeathRowNo );
-        //int tempRowNollm = recordCount + tempLLDeathRowNo;
-        
-       // System.out.println("Start Row no for ll maternal Death is  : " + tempRowNollm + ",Record count is : " + recordCount );
-        
+
+        // int tempRowNollm = currentRowNo+1;
+        // System.out.println("Temp Row No is   : " + tempLLDeathRowNo );
+        // int tempRowNollm = recordCount + tempLLDeathRowNo;
+
+        // System.out.println("Start Row no for ll maternal Death is  : " +
+        // tempRowNollm + ",Record count is : " + recordCount );
+
         // Line Listing Matarnal Death DataElements
-        
+
         List<Integer> llMaternalDeathrecordNos = new ArrayList<Integer>();
         llMaternalDeathrecordNos = getLinelistingMateralanRecordNos( currentOrgUnit, selectedPeriod, deCodesXMLFileName );
-        System.out.println("Line Listing Maternal Death Record Count is :" + llMaternalDeathrecordNos.size() );
-        
-        //int testRowNo = 0;
-        
+        System.out.println( "Line Listing Maternal Death Record Count is :" + llMaternalDeathrecordNos.size() );
+
+        // int testRowNo = 0;
+
         int flagmdeath = 0;
         if ( llMaternalDeathrecordNos.size() == 0 )
             flagmdeath = 1;
@@ -933,32 +984,34 @@
             }
             flagmdeath = 0;
 
-            //Iterator<String> it1 = deCodesList.iterator();
+            // Iterator<String> it1 = deCodesList.iterator();
             Iterator<Report_inDesign> reportDesignIterator = reportDesignListLLMaternalDeath.iterator();
             int count1 = 0;
             while ( reportDesignIterator.hasNext() )
             {
-               //String deCodeString = (String) it1.next();
-
-               //String deType = (String) deCodeType.get( count1 );
-               //String sType = (String) serviceType.get( count1 );
-               // int count = 0;
-                //double sum = 0.0;
-              //  int flag1 = 0;
-                //String tempStr = "";
-                
+                // String deCodeString = (String) it1.next();
+
+                // String deType = (String) deCodeType.get( count1 );
+                // String sType = (String) serviceType.get( count1 );
+                // int count = 0;
+                // double sum = 0.0;
+                // int flag1 = 0;
+                // String tempStr = "";
+
                 Report_inDesign report_inDesign = (Report_inDesign) reportDesignIterator.next();
-                
+
                 String deType = report_inDesign.getPtype();
                 String sType = report_inDesign.getStype();
                 String deCodeString = report_inDesign.getExpression();
                 String tempStr = "";
-                //String tempStr1 = "";
+                // String tempStr1 = "";
 
                 Calendar tempStartDate = Calendar.getInstance();
                 Calendar tempEndDate = Calendar.getInstance();
-               // List<Calendar> calendarList = new ArrayList<Calendar>( getStartingEndingPeriods( deType ) );
-                List<Calendar> calendarList = new ArrayList<Calendar>( reportService.getStartingEndingPeriods( deType, selectedPeriod ) );
+                // List<Calendar> calendarList = new ArrayList<Calendar>(
+                // getStartingEndingPeriods( deType ) );
+                List<Calendar> calendarList = new ArrayList<Calendar>( reportService.getStartingEndingPeriods( deType,
+                    selectedPeriod ) );
                 if ( calendarList == null || calendarList.isEmpty() )
                 {
                     tempStartDate.setTime( selectedPeriod.getStartDate() );
@@ -970,19 +1023,19 @@
                     tempStartDate = calendarList.get( 0 );
                     tempEndDate = calendarList.get( 1 );
                 }
-                
-               if ( deCodeString.equalsIgnoreCase( "NA" ) )
+
+                if ( deCodeString.equalsIgnoreCase( "NA" ) )
                 {
                     tempStr = " ";
                 }
-               else if ( deCodeString.equalsIgnoreCase( "F" ) )
-               {
-                   tempStr = "Female";
-               }
-               else if ( deCodeString.equalsIgnoreCase( "Y" ) )
-               {
-                   tempStr = "Years";
-               }
+                else if ( deCodeString.equalsIgnoreCase( "F" ) )
+                {
+                    tempStr = "Female";
+                }
+                else if ( deCodeString.equalsIgnoreCase( "Y" ) )
+                {
+                    tempStr = "Years";
+                }
                 else
                 {
                     if ( sType.equalsIgnoreCase( "llmaternaldeathdataelement" ) )
@@ -990,45 +1043,40 @@
                         tempStr = getLLDataValue( deCodeString, selectedPeriod, currentOrgUnit, maternalDeathRecordNo );
                     }
                     /*
-                    else
-                    {
-                        tempStr = reportService.getResultIndicatorValue( deCodeString, tempStartDate.getTime(), tempEndDate.getTime(), currentOrgUnit );
-                        //System.out.println( tempStr );
-                    }
-                    */
+                     * else { tempStr = reportService.getResultIndicatorValue(
+                     * deCodeString, tempStartDate.getTime(),
+                     * tempEndDate.getTime(), currentOrgUnit );
+                     * //System.out.println( tempStr ); }
+                     */
                 }
-               //testRowNo = report_inDesign.getRowno() + recordCount ;
-               int tempRowNo1 = report_inDesign.getRowno();
-               //int tempRowNo1 = 136;
-               int tempColNo = report_inDesign.getColno();
-               int sheetNo = report_inDesign.getSheetno();
-               WritableSheet sheet0 = outputReportWorkbook.getSheet( sheetNo );
+                // testRowNo = report_inDesign.getRowno() + recordCount ;
+                int tempRowNo1 = report_inDesign.getRowno();
+                // int tempRowNo1 = 136;
+                int tempColNo = report_inDesign.getColno();
+                int sheetNo = report_inDesign.getSheetno();
+                WritableSheet sheet0 = outputReportWorkbook.getSheet( sheetNo );
                 if ( tempStr == null || tempStr.equals( " " ) )
                 {
-                    
-                } 
+
+                }
                 else
                 {
                     String tstr1 = resMap.get( tempStr.trim() );
                     if ( tstr1 != null )
                         tempStr = tstr1;
-                    //System.out.println( deCodeString + " : " + tempStr );
+                    // System.out.println( deCodeString + " : " + tempStr );
                     /*
-                    String tstr = resMapForDeath.get( tempStr.trim() );
-                    if ( tstr != null )
-                    {
-                        String temp1 = tstr.split( ":" )[0].trim();
-                        String temp2 = tstr.split( ":" )[1].trim();
-                        
-                        tempStr = temp1;
-                        tempStr1 = temp2;
-                        
-                    }
-                    */
-                        
-                        
+                     * String tstr = resMapForDeath.get( tempStr.trim() ); if (
+                     * tstr != null ) { String temp1 = tstr.split( ":"
+                     * )[0].trim(); String temp2 = tstr.split( ":" )[1].trim();
+                     * 
+                     * tempStr = temp1; tempStr1 = temp2;
+                     * 
+                     * }
+                     */
 
-                    if ( reportModelTB.equalsIgnoreCase( "DYNAMIC-DATAELEMENT" ) || reportModelTB.equalsIgnoreCase( "STATIC-DATAELEMENTS" ) )
+                    if ( reportModelTB.equalsIgnoreCase( "DYNAMIC-DATAELEMENT" )
+                        || reportModelTB.equalsIgnoreCase( "STATIC-DATAELEMENTS" ) )
                     {
                         if ( deCodeString.equalsIgnoreCase( "FACILITYP" )
                             || deCodeString.equalsIgnoreCase( "FACILITYPP" ) )
@@ -1065,9 +1113,10 @@
                             tempRowNo1 += maternalDeathRecordCount + recordCount;
                         }
 
-                       // WritableCell cell = sheet0.getWritableCell( tempColNo, tempRowNo1 );
+                        // WritableCell cell = sheet0.getWritableCell(
+                        // tempColNo, tempRowNo1 );
 
-                        //CellFormat cellFormat = cell.getCellFormat();
+                        // CellFormat cellFormat = cell.getCellFormat();
 
                         WritableCellFormat wCellformat = new WritableCellFormat();
 
@@ -1075,44 +1124,37 @@
                         wCellformat.setWrap( true );
                         wCellformat.setAlignment( Alignment.CENTRE );
                         wCellformat.setVerticalAlignment( VerticalAlignment.CENTRE );
-                        
-                       /*
-                        if ( cell.getType() == CellType.LABEL )
-                        {
-                            Label l = (Label) cell;
-                            l.setString( tempStr );
-                            l.setCellFormat( cellFormat );
-                        } 
-                        */
-                        /*
-                        if ( cellFormat != null )
+
+                        /*
+                         * if ( cell.getType() == CellType.LABEL ) { Label l =
+                         * (Label) cell; l.setString( tempStr );
+                         * l.setCellFormat( cellFormat ); }
+                         */
+                        /*
+                         * if ( cellFormat != null ) { try { sheet0.addCell( new
+                         * Number( tempColNo, tempRowNo, Integer.parseInt(
+                         * tempStr ), cellFormat ) ); } catch( Exception e ) {
+                         * sheet0.addCell( new Label( tempColNo, tempRowNo,
+                         * tempStr, cellFormat ) ); }
+                         * 
+                         * //System.out.println( "In Pre-Formatted: " + tempStr
+                         * ); }
+                         */
+                        // else
+                        // {
+                        if ( sType.equalsIgnoreCase( "llmaternaldeathdataelement" ) )
                         {
                             try
                             {
-                                sheet0.addCell( new Number( tempColNo, tempRowNo, Integer.parseInt( tempStr ), cellFormat ) );
+                                sheet0.addCell( new Number( tempColNo, tempRowNo1, Integer.parseInt( tempStr ),
+                                    getCellFormat1() ) );
                             }
-                            catch( Exception e )
+                            catch ( Exception e )
                             {
-                                sheet0.addCell( new Label( tempColNo, tempRowNo, tempStr, cellFormat ) );
+                                sheet0.addCell( new Label( tempColNo, tempRowNo1, tempStr, getCellFormat1() ) );
                             }
-                            
-                            //System.out.println( "In Pre-Formatted: " + tempStr );
                         }
-                        */
-                       // else
-                        //{
-                            if ( sType.equalsIgnoreCase( "llmaternaldeathdataelement" ) )
-                            {
-                                try
-                                {
-                                    sheet0.addCell( new Number( tempColNo, tempRowNo1, Integer.parseInt( tempStr ), getCellFormat1() ) );
-                                }
-                                catch( Exception e )
-                                {
-                                    sheet0.addCell( new Label( tempColNo, tempRowNo1, tempStr, getCellFormat1() ) );
-                                }
-                            }
-                       // }
+                        // }
                     }
 
                     // }
@@ -1121,11 +1163,11 @@
             }// inner while loop end
             maternalDeathRecordCount++;
         }// outer while loop end
-        
-        
+
         int noOfRecords = llrecordNos.size();
-      
-        System.out.println("Current org unit id : " + currentOrgUnit.getId() + ": Selected Period is : " + selectedPeriod.getId() + ": No of Record :" + noOfRecords + ": Report List : " + reportList);
+
+        System.out.println( "Current org unit id : " + currentOrgUnit.getId() + ": Selected Period is : "
+            + selectedPeriod.getId() + ": No of Record :" + noOfRecords + ": Report List : " + reportList );
 
         outputReportWorkbook.write();
         outputReportWorkbook.close();
@@ -1223,8 +1265,8 @@
 
     public void initializeLLDeathResultMap()
     {
-        resMapForDeath  = new HashMap<String, String>();
-        
+        resMapForDeath = new HashMap<String, String>();
+
         resMapForDeath.put( "B1DAY", "Hrs:12" );
         resMapForDeath.put( "B1WEEK", "Weeks:1" );
         resMapForDeath.put( "B1MONTH", "Weeks:3" );
@@ -1234,7 +1276,7 @@
         resMapForDeath.put( "O15YEAR", "Years:40" );
         resMapForDeath.put( "O55YEAR", "Years:60" );
     }
-    
+
     public WritableCellFormat getCellFormat1()
         throws Exception
     {
@@ -1259,18 +1301,17 @@
         return wCellformat;
     }
 
-
     public String getLLDataValue( String formula, Period period, OrganisationUnit organisationUnit, Integer recordNo )
     {
         Statement st1 = null;
         ResultSet rs1 = null;
-        //System.out.println( "Inside LL Data Value Method" );
+        // System.out.println( "Inside LL Data Value Method" );
         String query = "";
         try
         {
 
-            //int deFlag1 = 0;
-            //int deFlag2 = 0;
+            // int deFlag1 = 0;
+            // int deFlag2 = 0;
             Pattern pattern = Pattern.compile( "(\\[\\d+\\.\\d+\\])" );
 
             Matcher matcher = pattern.matcher( formula );
@@ -1290,7 +1331,8 @@
                 int optionComboId = Integer.parseInt( optionComboIdStr );
 
                 DataElement dataElement = dataElementService.getDataElement( dataElementId );
-                DataElementCategoryOptionCombo optionCombo = dataElementCategoryOptionComboService.getDataElementCategoryOptionCombo( optionComboId );
+                DataElementCategoryOptionCombo optionCombo = dataElementCategoryOptionComboService
+                    .getDataElementCategoryOptionCombo( optionComboId );
 
                 if ( dataElement == null || optionCombo == null )
                 {
@@ -1303,9 +1345,13 @@
                 // organisationUnit, dataElement, period,
                 // optionCombo );
                 // st1 = con.createStatement();
-                
-                //System.out.println( "Before getting value : OrganisationUnit Name : " + organisationUnit.getName() + ", Period is : " + period.getId() + ", DataElement Name : " + dataElement.getName() + ", Record No: " + recordNo );
-               
+
+                // System.out.println(
+                // "Before getting value : OrganisationUnit Name : " +
+                // organisationUnit.getName() + ", Period is : " +
+                // period.getId() + ", DataElement Name : " +
+                // dataElement.getName() + ", Record No: " + recordNo );
+
                 query = "SELECT value FROM lldatavalue WHERE sourceid = " + organisationUnit.getId()
                     + " AND periodid = " + period.getId() + " AND dataelementid = " + dataElement.getId()
                     + " AND recordno = " + recordNo;
@@ -1371,8 +1417,8 @@
         }// finally block end
     }
 
-
-    public List<Integer> getLinelistingMateralanRecordNos( OrganisationUnit organisationUnit, Period period, String lltype )
+    public List<Integer> getLinelistingMateralanRecordNos( OrganisationUnit organisationUnit, Period period,
+        String lltype )
     {
         List<Integer> recordNosList = new ArrayList<Integer>();
 
@@ -1384,7 +1430,7 @@
         {
             dataElementid = 1032;
         }
-      
+
         try
         {
             query = "SELECT recordno FROM lldatavalue WHERE dataelementid = " + dataElementid + " AND periodid = "
@@ -1406,6 +1452,5 @@
 
         return recordNosList;
     }
-    
-    
+
 }

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/malarya/action/GenerateMalaryaReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/malarya/action/GenerateMalaryaReportResultAction.java	2010-07-13 09:28:43 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/malarya/action/GenerateMalaryaReportResultAction.java	2011-07-07 10:56:12 +0000
@@ -53,8 +53,8 @@
 import jxl.format.BorderLineStyle;
 import jxl.format.CellFormat;
 import jxl.write.Formula;
+import jxl.write.Label;
 import jxl.write.Number;
-import jxl.write.Label;
 import jxl.write.WritableCell;
 import jxl.write.WritableCellFormat;
 import jxl.write.WritableSheet;
@@ -63,6 +63,7 @@
 import org.amplecode.quick.StatementManager;
 import org.apache.velocity.tools.generic.MathTool;
 import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -369,9 +370,17 @@
 
         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
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
-        
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator  + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+
         //System.out.println("RA FOLDER IS : \t" + raFolderName);
         
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/meta/action/GenerateMetaDataReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/meta/action/GenerateMetaDataReportResultAction.java	2011-05-18 11:56:37 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/meta/action/GenerateMetaDataReportResultAction.java	2011-07-07 10:56:12 +0000
@@ -24,6 +24,7 @@
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
@@ -315,8 +316,16 @@
         // Coding For Printing MetaData
         // ----------------------------------------------------------------------
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
 
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "Summary Report", 0 );
@@ -425,8 +434,16 @@
         List<DataElement> dataElementList = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
         Collections.sort( dataElementList, new DataElementNameComparator() );
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+       // String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
 
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "DataElements", 0 );
@@ -559,8 +576,16 @@
         List<DataElementGroup> dataElementGroupList = new ArrayList<DataElementGroup>( dataElementService
             .getAllDataElementGroups() );
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
 
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "DataElementsGroupWiseList", 0 );
@@ -719,8 +744,16 @@
     {
         List<OrganisationUnitGroup> orgUnitGroupList = new ArrayList<OrganisationUnitGroup>(
             organisationUnitgroupService.getAllOrganisationUnitGroups() );
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
 
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "OrganisationUnitGroupWiseList", 0 );
@@ -936,7 +969,16 @@
 
         List<OrganisationUnit> OrganisitionUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( rootOrgUnit.getId() ) );
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
 
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "OrganisationUnit", 0 );
@@ -1027,7 +1069,15 @@
 
         List<OrganisationUnit> OrganisitionUnitList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( rootOrgUnit.getId() ) );
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
 
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "OrganisationUnit", 0 );
@@ -1231,8 +1281,16 @@
         List<Indicator> indicatorList = new ArrayList<Indicator>( indicatorService.getAllIndicators() );
         Collections.sort( indicatorList, new IndicatorNameComparator() );
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+       // String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator  + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+       
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
 
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "Indicators", 0 );
@@ -1340,8 +1398,16 @@
         List<IndicatorGroup> indicatorGroupList = new ArrayList<IndicatorGroup>( indicatorService
             .getAllIndicatorGroups() );
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator  + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+       
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
 
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "IndicatorGroupWiseList", 0 );
@@ -1471,8 +1537,16 @@
         List<DataSet> datasetList = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
         Collections.sort( datasetList, new DataSetNameComparator() );
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
 
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "DataSets", 0 );
@@ -1552,8 +1626,16 @@
             .getAllValidationRules() );
         Collections.sort( validationRuleList, new ValidationRuleNameComparator() );
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator  + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
 
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "ValidationRule", 0 );
@@ -1653,8 +1735,16 @@
         List<ValidationRuleGroup> validationRuleGroupList = new ArrayList<ValidationRuleGroup>( validationRuleService
             .getAllValidationRuleGroups() );
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
 
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "ValidationRuleGroupWiseList", 0 );
@@ -1777,8 +1867,16 @@
     {
         List<User> userList = new ArrayList<User>( userStore.getAllUsers() );
 
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator  + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
 
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "UserInfo", 0 );

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/mobile/action/GenerateMobileReportAnalyserResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/mobile/action/GenerateMobileReportAnalyserResultAction.java	2011-01-11 12:10:34 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/mobile/action/GenerateMobileReportAnalyserResultAction.java	2011-07-07 10:56:12 +0000
@@ -22,6 +22,7 @@
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -148,8 +149,16 @@
     public void generateMobileReport()
     throws Exception
     {
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
         
         WritableSheet sheet0 = outputReportWorkbook.createSheet( "MobileReport", 0 );

=== modified 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	2011-04-15 11:39:32 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/nbits/action/NBITSReportResultAction.java	2011-07-07 10:56:12 +0000
@@ -26,6 +26,7 @@
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.i18n.I18nFormat;
@@ -214,7 +215,16 @@
         int rowCount = rowStart;
         int colCount = colStart;
         
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ) );
         WritableSheet sheet0 = outputReportWorkbook.createSheet( selProgram.getName(), 0 );
 

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/orgunitgroupsetreport/action/GenerateOrgunitGroupsetReportsResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/orgunitgroupsetreport/action/GenerateOrgunitGroupsetReportsResultAction.java	2011-04-27 17:15:13 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/orgunitgroupsetreport/action/GenerateOrgunitGroupsetReportsResultAction.java	2011-07-07 10:56:12 +0000
@@ -53,8 +53,8 @@
 import jxl.format.CellFormat;
 import jxl.format.VerticalAlignment;
 import jxl.write.Formula;
+import jxl.write.Label;
 import jxl.write.Number;
-import jxl.write.Label;
 import jxl.write.WritableCell;
 import jxl.write.WritableCellFormat;
 import jxl.write.WritableSheet;
@@ -62,6 +62,7 @@
 
 import org.amplecode.quick.StatementManager;
 import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -362,7 +363,16 @@
             colList = new ArrayList<Integer>();
         
             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 + "output" + File.separator + UUID.randomUUID().toString() + ".xls";           
+            //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";           
+            
+            String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+            File newdir = new File( outputReportPath );
+            if( !newdir.exists() )
+            {
+                newdir.mkdirs();
+            }
+            outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+            
             Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
             WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ), templateWorkbook );
             

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ouwiseprogress/action/GenerateOuWiseProgressReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ouwiseprogress/action/GenerateOuWiseProgressReportResultAction.java	2011-06-22 11:32:06 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ouwiseprogress/action/GenerateOuWiseProgressReportResultAction.java	2011-07-07 10:56:12 +0000
@@ -27,7 +27,6 @@
 import jxl.format.BorderLineStyle;
 import jxl.format.Colour;
 import jxl.format.VerticalAlignment;
-import jxl.write.Formula;
 import jxl.write.Label;
 import jxl.write.Number;
 import jxl.write.WritableCellFormat;
@@ -36,6 +35,7 @@
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataset.DataSet;
@@ -233,7 +233,16 @@
         System.out.println( selectedOrgUnit.getName()+ " : " + selReportObj.getName()+" : Report Generation Start Time is : " + new Date() );
 
         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 + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
 
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ), templateWorkbook );

=== 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	2011-04-29 13:45:23 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/periodwiseprogress/action/GeneratePeriodWiseProgressAnalyserResultAction.java	2011-07-07 10:56:12 +0000
@@ -35,6 +35,7 @@
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataset.DataSet;
@@ -226,7 +227,16 @@
         String reportFileNameTB = selReportObj.getExcelTemplateName();
 
         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 + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
 
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ), templateWorkbook );

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/physical/action/GeneratePhysicalReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/physical/action/GeneratePhysicalReportResultAction.java	2011-04-15 11:39:32 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/physical/action/GeneratePhysicalReportResultAction.java	2011-07-07 10:56:12 +0000
@@ -28,6 +28,7 @@
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
@@ -192,8 +193,18 @@
 
         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
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+       // String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
 
         WritableWorkbook outputReportWorkbook = Workbook

=== 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	2011-03-01 08:37:19 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/portal/action/PortalReportsResultAction.java	2011-07-07 10:56:12 +0000
@@ -12,6 +12,7 @@
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -28,23 +29,33 @@
 import jxl.format.Border;
 import jxl.format.BorderLineStyle;
 import jxl.format.VerticalAlignment;
+import jxl.write.Label;
+import jxl.write.WritableCell;
 import jxl.write.WritableCellFormat;
 import jxl.write.WritableSheet;
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
-import org.apache.velocity.tools.generic.MathTool;
+import org.hisp.dhis.config.Configuration_IN;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 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.patientattributevalue.PatientAttributeValue;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValueService;
+import org.hisp.dhis.patientdatavalue.PatientDataValue;
 import org.hisp.dhis.patientdatavalue.PatientDataValueService;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
@@ -66,17 +77,6 @@
 import org.xml.sax.SAXParseException;
 
 import com.opensymphony.xwork2.Action;
-import java.util.Collections;
-import jxl.write.Label;
-import jxl.write.WritableCell;
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
-import org.hisp.dhis.patient.PatientIdentifier;
-import org.hisp.dhis.patient.PatientIdentifierType;
-import org.hisp.dhis.patient.PatientIdentifierTypeService;
-import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
-import org.hisp.dhis.patientdatavalue.PatientDataValue;
 
 public class PortalReportsResultAction implements Action
 {
@@ -367,7 +367,17 @@
         }
         simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
         inputTemplatePath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "template" + File.separator + reportFileNameTB;
-        outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+       
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+
+        
         System.out.println( " reportList " + reportList );
 
         generatPortalReport();

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ranking/action/GenerateRankingReportResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ranking/action/GenerateRankingReportResultAction.java	2010-07-13 09:28:43 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/ranking/action/GenerateRankingReportResultAction.java	2011-07-07 10:56:12 +0000
@@ -6,6 +6,7 @@
 import java.io.InputStream;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
@@ -32,6 +33,7 @@
 
 import org.amplecode.quick.StatementManager;
 import org.hisp.dhis.aggregation.AggregationService;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -57,8 +59,6 @@
 
 import com.opensymphony.xwork2.Action;
 
-import java.util.Collections;
-
 public class GenerateRankingReportResultAction implements Action
 {
     private static final String NULL_REPLACEMENT = "0";
@@ -221,7 +221,16 @@
         String xmlTemplateName = "ranking.xml";
 
         String inputTemplatePath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "template" + File.separator + excelTemplateName;
-        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         Workbook templateWorkbook = Workbook.getWorkbook( new File( inputTemplatePath ) );
         WritableWorkbook outputReportWorkbook = Workbook.createWorkbook( new File( outputReportPath ), templateWorkbook );
     

=== 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	2011-04-29 13:45:23 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/routine/action/GenerateRoutineReportAnalyserResultAction.java	2011-07-07 10:56:12 +0000
@@ -32,6 +32,7 @@
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
@@ -207,11 +208,17 @@
         reportModelTB = selReportObj.getModel();
         reportFileNameTB = selReportObj.getExcelTemplateName();
         
-        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
-            + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
-
+        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 + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         if( reportModelTB.equalsIgnoreCase( "DYNAMIC-ORGUNIT" ) )
         {
             OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit( ouIDTB );

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/upward/action/GenerateUpwardReportAnalyserResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/upward/action/GenerateUpwardReportAnalyserResultAction.java	2011-04-15 11:39:32 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/upward/action/GenerateUpwardReportAnalyserResultAction.java	2011-07-07 10:56:12 +0000
@@ -32,6 +32,7 @@
 import jxl.write.WritableWorkbook;
 
 import org.amplecode.quick.StatementManager;
+import org.hisp.dhis.config.Configuration_IN;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -189,8 +190,16 @@
         
 
         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 + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
-
+        //String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "output" + File.separator + UUID.randomUUID().toString() + ".xls";
+        
+        String outputReportPath = System.getenv( "DHIS2_HOME" ) + File.separator +  Configuration_IN.DEFAULT_TEMPFOLDER;
+        File newdir = new File( outputReportPath );
+        if( !newdir.exists() )
+        {
+            newdir.mkdirs();
+        }
+        outputReportPath += File.separator + UUID.randomUUID().toString() + ".xls";
+        
         if ( reportModelTB.equalsIgnoreCase( "DYNAMIC-ORGUNIT" ) )
         {
             OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit( ouIDTB );