← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2222: Bug Fixed: In Linelisting reports no linelisting data displayed; aggregated data was TextFormat

 

------------------------------------------------------------
revno: 2222
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-09-24 11:54:45 +0530
message:
  Bug Fixed: In Linelisting reports no linelisting data displayed; aggregated data was TextFormat
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/linelisting/action/GenerateLinelistingReportAnalyserResultAction.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	2010-09-18 12:30:36 +0000
+++ local/in/dhis-in-services/dhis-in-service-reports/src/main/java/org/hisp/dhis/reports/DefaultReportService.java	2010-09-24 06:24:45 +0000
@@ -229,18 +229,19 @@
 
         int dataElementid = 1020;
 
-        if ( lltype.equalsIgnoreCase( "lldeath-l4DECodes.xml" )
-            || lltype.equalsIgnoreCase( "lllivebirth-l5DECodes.xml" )
-            || lltype.equalsIgnoreCase( "lllivebirth-l6DECodes.xml" ) )
+        if ( lltype.equalsIgnoreCase( "lllivebirth-l4DECodes.xml" ) || lltype.equalsIgnoreCase( "lllivebirth-l5DECodes.xml" ) || lltype.equalsIgnoreCase( "lllivebirth-l6DECodes.xml" ) )
+        {
             dataElementid = 1020;
-        else if ( lltype.equalsIgnoreCase( "lldeath-l4DECodes.xml" )
-            || lltype.equalsIgnoreCase( "lldeath-l5DECodes.xml" ) || lltype.equalsIgnoreCase( "lldeath-l6DECodes.xml" ) )
-            dataElementid = 1027;
-        else if ( lltype.equalsIgnoreCase( "llmaternaldeath-l4DECodes.xml" )
-            || lltype.equalsIgnoreCase( "llmaternaldeath-l5DECodes.xml" )
-            || lltype.equalsIgnoreCase( "llmaternaldeath-l6DECodes.xml" ) )
+        }
+        else if ( lltype.equalsIgnoreCase( "lldeath-l4DECodes.xml" ) || lltype.equalsIgnoreCase( "lldeath-l5DECodes.xml" ) || lltype.equalsIgnoreCase( "lldeath-l6DECodes.xml" ) )
+        {
+           dataElementid = 1027;
+        }
+        else if ( lltype.equalsIgnoreCase( "llmaternaldeath-l4DECodes.xml" ) || lltype.equalsIgnoreCase( "llmaternaldeath-l5DECodes.xml" ) || lltype.equalsIgnoreCase( "llmaternaldeath-l6DECodes.xml" ) )
+        {
             dataElementid = 1032;
-
+        }
+        
         try
         {
             query = "SELECT recordno FROM lldatavalue WHERE dataelementid = " + dataElementid + " AND periodid = "
@@ -266,6 +267,7 @@
     public List<Report_inDesign> getReportDesign( Report_in report )
     {
         List<Report_inDesign> deCodes = new ArrayList<Report_inDesign>();
+        
         String raFolderName = configurationService.getConfigurationByKey( Configuration_IN.KEY_REPORTFOLDER )
             .getValue();
 

=== 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-08-28 10:15:38 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/linelisting/action/GenerateLinelistingReportAnalyserResultAction.java	2010-09-24 06:24:45 +0000
@@ -30,6 +30,7 @@
 import jxl.format.CellFormat;
 import jxl.format.VerticalAlignment;
 import jxl.write.Label;
+import jxl.write.Number;
 import jxl.write.WritableCell;
 import jxl.write.WritableCellFormat;
 import jxl.write.WritableSheet;
@@ -444,7 +445,7 @@
 
         // OrgUnit Info
         currentOrgUnit = organisationUnitService.getOrganisationUnit( ouIDTB );
-        llrecordNos = reportService.getLinelistingRecordNos( currentOrgUnit, selectedPeriod, reportList );
+        llrecordNos = reportService.getLinelistingRecordNos( currentOrgUnit, selectedPeriod, deCodesXMLFileName );
 
         // Getting DataValues
         dataValueList = new ArrayList<String>();
@@ -655,18 +656,38 @@
                         if ( cellFormat != null )
                         {
                             if ( tempMergeCol > 0 || tempMergeRow > 0 )
-                                sheet0.mergeCells( tempColNo, tempRowNo, tempColNo + tempMergeCol, tempRowNo
-                                    + tempMergeRow );
-                            sheet0.addCell( new Label( tempColNo, tempRowNo, tempStr, cellFormat ) );
-                            System.out.println( "In Pre-Formatted: " + tempStr );
+                            {
+                                sheet0.mergeCells( tempColNo, tempRowNo, tempColNo + tempMergeCol, tempRowNo + tempMergeRow );
+                            }
+                            
+                            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 ( tempMergeCol > 0 || tempMergeRow > 0 )
-                                sheet0.mergeCells( tempColNo, tempRowNo, tempColNo + tempMergeCol, tempRowNo
-                                    + tempMergeRow );
-                            sheet0.addCell( new Label( tempColNo, tempRowNo, tempStr, getCellFormat1() ) );
-                            System.out.println( "In Cur-Formatted: " + tempStr );
+                            {
+                                sheet0.mergeCells( tempColNo, tempRowNo, tempColNo + tempMergeCol, tempRowNo + tempMergeRow );
+                            }
+                            
+                            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 );
                         }
                     }