Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * This program is free software; you can redistribute it and/or modify it under the
  * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
  * Foundation.
  *
  * You should have received a copy of the GNU Lesser General Public License along with this
  * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
  * or from the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * Copyright (c) 2008 - 2009 Pentaho Corporation, .  All rights reserved.
 */
package pt.webdetails.cda.utils.mondrian;
import  mondrian.olap.Result;
import  org.pentaho.reporting.engine.classic.core.DataRow;
import  org.pentaho.reporting.engine.classic.core.ReportDataFactoryException;
import  org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.AbstractNamedMDXDataFactory;
import  org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.BandedMDXTableModel;

This data-factory operates in Legacy-Mode providing a preprocessed view on the mondrian result. It behaves exactly as known from the Pentaho-Platform and the Pentaho-Report-Designer. This mode of operation breaks the structure of the resulting table as soon as new rows are returned by the server.

Author(s):
Thomas Morgner
public class CompactBandedMDXDataFactory extends AbstractNamedMDXDataFactory
  {
  }

  
Queries a datasource. The string 'query' defines the name of the query. The Parameterset given here may contain more data than actually needed for the query.

The parameter-dataset may change between two calls, do not assume anything, and do not hold references to the parameter-dataset or the position of the columns in the dataset.

Parameters:
queryName the query name
parameters the parameters for the query
Returns:
the result of the query as table model.
Throws:
ReportDataFactoryException if an error occured while performing the query.
  public TableModel queryData(final String queryNamefinal DataRow parametersthrows ReportDataFactoryException
  {
    final Result cellSet = performQuery(queryNameparameters);
    return new CompactBandedMDXTableModel(cellSet, extractQueryLimit(parameters));
  }
New to GrepCode? Check out our FAQ X