Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-556

Merged cells referencing other cells not parsed correctly in decision tables

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 6.0.1.Final, 6.1.0.CR2
    • None
    • None
    • Hide

      see description

      Show
      see description

      To reproduce:

      • in a decision table merge 2 cells with each other
      • in the merged cell create a reference to another cell e.g. "=D21"

      Result:
      The value of the merged cell is parsed as "D21"

      Expected result:
      The value of the merged cell should be the same as the referenced one

      The bug is in ExcelParser.processSheet. A quick fix is replacing

      Cell topLeft = sheet.getRow( merged.getFirstRow() ).getCell( merged.getFirstColumn() );
                          newCell( listeners,
                                   i,
                                   cellNum,
                                   formatter.formatCellValue( topLeft ),
                                   topLeft.getColumnIndex() );
      

      with

      if(topLeft.getCellType() == Cell.CELL_TYPE_FORMULA) {
                              newCell( listeners,
                                   i,
                                   cellNum,
                                   formatter.formatCellValue( topLeft, formulaEvaluator ),
                                   topLeft.getColumnIndex() );
                          } else {
                              newCell( listeners,
                                   i,
                                   cellNum,
                                   formatter.formatCellValue( topLeft ),
                                   topLeft.getColumnIndex() );
                          }
      

      There are probably some more cases missing as numeric referenced values seem to still not be parsed properly.

              mproctor@redhat.com Mark Proctor
              wumbrath2 Winfried Umbrath (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: