Examples of JRCompilationUnit


Examples of net.sf.jasperreports.engine.design.JRCompilationUnit

    {
      StringBuffer errors = new StringBuffer();
      int errorCount = 0;
      for (int i = 0; i < units.length; i++)
      {
        JRCompilationUnit unit = units[i];
        JavaScriptCompileData compileData = new JavaScriptCompileData();
        for (Iterator it = unit.getExpressions().iterator(); it.hasNext();)
        {
          JRExpression expr = (JRExpression) it.next();
          int id = unit.getCompileTask().getExpressionId(expr).intValue();
          JavaScriptCompileData.Expression jsExpr =
            JavaScriptEvaluator.createJSExpression(expr);
         
          //compile the default expression to catch syntax errors
          try
          {
            context.compileString(jsExpr.getDefaultExpression(),
                "expression", 0, null);
          }
          catch (EvaluatorException e)
          {
            ++errorCount;
            appendError(errors, errorCount, e);
          }
         
          compileData.addExpression(id, jsExpr);
        }
        unit.setCompileData(compileData);
      }
     
      String errorsMessage = null;
      if (errorCount > 0)
      {
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.