[jboss-jira] [JBoss JIRA] (DROOLS-556) Merged cells referencing other cells not parsed correctly in decision tables

Winfried Umbrath (JIRA) issues at jboss.org
Wed Jul 16 05:32:29 EDT 2014


Winfried Umbrath created DROOLS-556:
---------------------------------------

             Summary: Merged cells referencing other cells not parsed correctly in decision tables
                 Key: DROOLS-556
                 URL: https://issues.jboss.org/browse/DROOLS-556
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions: 6.1.0.CR2, 6.0.1.Final
            Reporter: Winfried Umbrath
            Assignee: Mark Proctor


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.



--
This message was sent by Atlassian JIRA
(v6.2.6#6264)


More information about the jboss-jira mailing list