Changeset 684
- Timestamp:
- Jul 21, 2010, 2:47:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/services/dbnp/importer/ImporterService.groovy
r669 r684 172 172 (0..header.size()-1).each { columnindex -> 173 173 def c = sheet.getRow(rowindex).getCell(columnindex, org.apache.poi.ss.usermodel.Row.CREATE_NULL_AS_BLANK) 174 //row.add(df.formatCellValue(c)) 174 175 row.add(c) 175 176 //if (c.getCellType() == c.CELL_TYPE_STRING) println "STR"+c.getStringCellValue() … … 210 211 211 212 /** 212 * Method to read data from a workbook and to import data into the database213 * by using mapping information213 * Method to read data from a workbook and to import data into a two dimensional 214 * array 214 215 * 215 216 * @param template_id template identifier to use fields from … … 312 313 def value 313 314 315 // Check if column must be imported 314 316 if (!mc.dontimport) { 315 /*try {316 317 try { 318 value = formatValue(df.formatCellValue(cell), mc.templatefieldtype) 317 319 } catch (NumberFormatException nfe) { 318 320 value = "" 319 }*/ 320 value = df.formatCellValue(cell) 321 } 321 322 322 323 switch(mc.entity) { … … 351 352 case TemplateFieldType.STRING : return value.trim() 352 353 case TemplateFieldType.TEXT : return value.trim() 353 case TemplateFieldType.INTEGER : return Integer.valueOf(value)354 case TemplateFieldType.INTEGER : return (int) Double.valueOf(value) 354 355 case TemplateFieldType.FLOAT : return Float.valueOf(value.replace(",",".")); 355 356 case TemplateFieldType.DOUBLE : return Double.valueOf(value.replace(",",".")); … … 360 361 } 361 362 } 363 362 364 }
Note: See TracChangeset
for help on using the changeset viewer.