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

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


        final String[] elements = metaData.getReferencedElements(expression, o);
        for (int j = 0; j < elements.length; j++)
        {
          final String element = elements[j];
          final AbstractReportDefinition reportDefinition = reportRenderContext.getReportDefinition();
          final ReportElement e =
              FunctionUtilities.findElementByAttribute(reportDefinition, AttributeNames.Core.NAMESPACE,
                  AttributeNames.Core.NAME, element);
          if (e == null)
          {
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("InvalidElementReferenceInspection.ExpressionReferencesInvalidName",
                    expression.getName(), metaData.getDisplayName(Locale.getDefault())),
                new PropertyLocationInfo(expression, metaData.getName())));
          }
        }
      }
    }
    catch (Exception e)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          e.getMessage(),
          new LocationInfo(expression)));
    }
  }
View Full Code Here


    final MatcherContext context = new MatcherContext();
    context.setMatchSubReportChilds(false);

    NodeMatcher m = new AndMatcher(new ElementMatcher(LabelType.INSTANCE),
        new AttributeMatcher(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.LABEL_FOR, field));
    ReportElement match = ReportStructureMatcher.match(context, titleHeader, m);
    if (match == null)
    {
      if (titleHeader.getElementCount() > 0)
      {
        Element e = titleHeader.getElement(0);
        if (e.getElementType() instanceof LabelType)
        {
          return e.getAttributeTyped(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, String.class);
        }
      }
      return null;
    }

    return match.getAttributeTyped(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, String.class);
  }
View Full Code Here

      final String[] groups = metaData.getReferencedGroups(element, value);
      for (int j = 0; j < groups.length; j++)
      {
        final String group = groups[j];
        final AbstractReportDefinition reportDefinition = reportRenderContext.getReportDefinition();
        final ReportElement e = reportDefinition.getGroupByName(group);
        if (e == null)
        {
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("InvalidGroupReferenceInspection.AttributeInvalidGroup",
                  element.getName(), group, metaData.getDisplayName(Locale.getDefault())),
View Full Code Here

        final String[] elements = metaData.getReferencedGroups(expression, o);
        for (int j = 0; j < elements.length; j++)
        {
          final String element = elements[j];
          final AbstractReportDefinition reportDefinition = reportRenderContext.getReportDefinition();
          final ReportElement e = reportDefinition.getGroupByName(element);
          if (e == null)
          {
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("InvalidGroupReferenceInspection.ExpressionInvalidGroup",
                    expression.getName(), element, metaData.getDisplayName(Locale.getDefault())),
                new PropertyLocationInfo(expression, metaData.getName())));
          }
        }
      }
    }
    catch (Exception e)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          e.getMessage(), new LocationInfo(expression)));
    }

  }
View Full Code Here

    }

    final int theElementCount = section.getElementCount();
    for (int i = 0; i < theElementCount; i++)
    {
      final ReportElement reportElement = section.getElement(i);
      if (reportElement instanceof Section)
      {
        collectAlignableElements((Section) reportElement, collectedElements);
      }
View Full Code Here

    return retval;
  }

  public static boolean isDescendant(final Section definition, final ReportElement element)
  {
    ReportElement band = element;
    while (band != null)
    {
      if (band == definition)
      {
        return true;
      }
      band = band.getParentSection();
    }

    return false;
  }
View Full Code Here

  }

  private static TreePath getBasePathForNode(final Element node, final AbstractReportDefinition stopOnReport)
  {
    final ArrayList<ReportElement> list = new ArrayList<ReportElement>();
    ReportElement re = node;
    while (re != null)
    {
      list.add(re);
      if (re == stopOnReport)
      {
        break;
      }

      re = re.getParentSection();
    }
    final Object[] data = new Object[list.size()];
    for (int i = 0; i < list.size(); i++)
    {
      final ReportElement element = list.get(i);
      data[data.length - 1 - i] = element;
    }

    return new TreePath(data);
  }
View Full Code Here

  private static void findSubReportsInteral(final Section section, final ArrayList<SubReport> result)
  {
    final int count = section.getElementCount();
    for (int i = 0; i < count; i++)
    {
      final ReportElement element = section.getElement(i);
      if (element instanceof Section)
      {
        findSubReportsInteral((Section) element, result);
      }
    }
View Full Code Here

  public static int findIndexOf(final Section parent, final Element visualElement)
  {
    final int count = parent.getElementCount();
    for (int i = 0; i < count; i++)
    {
      final ReportElement element = parent.getElement(i);
      if (element == visualElement)
      {
        return i;
      }
    }
View Full Code Here

  public static int findSubreportIndexOf(final RootLevelBand parent, final SubReport visualElement)
  {
    final int count = parent.getSubReportCount();
    for (int i = 0; i < count; i++)
    {
      final ReportElement element = parent.getSubReport(i);
      if (element == visualElement)
      {
        return i;
      }
    }
View Full Code Here

TOP

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

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.