← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2985: Fixed bug <731078> data-browser-export-to-excel-fails-with-NPE

 

------------------------------------------------------------
revno: 2985
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-03-08 14:16:52 +0700
message:
  Fixed bug <731078> data-browser-export-to-excel-fails-with-NPE
modified:
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ExcelUtils.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserResult.vm


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ExcelUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ExcelUtils.java	2011-02-18 12:26:26 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ExcelUtils.java	2011-03-08 07:16:52 +0000
@@ -369,7 +369,11 @@
 
                 for ( String rowItem : rows )
                 {
-                    if ( rowItem.trim().matches( "0" ) )
+                    if ( rowItem == null )
+                    {
+                        rowItem = "";
+                    }
+                    else if ( rowItem.trim().matches( "0" ) )
                     {
                         cellFormat.setFont( zeroFont );
                     }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserResult.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserResult.vm	2011-02-22 13:09:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserResult.vm	2011-03-08 07:16:52 +0000
@@ -163,7 +163,7 @@
 				<td style="min-width:200px">$rowMeta.name</td>
 			#end
 			#foreach ( $rowItem in $col )
-				<td style="min-width:80px;text-align:right" title="$rowItem $i18n.getString('no_hits')">#if ( $rowItem == "0" )<span style="color:red;font-weight:bold;">$rowItem</span> #else<span style="color:blue;font-weight:bold;">$rowItem</span> #end</td>
+				<td style="min-width:80px;text-align:right" title="$!rowItem $i18n.getString('no_hits')">#if ( $!rowItem == "0" )<span style="color:red;font-weight:bold;">$!rowItem</span> #else<span style="color:blue;font-weight:bold;">$!rowItem</span> #end</td>
 			#end
 			</tr>
 		#end