Package org.pentaho.reporting.engine.classic.core

Examples of org.pentaho.reporting.engine.classic.core.DataFactory.queryData()


      {
        mappings[i] = new ParameterMapping(fields[i], fields[i]);
      }

      final QueryParametersDataRow params = new QueryParametersDataRow(getDataRow(), mappings);
      final TableModel tableModel = dataFactory.queryData(query, new QueryDataRowWrapper(params, 1, queryTimeout));
      if (tableModel == null)
      {
        return null;
      }
      final int columnCount = tableModel.getColumnCount();
View Full Code Here


   */
  @Test
  public void testQuery() throws ReportDataFactoryException
  {
    DataFactory dataFactory = createDataFactory(queryBroken);
    final TableModel tableModel = dataFactory.queryData("default", new ParameterDataRow());
//    new DataPreviewDialog().showData(tableModel);

    Assert.assertEquals("[Markets].[(All)]", tableModel.getColumnName(2));
    Assert.assertEquals("[Product].[Line]", tableModel.getColumnName(1));
    Assert.assertNotNull(tableModel.getValueAt(0, 3));
View Full Code Here

   */
  @Test
  public void testQueryOK() throws ReportDataFactoryException
  {
    DataFactory dataFactory = createDataFactory(query);
    final TableModel tableModel = dataFactory.queryData("default", new ParameterDataRow());
//    new DataPreviewDialog().showData(tableModel);

    Assert.assertEquals("[Markets].[(All)]", tableModel.getColumnName(2));
    Assert.assertEquals("[Product].[Line]", tableModel.getColumnName(1));
    Assert.assertNotNull(tableModel.getValueAt(1, 1));
View Full Code Here

  @Test
  public void testQueryMultipleH() throws ReportDataFactoryException
  {
    DataFactory dataFactory = createDataFactory(queryMultipleH);
    final TableModel tableModel = dataFactory.queryData("default", new ParameterDataRow());

    Assert.assertEquals("[Time].[Quarters]", tableModel.getColumnName(2));
    Assert.assertEquals("[Time].[Years]", tableModel.getColumnName(1));
    Assert.assertNotNull(tableModel.getValueAt(1, 1));
    Assert.assertNotNull(tableModel.getValueAt(2, 2));
View Full Code Here

    PerformanceLoggingStopWatch sw = context.getPerformanceMonitorContext().createStopWatch
            (PerformanceTags.REPORT_PARAMETER_QUERY, new FormattedMessage("query={%s}", getQueryName()));
    try
    {
      sw.start();
      final TableModel tableModel = dataFactory.queryData(getQueryName(),
          new CompoundDataRow(envDataRow, parameterData));

      final String formula = getParameterAttribute(ParameterAttributeNames.Core.NAMESPACE,
          ParameterAttributeNames.Core.DISPLAY_VALUE_FORMULA, context);
      if (StringUtils.isEmpty(formula, true))
View Full Code Here

   */
  @Test
  public void testQuery() throws ReportDataFactoryException
  {
    DataFactory dataFactory = createDataFactory(queryBroken);
    final TableModel tableModel = dataFactory.queryData("default", new ParameterDataRow());
//    new DataPreviewDialog().showData(tableModel);

    Assert.assertEquals("[Markets].[(All)]", tableModel.getColumnName(2));
    Assert.assertEquals("[Product].[Line]", tableModel.getColumnName(1));
    Assert.assertNotNull(tableModel.getValueAt(0, 3));
View Full Code Here

   */
  @Test
  public void testQueryOK() throws ReportDataFactoryException
  {
    DataFactory dataFactory = createDataFactory(query);
    final TableModel tableModel = dataFactory.queryData("default", new ParameterDataRow());
//    new DataPreviewDialog().showData(tableModel);

    Assert.assertEquals("[Markets].[(All)]", tableModel.getColumnName(2));
    Assert.assertEquals("[Product].[Line]", tableModel.getColumnName(1));
    Assert.assertNotNull(tableModel.getValueAt(1, 1));
View Full Code Here

  @Test
  public void testQueryMultipleH() throws ReportDataFactoryException
  {
    DataFactory dataFactory = createDataFactory(queryMultipleH);
    final TableModel tableModel = dataFactory.queryData("default", new ParameterDataRow());

    Assert.assertEquals("[Time].[Quarters]", tableModel.getColumnName(2));
    Assert.assertEquals("[Time].[Years]", tableModel.getColumnName(1));
    Assert.assertNotNull(tableModel.getValueAt(1, 1));
    Assert.assertNotNull(tableModel.getValueAt(2, 2));
View Full Code Here

            MasterReport.computeAndInitResourceBundleFactory
                (reportDefinition.getResourceBundleFactory(), reportDefinition.getReportEnvironment()));
      }

      dataFactory.open();
      final TableModel tableModel = dataFactory.queryData
          (queryName, new QueryDataRowWrapper(new ReportParameterValues(), 1, 0));

      final int colCount = tableModel.getColumnCount();
      final String[] cols = new String[colCount];
      for (int i = 0; i < colCount; i++)
View Full Code Here

                }
              }

              final DataFactory dataFactory = new PentahoDataFactory( loader );
              final TableModel model =
                  dataFactory.queryData( jFreeReportAction.getDataJar().getDataClass(), new ParameterDataRow(
                      reportProperties ) );

              factory = new PentahoTableDataFactory( AbstractJFreeReportComponent.DATACOMPONENT_DEFAULTINPUT, model );
            }
          }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.