/** * Iterates over the resust writing tabular rows. * * @param writer Writer * @throws org.xml.sax.SAXException on error */ private void iterate(SaxWriter writer) throws SAXException, OlapException { switch (axisCount) { case 0: // For MDX like: SELECT FROM Sales emitCell(writer, cellSet.getCell(posList)); return; default: // throw new SAXException("Too many axes: " + axisCount); iterate(writer, axisCount - 1, 0); break; } }
} else if (columnHandler instanceof CellColumnHandler) { columnHandler.write( writer, cellSet.getCell(posList), null); pos[0]++;// next col.
int ordinal) Cell cell = cellSet.getCell(pos); if (cell.isNull() && ordinal != 0) {
cellSet.getAxes().size(), 0); final MondrianOlap4jCell cell = (MondrianOlap4jCell) cellSet.getCell(coords);
@Override public List<?> next() throws TranslatorException { if (!rowPositionIterator.hasNext()) { return null; } Position rowPosition = rowPositionIterator.next(); Object[] result = new Object[colWidth]; int i = 0; // add in rows axis List<Member> members = rowPosition.getMembers(); for (Member member:members) { String columnName = member.getName(); result[i++] = columnName; } // add col axis for (Position colPos : columnsAxis) { Cell cell = cellSet.getCell(colPos, rowPosition); result[i++] = cell.getValue(); } if (returnsArray) { ArrayList<Object[]> results = new ArrayList<Object[]>(1); results.add(result); return results; } return Arrays.asList(result); }
public void updateCell() { FacesContext context = FacesContext.getCurrentInstance(); Map<String, String> parameters = context.getExternalContext() .getRequestParameterMap(); int ordinal = Integer.parseInt(parameters.get("cell")); String id = "input-" + ordinal; UIInput input = (UIInput) component.findComponent(id); Double value = (Double) input.getValue(); Cell cell = model.getCellSet().getCell(ordinal); try { cell.setValue(value, AllocationPolicy.EQUAL_ALLOCATION); } catch (OlapException e) { throw new FacesException(e); } model.refresh(); }
/** * @see org.pivot4j.ui.command.UICommand#execute(org.pivot4j.PivotModel , * org.pivot4j.ui.command.UICommandParameters) */ @Override public ResultSet execute(PivotModel model, UICommandParameters parameters) { int[] array = parameters.getCellCoordinate(); List<Integer> coords = Arrays.asList(ArrayUtils.toObject(array)); Cell cell = model.getCellSet().getCell(coords); try { return cell.drillThrough(); } catch (OlapException e) { throw new PivotException(e); } } }
/** * @see org.pivot4j.ui.command.BasicDrillThroughCommand#execute(org.pivot4j.PivotModel, * org.pivot4j.ui.command.UICommandParameters) */ @Override public ResultSet execute(PivotModel model, UICommandParameters parameters) { int[] array = parameters.getCellCoordinate(); List<Integer> coords = Arrays.asList(ArrayUtils.toObject(array)); Cell cell = model.getCellSet().getCell(coords); drillThroughHandler.update(cell); RequestContext context = RequestContext.getCurrentInstance(); context.update("drillthrough-form"); context.execute("PF('drillThroughDialog').show()"); return null; } }
cell = context.getCellSet().getCell( positions.toArray(new Position[positions.size()]));
Cell cell = cellSet.getCell(columnPosition, rowPosition);
cell = context.getCellSet().getCell(columnNode.getPosition(), rowNode.getPosition());