Package org.pentaho.reporting.libraries.formula

Examples of org.pentaho.reporting.libraries.formula.DefaultFormulaContext


        };
  }

  public void testFrenchDateParsing() throws Exception
  {
    final DefaultFormulaContext context = new DefaultFormulaContext(LibFormulaBoot.getInstance().getGlobalConfig(),
        Locale.FRENCH, TimeZone.getDefault());

    performTest("DATEVALUE(\"25/12/2004\")=DATE(2004;12;25)", Boolean.TRUE, context);
  }
View Full Code Here


      public DataFactory getDataFactory()
      {
        return tdf;
      }
    };
    ReportFormulaContext fc = new ReportFormulaContext(new DefaultFormulaContext(), rt);
    final Formula f = new Formula("MULTIVALUEQUERY(\"query\"; \"Column\"; 0; 5)");
    f.initialize(fc);
    final Object v = f.evaluate();
    Assert.assertNotNull(v);
    Assert.assertTrue(v.getClass().isArray());
View Full Code Here

  }

  public void testLibFormulaMetadata()
  {

    final DefaultFormulaContext context = new DefaultFormulaContext();
    final FunctionRegistry functionRegistry = context.getFunctionRegistry();
    final String[] names = functionRegistry.getFunctionNames();
    final ArrayList<String> failedNames = new ArrayList<String>();
    for (int i = 0; i < names.length; i++)
    {
      final String name = names[i];
View Full Code Here

  public DesignTimeDataFactoryContext()
  {
    configuration = ClassicEngineBoot.getInstance().getGlobalConfig();
    resourceManager = new ResourceManager();
    resourceBundleFactory = new DefaultResourceBundleFactory();
    formulaContext = new DefaultFormulaContext();
  }
View Full Code Here

    this.contextFactory = contextFactory;
    this.configuration = configuration;
    this.resourceManager = resourceManager;
    this.contextKey = contextKey;
    this.resourceBundleFactory = resourceBundleFactory;
    this.formulaContext = new DefaultFormulaContext();
  }
View Full Code Here

{
  public static void main(String[] args)
  {
    LibFormulaBoot.getInstance().start();

    final DefaultFormulaContext context = new DefaultFormulaContext();
    final FunctionRegistry functionRegistry = context.getFunctionRegistry();
    final String[] names = functionRegistry.getFunctionNames();
    for (int i = 0; i < names.length; i++)
    {
      final String name = names[i];
      final FunctionDescription data = functionRegistry.getMetaData(name);
View Full Code Here

    if (isFormulaFragment())
    {
      final GenericExpressionRuntime expressionRuntime = new GenericExpressionRuntime
          (new StaticDataRow(), new DefaultTableModel(), -1, new DefaultProcessingContext());
      final String formulaText = FormulaUtil.createEditorTextFromFormula
          (text, new ReportFormulaContext(new DefaultFormulaContext(), expressionRuntime));
      formulaField.setText(formulaText);
      formulaBox.setSelectedItem(formulaText);
    }
    else
    {
View Full Code Here

        parser = new FormulaParser();
        try
        {
            final XFormulaOpCodeMapper mapper = (XFormulaOpCodeMapper) UnoRuntime.queryInterface(XFormulaOpCodeMapper.class, m_xContext.getServiceManager().createInstanceWithContext("simple.formula.FormulaOpCodeMapperObj", m_xContext));
            FormulaOpCodeMapEntry[] opCodes = mapper.getAvailableMappings(FormulaLanguage.ODFF, FormulaMapGroup.FUNCTIONS);
            final DefaultFormulaContext defaultContext = new DefaultFormulaContext();
            final FunctionRegistry functionRegistry = defaultContext.getFunctionRegistry();

            String[] names = functionRegistry.getFunctionNames();
            addOpCodes(names, opCodes, FUNCTIONS);
            names = getOperators(defaultContext, OPERATORS);
            opCodes = mapper.getAvailableMappings(FormulaLanguage.ODFF, FormulaMapGroup.UNARY_OPERATORS);
View Full Code Here

    public SOFunctionManager(XComponentContext context)
    {
        m_xContext = context;
        final ClassLoader cl = java.lang.Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
        defaultContext = new DefaultFormulaContext();
        functionRegistry = defaultContext.getFunctionRegistry();
        categories = functionRegistry.getCategories();
        Thread.currentThread().setContextClassLoader(cl);

    }
View Full Code Here

    if (isFormulaFragment())
    {
      final GenericExpressionRuntime expressionRuntime = new GenericExpressionRuntime
          (new StaticDataRow(), new DefaultTableModel(), -1, new DefaultProcessingContext());
      final String formulaText = FormulaUtil.createEditorTextFromFormula
          (text, new ReportFormulaContext(new DefaultFormulaContext(), expressionRuntime));
      formulaField.setText(formulaText);
      formulaBox.setSelectedItem(formulaText);
    }
    else
    {
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.formula.DefaultFormulaContext

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.