0

I wan't to create report from the result of an olap Query, the result type is a cellSet. Does any one have any idea.

thx

Kassandra
  • 87
  • 1
  • 14

1 Answers1

0

The easiest way to print out results is by using one of the built-in formatter. There is an example available here.

To programmatically iterate over the axis and positions of a CellSet, you need to iterate over each axis, then each position on the axis. A simple CellSet with two axis (with ordinals known in advance) can be iterated over like so:

// Iteration over a two-axis query
for (
  Position axis_0 
  : data.getAxes().get( Axis.ROWS.axisOrdinal() ).getPositions()) 
{
  for (
    Position axis_1
    : data.getAxes().get(Axis.COLUMNS.axisOrdinal()).getPositions())
  {
    Object value =
      data.getCell(axis_0, axis_1)
        .getValue();
  }
}
Luc
  • 672
  • 3
  • 8
  • I have no prob in printing results, my goal is to generate reports with charts ... from the result of the query by using a reporting framework like DynamicReports but the report builder does not support CellSet as an input. – Kassandra May 02 '14 at 10:05
  • I had to flip axis_1 and axis_0 in the above fragment. – wrschneider Dec 08 '15 at 18:17