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

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


      interpreter.declareBean("definition", definition, MasterReport.class); //$NON-NLS-1$
      interpreter.declareBean("flowController", flowController, DefaultFlowController.class); //$NON-NLS-1$
      final Object o = interpreter.eval(getLanguage(), "expression", 1, 1, script);
      if (o instanceof MasterReport == false)
      {
        throw new ReportDataFactoryException("Not a MasterReport");
      }
      return (MasterReport) o; //$NON-NLS-1$

    }
    catch (BSFException e)
    {
      throw new ReportDataFactoryException("Failed to initialize the BSF-Framework", e);
    }
  }
View Full Code Here


      interpreter.declareBean("definition", definition, SubReport.class); //$NON-NLS-1$
      interpreter.declareBean("flowController", flowController, DefaultFlowController.class); //$NON-NLS-1$
      final Object o = interpreter.eval(getLanguage(), "expression", 1, 1, script);
      if (o instanceof SubReport == false)
      {
        throw new ReportDataFactoryException("Not a MasterReport");
      }
      return (SubReport) o; //$NON-NLS-1$

    }
    catch (BSFException e)
    {
      throw new ReportDataFactoryException("Failed to initialize the BSF-Framework", e);
    }
  }
View Full Code Here

      throw new NullPointerException("Query is null."); //$NON-NLS-1$
    }
    final String realQuery = getQuery(query);
    if (realQuery == null)
    {
      throw new ReportDataFactoryException("Query '" + query + "' is not recognized."); //$NON-NLS-1$ //$NON-NLS-2$
    }
    return super.queryData(realQuery, parameters);
  }
View Full Code Here

      return parametrizeAndQuery(parameters, translatedQuery, preparedParameterNames);
    }
    catch (Exception e)
    {
      throw new ReportDataFactoryException("Failed at query: " + query, e); //$NON-NLS-1$
    }
    finally
    {
      currentRunningStatement = null;
    }
View Full Code Here

    {
      factory = (ParametrizationProviderFactory) ObjectUtilities.loadAndInstantiate
          (parametrizationProviderClassname, SimpleSQLReportDataFactory.class, ParametrizationProviderFactory.class);
      if (factory == null)
      {
        throw new ReportDataFactoryException
            ("The specified parametrization factory is not valid: " + parametrizationProviderClassname);
      }
    }
    return factory;
  }
View Full Code Here

    {
      return new ComputedParameterValues(tableModel, getKeyColumn(), getTextColumn(), formula, context);
    }
    catch (ReportProcessingException e)
    {
      throw new ReportDataFactoryException("Failed to initialize parameter-value-collection", e);
    }
  }
View Full Code Here

      throw new NullPointerException("Query is null."); //$NON-NLS-1$
    }
    final String realQuery = getQuery(query);
    if (realQuery == null)
    {
      throw new ReportDataFactoryException("Query '" + query + "' is not recognized."); //$NON-NLS-1$ //$NON-NLS-2$
    }
    return super.queryData(realQuery, parameters);
  }
View Full Code Here

    final int methodSeparatorIdx = query.indexOf('#');

    if ((methodSeparatorIdx + 1) >= query.length())
    {
      // If we have a method separator, then it cant be at the end of the text.
      throw new ReportDataFactoryException("Malformed query: " + query); //$NON-NLS-1$
    }

    if (methodSeparatorIdx == -1)
    {
      // we have no method. So this query must be a reference to a tablemodel
      // instance.
      final int parameterStartIdx = query.indexOf('(');
      final String[] parameterNames;
      final String constructorName;
      if (parameterStartIdx == -1)
      {
        parameterNames = StaticDataFactory.EMPTY_PARAMS;
        constructorName = query;
      }
      else
      {
        parameterNames = createParameterList(query, parameterStartIdx);
        constructorName = query.substring(0, parameterStartIdx);
      }

      try
      {
        final Constructor c = findDirectConstructor(constructorName, parameterNames.length);

        final Object[] params = new Object[parameterNames.length];
        for (int i = 0; i < parameterNames.length; i++)
        {
          final String name = parameterNames[i];
          params[i] = parameters.get(name);
        }
        return (TableModel) c.newInstance(params);
      }
      catch (Exception e)
      {
        throw new ReportDataFactoryException
            ("Unable to instantiate class for non static call.", e); //$NON-NLS-1$
      }
    }

    return createComplexTableModel
View Full Code Here

        methodParams[i] = parameters.get(name);
      }
      final Object data = m.invoke(o, methodParams);
      if (data == null)
      {
        throw new ReportDataFactoryException("The call did not return a valid tablemodel.");
      }
      return (TableModel) data;
    }
    catch (Exception e)
    {
      throw new ReportDataFactoryException
          ("Unable to instantiate class for non static call."); //$NON-NLS-1$
    }
  }
View Full Code Here

      if (Modifier.isStatic(m.getModifiers()))
      {
        final Object data = m.invoke(null, params);
        if (data == null)
        {
          throw new ReportDataFactoryException("The call did not return a valid tablemodel.");
        }
        return (TableModel) data;
      }

      final ClassLoader classLoader = getClassLoader();
      final Class c = Class.forName(className, false, classLoader);
      final Object o = c.newInstance();
      if (o == null)
      {
        throw new ReportDataFactoryException
            ("Unable to instantiate class for non static call."); //$NON-NLS-1$
      }
      final Object data = m.invoke(o, params);
      if (data == null)
      {
        throw new ReportDataFactoryException("The call did not return a valid tablemodel.");
      }
      return (TableModel) data;
    }
    catch (ReportDataFactoryException rdfe)
    {
      throw rdfe;
    }
    catch (Exception e)
    {
      throw new ReportDataFactoryException
          ("Something went terribly wrong: ", e); //$NON-NLS-1$
    }
  }
View Full Code Here

TOP

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

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.