Examples of ReportElement


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

    }

    final int elementCount = b.getElementCount();
    for (int i = 0; i < elementCount; i++)
    {
      final ReportElement element = b.getElement(i);
      if (element instanceof Band)
      {
        processRootBand((Band) element);
      }
      else if (element instanceof Element)
      {
        final Element e = (Element) element;
        final DataSource source = e.getElementType();
        if (source instanceof RawDataSource)
        {
          final ElementStyleSheet style = element.getStyle();
          final String oldFormat = (String)
              style.getStyleProperty(ElementStyleKeys.EXCEL_DATA_FORMAT_STRING);
          if (oldFormat != null && oldFormat.length() > 0)
          {
            final Object attribute = element.getAttribute
                (AttributeNames.Internal.NAMESPACE, AttributeNames.Internal.EXCEL_CELL_FORMAT_AUTOCOMPUTE);
            if (Boolean.TRUE.equals(attribute) == false)
            {
              continue;
            }
          }
          final RawDataSource rds = (RawDataSource) source;
          formatSpecification = rds.getFormatString(getRuntime(), e, formatSpecification);
          if (formatSpecification.getType() == FormatSpecification.TYPE_DATE_FORMAT ||
              formatSpecification.getType() == FormatSpecification.TYPE_DECIMAL_FORMAT)
          {
            style.setStyleProperty
                (ElementStyleKeys.EXCEL_DATA_FORMAT_STRING, formatSpecification.getFormatString());
            element.setAttribute
                (AttributeNames.Internal.NAMESPACE, AttributeNames.Internal.EXCEL_CELL_FORMAT_AUTOCOMPUTE,
                    Boolean.TRUE);
          }
        }
      }
View Full Code Here

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

                              final Section section)
  {
    final int count = section.getElementCount();
    for (int i = 0; i < count; i++)
    {
      final ReportElement element = section.getElement(i);
      inspectElement(designerContext, reportRenderContext, resultHandler, columnNames, element);
      if (element instanceof SubReport && reportRenderContext.getReportDefinition() != element)
      {
        continue;
      }
View Full Code Here

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

      {
        return o;
      }
      if (o instanceof ReportElement)
      {
        final ReportElement element = (ReportElement) o;
        final Section parentSection = element.getParentSection();
        if (parentSection instanceof Band)
        {
          return parentSection;
        }
      }
View Full Code Here

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

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

    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

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

      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

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

        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

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

    }

    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

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

    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

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

  }

  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
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.