Changeset 1122


Ignore:
Timestamp:
Nov 11, 2010, 2:53:12 PM (6 years ago)
Author:
t.w.abma@…
Message:
  • preview fixed (sometimes didn't show all values read from Excel), now shows all data
Location:
trunk/grails-app
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy

    r1121 r1122  
    8989        session.importer_study = Study.get(params.study.id.toInteger())
    9090       
     91        // Is the current logged in user allowed to write to this study?
    9192        if (session.importer_study.canWrite(AuthenticationService.getLoggedInUser())) {
    9293            session.importer_template_id = params.template_id
  • trunk/grails-app/services/dbnp/importer/ImporterService.groovy

    r1121 r1122  
    150150        def sheet = wb.getSheetAt(sheetindex)
    151151        def rows  = []
    152         def df = new DataFormatter()   
    153 
    154         // walk through all rows
    155         (count <= sheet.getLastRowNum()) ?
     152        def df = new DataFormatter()
     153
     154        count = (count < sheet.getLastRowNum()) ? count : sheet.getLastRowNum()
     155
     156        // walk through all rows       
    156157        ((datamatrix_start+sheet.getFirstRowNum())..count).each { rowindex ->
    157158            def row = []
     
    167168                //row.add(df.formatCellValue(c))
    168169                row.add(c)
    169                 //if (c.getCellType() == c.CELL_TYPE_STRING) println "STR"+c.getStringCellValue()
    170                 //if (c.getCellType() == c.CELL_TYPE_NUMERIC) println "INT" +c.getNumericCellValue()
    171170            }
    172                 //row.add(df.formatCellValue(c))
    173171            rows.add(row)
    174         } : 0
     172        }
    175173
    176174        return rows
     
    232230            // the record hashcode is later on used to put the failed data back
    233231            // in the data matrix           
    234             if (failed.importcells.size()>0) failedcells.put(record.hashCode(), failed)
     232            if (failed.importcells?.size()>0) failedcells.put(record.hashCode(), failed)
    235233        }
    236234
     
    442440                                }
    443441
    444 
    445442                                //println "temateplfedielfdtype=" + mc.templatefieldtype
    446443                                // Are we trying to map an ontology term which is empty? Then it is a failed cell
Note: See TracChangeset for help on using the changeset viewer.