[seam-commits] Seam SVN: r9756 - trunk/src/excel/org/jboss/seam/excel/jxl.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu Dec 11 15:53:36 EST 2008


Author: nickarls
Date: 2008-12-11 15:53:36 -0500 (Thu, 11 Dec 2008)
New Revision: 9756

Modified:
   trunk/src/excel/org/jboss/seam/excel/jxl/JXLHelper.java
Log:
JBSEAM-3834

Modified: trunk/src/excel/org/jboss/seam/excel/jxl/JXLHelper.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/jxl/JXLHelper.java	2008-12-11 11:48:34 UTC (rev 9755)
+++ trunk/src/excel/org/jboss/seam/excel/jxl/JXLHelper.java	2008-12-11 20:53:36 UTC (rev 9756)
@@ -638,9 +638,17 @@
       case text:
          return new Label(column, row, data.toString(), cellFormat);
       case number:
-         return new jxl.write.Number(column, row, Double.parseDouble(data.toString()), cellFormat);
+          try {
+              return new jxl.write.Number(column, row, Double.parseDouble(data.toString()), cellFormat);
+          } catch (NumberFormatException e) {
+              return new Label(column, row, "#not a number#", cellFormat);
+          }
       case date:
-         return new DateTime(column, row, (Date) data, cellFormat);
+          try {
+              return new DateTime(column, row, (Date) data, cellFormat);
+          } catch (ClassCastException e) {
+              return new Label(column, row, "#not a date#", cellFormat);
+          }
       case formula:
          return new Formula(column, row, data.toString(), cellFormat);
       case bool:




More information about the seam-commits mailing list