← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7484: local/in Minor changes in NRHM Reports module

 

------------------------------------------------------------
revno: 7484
committer: Gaurav <gaurav08021@xxxxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-07-02 17:05:09 +0530
message:
  local/in Minor changes in NRHM Reports module
modified:
  local/in/dhis-in-services/dhis-in-service-reports/src/main/java/org/hisp/dhis/reports/DefaultReportService.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-in-services/dhis-in-service-reports/src/main/java/org/hisp/dhis/reports/DefaultReportService.java'
--- local/in/dhis-in-services/dhis-in-service-reports/src/main/java/org/hisp/dhis/reports/DefaultReportService.java	2012-06-30 10:19:34 +0000
+++ local/in/dhis-in-services/dhis-in-service-reports/src/main/java/org/hisp/dhis/reports/DefaultReportService.java	2012-07-02 11:35:09 +0000
@@ -449,11 +449,7 @@
                
                 // ------------------------replace global values------------------------------------------------                
 
-                System.out.println("\n*INFO :<< CHECKING CONFIG FILE SETUP(1) >>");
-                System.out.println("*INFO :Global Value: "+expression);
                 expression = getGlobalExpression(expression,globalValuesMap);
-                System.out.println("*INFO :Local Value: "+expression);
-                System.out.println("*INFO :<<CHECK FINISHED>>\n");
 
                 // ---------------------------------------------------------------------------------------------
                 
@@ -753,7 +749,7 @@
                 {
                     Double aggregatedValue = aggregationService.getAggregatedDataValue( dataElement, optionCombo,
                         startDate, endDate, organisationUnit );
-                    //System.out.println( dataElement.getId() + " : " + optionCombo.getId() + " : " + startDate + " : " + endDate + " : " + organisationUnit + " : " + aggregatedValue);
+
                     if ( aggregatedValue == null )
                     {
                         replaceString = NULL_REPLACEMENT;
@@ -769,7 +765,7 @@
                 {
                     deFlag1 = 1;
                     PeriodType dePeriodType = getDataElementPeriodType( dataElement );
-                    //List<Period> periodList = new ArrayList<Period>( periodService.getIntersectingPeriodsByPeriodType( dePeriodType, startDate, endDate ) );
+
                     List<Period> periodList = new ArrayList<Period>( periodService.getPeriodsBetweenDates( dePeriodType, startDate, endDate ) );
                     Period tempPeriod = new Period();
                     if ( periodList == null || periodList.isEmpty() )
@@ -914,7 +910,6 @@
                 {
 
                     PeriodType dePeriodType = getDataElementPeriodType( dataElement );
-                    //List<Period> periodList = new ArrayList<Period>( periodService.getIntersectingPeriodsByPeriodType( dePeriodType, startDate, endDate ) );
                     List<Period> periodList = new ArrayList<Period>( periodService.getPeriodsBetweenDates( dePeriodType, startDate, endDate ) );
 
                     if ( periodList == null || periodList.isEmpty() )
@@ -945,7 +940,7 @@
                 {
                     deFlag1 = 1;
                     PeriodType dePeriodType = getDataElementPeriodType( dataElement );
-                    //List<Period> periodList = new ArrayList<Period>( periodService.getIntersectingPeriodsByPeriodType( dePeriodType, startDate, endDate ) );
+
                     List<Period> periodList = new ArrayList<Period>( periodService.getPeriodsBetweenDates( dePeriodType, startDate, endDate ) );
                     Period tempPeriod = new Period();
                     if ( periodList == null || periodList.isEmpty() )
@@ -1049,7 +1044,7 @@
         }
     }
     
-     // functoin getBooleanDataValue stsrt
+     // Function getBooleanDataValue Start
     
     public String getBooleanDataValue( String formula, Date startDate, Date endDate, OrganisationUnit organisationUnit , String reportModelTB )
     {
@@ -1089,7 +1084,7 @@
                     deFlag1 = 1;
                     deFlag2 = 0;
                     PeriodType dePeriodType = getDataElementPeriodType( dataElement );
-                    //List<Period> periodList = new ArrayList<Period>( periodService.getIntersectingPeriodsByPeriodType( dePeriodType, startDate, endDate ) );
+
                     List<Period> periodList = new ArrayList<Period>( periodService.getPeriodsBetweenDates( dePeriodType, startDate, endDate ) );
                     Period tempPeriod = new Period();
                     if ( periodList == null || periodList.isEmpty() )
@@ -1187,10 +1182,10 @@
         }
     }
     
- // functoin getBooleanDataValue end
-    
-    
-//function getStartingEndingPeriods starts
+ // Function getBooleanDataValue End
+    
+    
+ // Function getStartingEndingPeriods Starts
     
 public List<Calendar> getStartingEndingPeriods( String deType , Period selectedPeriod )
 {
@@ -1345,7 +1340,7 @@
     return calendarList;
 }
     
-//function getPreviousPeriod starts
+//Function getPreviousPeriod Starts
 public Period getPreviousPeriod( Period selectedPeriod )
 {
     Period period = new Period();
@@ -1619,11 +1614,7 @@
 
             // ------------------------replace global values------------------------------------------------
 
-            System.out.println("\n*INFO :<< CHECKING CONFIG FILE SETUP(3) >>");
-            System.out.println("*INFO :Global Value: "+expression);
             expression = getGlobalExpression(expression, globalValuesMap);
-            System.out.println("*INFO :Local Value: "+expression);
-            System.out.println("*INFO :<<CHECK FINISHED>>\n");
 
             // ---------------------------------------------------------------------------------------------
 
@@ -1637,8 +1628,10 @@
 
             Report_inDesign report_inDesign = new Report_inDesign( stype, ptype, sheetno, rowno, colno, rowMerge, colMerge, expression );
             reportDesignList.add( report_inDesign );
-        }// end of for loop with s var
-    }// try block end
+        }
+        // end of for loop with s var
+    }
+    // try block end
     catch ( SAXParseException err )
     {
         System.out.println( "** Parsing error" + ", line " + err.getLineNumber() + ", uri " + err.getSystemId() );

=== 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	2012-06-30 10:19:34 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/upward/action/GenerateUpwardReportAnalyserResultAction.java	2012-07-02 11:35:09 +0000
@@ -164,10 +164,11 @@
 
 
         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);
+
+        File newdir=new File(outputReportPath);
+
         if (!newdir.exists()) {
             newdir.mkdirs();
         }
@@ -307,7 +308,8 @@
                     wCellformat.setAlignment(Alignment.CENTRE);
 
                     sheet0.addCell(new Blank(tempColNo, tempRowNo, wCellformat));
-                } else {
+                }
+                else {
                     if (reportModelTB.equalsIgnoreCase("DYNAMIC-ORGUNIT")) {
                         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")) {
@@ -324,6 +326,9 @@
 
                     WritableCell cell = sheet0.getWritableCell(tempColNo, tempRowNo);
 
+                    System.out.println("\n* TESTING: ["+cell.getCellFeatures()+"]");
+                    System.out.println("* TESTING : Cell Content ["+tempStr+"]\n");
+
                     CellFormat cellFormat = cell.getCellFormat();
                     WritableCellFormat wCellformat = new WritableCellFormat();
                     wCellformat.setBorder(Border.ALL, BorderLineStyle.THIN);
@@ -343,6 +348,8 @@
                     }
                 }
 
+                outputReportWorkbook.write();
+
                 count1++;
             }// inner while loop end
             orgUnitCount++;