mondrian.olap.Cell Java Examples

The following examples show how to use mondrian.olap.Cell. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CubeService.java    From youkefu with Apache License 2.0 6 votes vote down vote up
/**
 * 
 * @param axes
 * @param axis
 * @param pos
 * @param result
 * @param dataList
 * @param rowno
 */
private void getRowData(Axis[] axes, int axis, int[] pos, Result result, List<List<ValueData>> dataList, int rowno , Position position , CubeReportData cubeData , List<ColumnProperties> cols) {
	if (axis < 0) {
		if (dataList.size() <= rowno || dataList.get(rowno) == null) {
			dataList.add(new ArrayList<ValueData>());
		}
		Cell cell = result.getCell(pos) ;
		ValueData valueData  = new ValueData(cell.getValue(), cell.getFormattedValue(), null  , cell.canDrillThrough(), cell.getDrillThroughSQL(true) , position!=null && position.size()>0 ? position.get(position.size()-1).getName():"" , cell.getCachedFormatString() , cols) ;
		int rows = 0 ;
		valueData.setRow(getParentLevel(cubeData.getRow() , rowno, rows)) ;
		dataList.get(rowno).add(valueData);
	} else {
		Axis _axis = axes[axis];
		List<Position> positions = _axis.getPositions();
		for (int i = 0; i < positions.size(); i++) {
			Position posit = positions.get(i) ;
			pos[axis] = i;
			if (axis == 0) {
				int row = axis + 1 < pos.length ? pos[axis + 1] : 0;
				rowno = row;
			}
			getRowData(axes, axis - 1, pos, result, dataList, rowno , posit , cubeData , cols);
		}
	}
}
 
Example #2
Source File: MDXMetaDataCellAttributes.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public MDXMetaDataCellAttributes( final DataAttributes backend,
                                  final Cell cell ) {
  ArgumentNullException.validate( "cell", cell );
  ArgumentNullException.validate( "backend", backend );

  this.cell = cell;
  this.backend = backend;
}
 
Example #3
Source File: MondrianHelper.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private static void outputFlattenedRecurse( Result result, List<List<Object>> rows, List<Object> rowValues,
  int[] coords, int axisOrdinal ) {
  final Axis[] axes = result.getAxes();
  if ( axisOrdinal == axes.length ) {
    final Cell cell = result.getCell( coords );
    // Output the raw (unformatted) value of the cell.
    // NOTE: We could output other properties of the cell here, such as its
    // formatted value, too.
    rowValues.add( cell.getValue() );

    // Add a copy of the completed row to the list of rows.
    rows.add( new ArrayList<>( rowValues ) );
  } else {
    final Axis axis = axes[axisOrdinal];
    int k = -1;
    int saveLength = rowValues.size();
    for ( Position position : axis.getPositions() ) {
      coords[axisOrdinal] = ++k;
      for ( Member member : position ) {
        rowValues.add( member.getUniqueName() );
      }
      outputFlattenedRecurse( result, rows, rowValues, coords, axisOrdinal + 1 );
      while ( rowValues.size() > saveLength ) {
        rowValues.remove( rowValues.size() - 1 );
      }
    }
  }
}
 
Example #4
Source File: JRMondrianCell.java    From jasperreports with GNU Lesser General Public License v3.0 4 votes vote down vote up
public JRMondrianCell(Cell cell)
{
	this.cell = cell;
}
 
Example #5
Source File: JRMondrianResult.java    From jasperreports with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public JROlapCell getCell(int[] axisPositions)
{
	Cell dataCell = result.getCell(axisPositions);
	return new JRMondrianCell(dataCell);
}