0

我正在使用 Olap4j 连接到 GWT 中的 OLAP 服务器。但是,当我尝试遍历行和列时,在编译过程中会出现“未找到符号”错误。

我的代码

for (Position axis_0 : cellSet.getAxes().get(Axis.COLUMNS.axisOrdinal()).getPositions()) {
            List<Member> mem0 = axis_0.getMembers();
            for (Position axis_1 : cellSet.getAxes().get(Axis.ROWS.axisOrdinal()).getPositions()) {
                List<Member> mem1 = axis_1.getMembers();
                Cell currentCell = cellSet.getCell(axis_0, axis_1);
                data = new HashMap();
                for (int i = 0; i < mem0.size(); i++) {
                    data.put(mem0.get(i).getDimension().getName().replaceAll(" ", ""), mem0.get(i).getUniqueName());
                }
                for (int i = 0; i < mem1.size(); i++) {
                    data.put(mem1.get(i).getDimension().getName().replaceAll(" ", ""), mem1.get(i).getUniqueName());
                }
                data.put("value", Float.parseFloat((currentCell.getValue()==null)?"0":currentCell.getValue().toString()));
                data.put("cellID", count);
                data.put("Scenarios", scenario);
                collection.add(data);
                count+=1;
            }
        }

错误

错误信息

4

1 回答 1

0

我能够通过像这样重组它来验证代码:

    CellSetAxis columnAxis = (CellSetAxis) cellSet.getAxes().get(Axis.COLUMNS.axisOrdinal());
    CellSetAxis rowAxis = (CellSetAxis) cellSet.getAxes().get(Axis.ROWS.axisOrdinal());
    List<Position> colPositions = columnAxis.getPositions();
    List<Position> rowPositions = rowAxis.getPositions();

    for (Position axis_0 : colPositions) {
        List<Member> mem0 = axis_0.getMembers();
        for (Position axis_1 : rowPositions) {
            List<Member> mem1 = axis_1.getMembers();
            Cell currentCell = cellSet.getCell(axis_0, axis_1);
            data = new HashMap();
            for (int i = 0; i < mem0.size(); i++) {
                data.put(mem0.get(i).getDimension().getName().replaceAll(" ", ""), mem0.get(i).getUniqueName());
            }
            for (int i = 0; i < mem1.size(); i++) {
                data.put(mem1.get(i).getDimension().getName().replaceAll(" ", ""), mem1.get(i).getUniqueName());
            }
            data.put("value", Float.parseFloat((currentCell.getValue()==null)?"0":currentCell.getValue().toString()));
            data.put("cellID", count);
            data.put("Scenarios", scenario);
            collection.add(data);
            count+=1;
        }
    }
于 2013-05-06T09:13:18.683 回答