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

Examples of org.pentaho.reporting.engine.classic.core.StaticDataRow


  public void testComplexReplacement()
  {
    final MessageFormatSupport support = new MessageFormatSupport();
    support.setFormatString("$(null,number,integer), $(dummy), $(null,date), $(null,number,integer)");
    final StaticDataRow sdr = new StaticDataRow(new String[]{"null", "dummy"}, new String[]{null, "Content"});

    final String text = support.performFormat(sdr);
    assertEquals("Expected content w/o nullString", "<null>, Content, <null>, <null>", text);

    support.setNullString("-");
View Full Code Here


  public void testNestedPattern()
  {
    final MessageFormatSupport support = new MessageFormatSupport();
    support.setFormatString("$(null,choice,0#$(null)|0<$(dummy))");
    final StaticDataRow sdr = new StaticDataRow(new String[]{"null", "dummy"},
        new Object[]{IntegerCache.getInteger(0), IntegerCache.getInteger(1)});

    final String text = support.performFormat(sdr);
    assertEquals("Expected content ", "0", text);

    final StaticDataRow sdr2 = new StaticDataRow(new String[]{"null", "dummy"},
        new Object[]{IntegerCache.getInteger(1), IntegerCache.getInteger(2)});
    support.setNullString("-");
    final String ntext = support.performFormat(sdr2);
    assertEquals("Expected content w nullString", "2", ntext);
  }
View Full Code Here

          IntegerCache.getInteger(series), dataset.getSeriesKey(series),
          IntegerCache.getInteger(dataset.getSeriesCount()),
          IntegerCache.getInteger(item), IntegerCache.getInteger(dataset.getItemCount(series))
      };
      formulaExpression.setRuntime(new WrapperExpressionRuntime
          (new StaticDataRow(ADDITIONAL_COLUMN_KEYS, values), runtime));
      final Object o = formulaExpression.getValue();
      if (o == null)
      {
        return null;
      }
View Full Code Here

          IntegerCache.getInteger(series), dataset.getSeriesKey(series),
          IntegerCache.getInteger(dataset.getSeriesCount()),
          IntegerCache.getInteger(item), IntegerCache.getInteger(dataset.getItemCount(series))
      };
      formulaExpression.setRuntime(new WrapperExpressionRuntime
          (new StaticDataRow(ADDITIONAL_COLUMN_KEYS, values), runtime));
      final Object o = formulaExpression.getValue();
      if (o == null)
      {
        return null;
      }
View Full Code Here

  protected DataRow computeData(Band band, ExpressionRuntime runtime)
  {
    if (band.getComputedStyle().getBooleanStyleProperty(ElementStyleKeys.VISIBLE) == false)
    {
      return new StaticDataRow();
    }

    this.values.clear();
    compute(band, runtime);
    return new StaticDataRow(values);
  }
View Full Code Here

        }
        else if (dataFactory instanceof DataFactoryDesignTimeSupport)
        {
          final DataFactoryDesignTimeSupport dts = (DataFactoryDesignTimeSupport) dataFactory;
          reportData = dts.queryDesignTimeStructure
              (query, new QueryDataRowWrapper(new StaticDataRow(), queryTimeout, 1, sortConstraints));
        }
        else
        {
          reportData = dataFactory.queryData
              (query, new QueryDataRowWrapper(new StaticDataRow(), queryTimeout, 1, sortConstraints));
        }

        offlineTableModel = new OfflineTableModel(reportData, new DefaultDataAttributeContext());
      }
      finally
View Full Code Here

          IntegerCache.getInteger(series), dataset.getSeriesKey(series),
          IntegerCache.getInteger(dataset.getSeriesCount()),
          IntegerCache.getInteger(item), IntegerCache.getInteger(dataset.getItemCount(series))
      };
      formulaExpression.setRuntime(new WrapperExpressionRuntime
          (new StaticDataRow(ADDITIONAL_COLUMN_KEYS, values), runtime));
      final Object o = formulaExpression.getValue();
      if (o == null)
      {
        return null;
      }
View Full Code Here

          IntegerCache.getInteger(series), dataset.getSeriesKey(series),
          IntegerCache.getInteger(dataset.getSeriesCount()),
          IntegerCache.getInteger(item), IntegerCache.getInteger(dataset.getItemCount(series))
      };
      formulaExpression.setRuntime(new WrapperExpressionRuntime
          (new StaticDataRow(ADDITIONAL_COLUMN_KEYS, values), runtime));
      final Object o = formulaExpression.getValue();
      if (o == null)
      {
        return null;
      }
View Full Code Here

        (Arrays.asList(new SortConstraint("A", false), new SortConstraint("B", true)));
  }

  @Test
  public void testExtraColumn() {
    QueryDataRowWrapper wrapper = new QueryDataRowWrapper(new StaticDataRow(), 10, 12, sortConstraintList);
    String[] expecteds = {DataFactory.QUERY_LIMIT, DataFactory.QUERY_TIMEOUT, DataFactory.QUERY_SORT};
    Assert.assertArrayEquals(expecteds, wrapper.getColumnNames());
    Assert.assertEquals(wrapper.get(DataFactory.QUERY_LIMIT), Integer.valueOf(12));
    Assert.assertEquals(wrapper.get(DataFactory.QUERY_TIMEOUT), Integer.valueOf(10));
    Assert.assertEquals(wrapper.get(DataFactory.QUERY_SORT), sortConstraintList);
View Full Code Here

    mondrianDataFactory.initialize(new DesignTimeDataFactoryContext());
    mondrianDataFactory.setQuery("default", PARAMETRIZED_QUERY, null, null);


    final DataFactoryMetaData metaData = mondrianDataFactory.getMetaData();
    final Object queryHash = metaData.getQueryHash(mondrianDataFactory, "default", new StaticDataRow());
    assertNotNull(queryHash);

    final BandedMDXDataFactory mdxDataFactory = new BandedMDXDataFactory(createProvider());
    mdxDataFactory.initialize(new DesignTimeDataFactoryContext());
    mdxDataFactory.setQuery("default", QUERY, null, null);
    mdxDataFactory.setQuery("default2", PARAMETRIZED_QUERY, null, null);

    assertNotEquals("Physical Query is not the same", queryHash, metaData.getQueryHash(mdxDataFactory, "default", new StaticDataRow()));
    assertEquals("Physical Query is the same", queryHash, metaData.getQueryHash(mdxDataFactory, "default2", new StaticDataRow()));

    final DriverConnectionProvider connectionProvider = createProvider();
    connectionProvider.setProperty("Catalog",
        "test/org/pentaho/reporting/engine/classic/extensions/datasources/olap4j/steelwheels2.mondrian.xml");
    final BandedMDXDataFactory mdxDataFactory2 = new BandedMDXDataFactory(connectionProvider);
    mdxDataFactory2.initialize(new DesignTimeDataFactoryContext());
    mdxDataFactory2.setQuery("default", QUERY, null, null);
    mdxDataFactory2.setQuery("default2", PARAMETRIZED_QUERY, null, null);

    assertNotEquals("Physical Connection is not the same", queryHash, metaData.getQueryHash(mdxDataFactory, "default", new StaticDataRow()));
    assertNotEquals("Physical Connection is the same", queryHash, metaData.getQueryHash(mdxDataFactory2, "default2", new StaticDataRow()));
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.StaticDataRow

Copyright © 2018 www.massapicom. 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.