Ignore:
Timestamp:
Mar 24, 2010, 4:01:18 PM (11 years ago)
Author:
tabma
Message:
  • uniquely identified column selection moved to first page and changed to radio
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/dbnp/importer/ImporterService.groovy

    r307 r312  
    5959
    6060        for (HSSFCell c: sheet.getRow(datamatrix_start)) {
    61             def datamatrix_celltype = sheet.getRow(datamatrix_start).getCell(c.getColumnIndex()).getCellType()
    62             def headercell = sheet.getRow(sheet.getFirstRowNum()).getCell(c.getColumnIndex())
     61            def index   =   c.getColumnIndex()
     62            def datamatrix_celltype = sheet.getRow(datamatrix_start).getCell(index).getCellType()
     63            def headercell = sheet.getRow(sheet.getFirstRowNum()).getCell(index)
    6364
    6465            // Check for every celltype, currently redundant code, but possibly this will be
     
    6768            switch (datamatrix_celltype) {
    6869                    case HSSFCell.CELL_TYPE_STRING:
    69                             header[c.getColumnIndex()] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.STRING);
     70                            header[index] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.STRING, index:index);
    7071                            break
    7172                    case HSSFCell.CELL_TYPE_NUMERIC:                   
    7273                            if (HSSFDateUtil.isCellDateFormatted(c)) {
    73                                 header[c.getColumnIndex()] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.DATE)
     74                                header[index] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.DATE, index:index)
    7475                            }
    7576                            else
    76                                 header[c.getColumnIndex()] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.INTEGER);
     77                                header[index] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.INTEGER,index:index);
    7778                            break
    7879                    case HSSFCell.CELL_TYPE_BLANK:
    79                             header[c.getColumnIndex()] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.STRING);
     80                            header[index] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.STRING, index:index);
    8081                            break
    8182                    default:
    82                             header[c.getColumnIndex()] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.STRING);
     83                            header[index] = new dbnp.importer.MappingColumn(name:df.formatCellValue(headercell), templatefieldtype:TemplateFieldType.STRING,index:index);
    8384                            break
    8485            }
Note: See TracChangeset for help on using the changeset viewer.