← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 828: Minor fixed ...

 

------------------------------------------------------------
revno: 828
committer: hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2009-10-07 12:38:43 +0700
message:
  Minor fixed ...
modified:
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/utils/ExcelUtils.java
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.
=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/utils/ExcelUtils.java'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/utils/ExcelUtils.java	2009-10-05 03:03:05 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/utils/ExcelUtils.java	2009-10-07 05:38:43 +0000
@@ -64,29 +64,25 @@
         WritableCellFormat format )
         throws RowsExceededException, WriteException
     {
-
         if ( row > 0 && column > 0 )
         {
             if ( type.equalsIgnoreCase( TEXT ) )
             {
-                sheet.addCell( new Label( column - 1, row - 1, value == null ? "" : value, format ) );
+                sheet.addCell( new Label( column - 1, row - 1, (value == null ? "" : value), format ) );
             }
-            if ( type.equalsIgnoreCase( NUMBER ) )
+            else if ( type.equalsIgnoreCase( NUMBER ) )
             {
                 double v = Double.parseDouble( value );
                 if ( v != 0 )
                 {
                     sheet.addCell( new Number( column - 1, row - 1, v, format ) );
-
                 }
                 else
                 {
-
                     sheet.addCell( new Blank( column - 1, row - 1, format ) );
                 }
             }
         }
-
     }
 
     public static Cell getValue( int row, int column, Sheet sheet )
@@ -136,7 +132,7 @@
         if ( row > 0 && column > 0 )
         {
             HSSFRow rowPOI = sheet.getRow( row - 1 );
-
+            
             if ( rowPOI == null )
             {
                 rowPOI = sheet.createRow( row - 1 );
@@ -149,11 +145,9 @@
             {
                 cellPOI.setCellValue( new HSSFRichTextString( value ) );
             }
-            if ( type.equalsIgnoreCase( ExcelUtils.NUMBER ) )
+            else if ( type.equalsIgnoreCase( ExcelUtils.NUMBER ) )
             {
-                double v = Double.parseDouble( value );
-
-                if ( v != 0 )
+                if ( Double.parseDouble( value ) != 0 )
                 {
                     cellPOI.setCellValue( new HSSFRichTextString( value ) );
                 }

=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js	2009-10-07 03:47:57 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/export.js	2009-10-07 05:38:43 +0000
@@ -82,7 +82,7 @@
 	
 }
 
-function openGenerateAdvance(  ){		
+function openGenerateAdvance() {
 		
 	if(byId('advancedCheck').checked)
 	{
@@ -171,8 +171,6 @@
 function openPreviewReport() {
 	
 	var reportId = $('#report').val();
-
-	var periodId = $('#period').val();
-
-	window.open("openPreviewReport.action?reportId=" + reportId + "&periodId=" + periodId, "_blank", "width=900,height=600,scrollbars=yes,menubar=yes,resizable=yes");
+	var periodId = $('#period').val();	
+	window.open("openPreviewReport.action?reportId=" + reportId + "&periodId=" + periodId + "&sheetId=1", "_blank", "width=900,height=600,scrollbars=yes,menubar=yes,resizable=yes");
 }