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

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


    e.toString();
  }

  public void testSerialize() throws Exception
  {
    final Element e = new Element();
    final ByteArrayOutputStream bo = new ByteArrayOutputStream();
    final ObjectOutputStream out = new ObjectOutputStream(bo);
    out.writeObject(e);

    final ObjectInputStream oin = new ObjectInputStream(new ByteArrayInputStream(bo.toByteArray()));
    final Element e2 = (Element) oin.readObject();
    assertNotNull(e2); // cannot assert equals, as this is not implemented ...
  }
View Full Code Here


    }

    final String type = (String) event.getDataRow().get("type");
    final Group g = FunctionUtilities.getCurrentGroup(event);

    final Element headerIncomeBand = g.getHeader().getElement("income-band");
    final Element headerExpenseBand = g.getHeader().getElement("expense-band");
    final Element footerIncomeBand = g.getFooter().getElement("income-band");
    final Element footerExpenseBand = g.getFooter().getElement("expense-band");

    // and now apply the visibility ...
    if (type.equals("Income"))
    {
      headerExpenseBand.setVisible(false);
      footerExpenseBand.setVisible(false);
      headerIncomeBand.setVisible(true);
      footerIncomeBand.setVisible(true);
    }
    else
    {
      headerExpenseBand.setVisible(true);
      footerExpenseBand.setVisible(true);
      headerIncomeBand.setVisible(false);
      footerIncomeBand.setVisible(false);
    }
  }
View Full Code Here

    // and if so, then get a reference to that group
    final Group group = FunctionUtilities.getCurrentGroup(event);

    // check, if all required bands are defined and return if one
    // of them is missing.
    final Element normalItemBand =
        event.getReport().getItemBand().getElement("FirstLevel");
    final Element nestedItemBand =
        event.getReport().getItemBand().getElement("SecondLevel");
    if (normalItemBand == null || nestedItemBand == null)
    {
      return;
    }

    // and now apply the visiblity to all bands affected
    final boolean isNestedGroup =
        (event.getDataRow().get("level-two-account") != null);
    //Log.warn("Is Nested Group: " + event.getDataRow().get("level-one-account") + " -> " + isNestedGroup);
    if (isNestedGroup)
    {
      normalItemBand.setVisible(false);
      nestedItemBand.setVisible(true);
      group.getHeader().setVisible(true);
      group.getFooter().setVisible(true);
    }
    else
    {
      normalItemBand.setVisible(true);
      nestedItemBand.setVisible(false);
      group.getHeader().setVisible(false);
      group.getFooter().setVisible(false);
    }
  }
View Full Code Here

    MasterReport report = new MasterReport();
    StaticDataFactory staticDataFactory = new StaticDataFactory();
    report.setDataFactory(staticDataFactory);
    report.setQuery("org.pentaho.reporting.engine.classic.testcases.base.basic.SubReportParameterPassingTest#createMainTableModel()");

    Element textElement =
        TextFieldElementFactory.createStringElement
            ("reportField1", new Rectangle(0, 0, 100, 20), Color.BLACK,
                ElementAlignment.LEFT, ElementAlignment.TOP,
                new FontDefinition("Arial", 12), "-", "c1");
    report.getItemBand().addElement(textElement);

    SubReport subReport = new SubReport();
    subReport.addInputParameter("c1", "c1");
    subReport.setQuery("org.pentaho.reporting.engine.classic.testcases.base.basic.SubReportParameterPassingTest#createSubReportTableModel(c1)");
    Element subReportTextElement =
        TextFieldElementFactory.createStringElement
            ("subreportField1", new Rectangle(20, 0, 100, 20),
                Color.RED, ElementAlignment.LEFT,
                ElementAlignment.TOP, new FontDefinition("Arial", 12), "-", "t1");
    subReport.getItemBand().addElement(subReportTextElement);
View Full Code Here

    labelFactory.setAbsolutePosition(new Point2D.Float(200, 0));
    labelFactory.setMinimumSize(new FloatDimension(-100, 15));
    labelFactory.setText("Notes:");
    b.addElement(labelFactory.createElement());

    final Element line = HorizontalLineElementFactory.createHorizontalLine(15);
    line.getStyle().setStyleProperty(ElementStyleKeys.STROKE, new BasicStroke(1));
    b.addElement(line);

    final Group group = report.getGroupByName("record-group");
    group.getHeader().addElement(b);
  }
View Full Code Here

   * @return the generated numberic text element
   * @see org.pentaho.reporting.engine.classic.core.elementfactory.ElementFactory#createElement()
   */
  public Element createElement()
  {
    final Element element = new Element();
    applyElementName(element);
    applyStyle(element.getStyle());

    element.setElementType(new MessageType());
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NULL_VALUE, getNullString());
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.MESSAGE_NULL_VALUE, getMessageNullString());
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, getFormatString());
    return element;
  }
View Full Code Here

    if (getResourceKey() == null)
    {
      throw new IllegalStateException("ResourceKey is not set.");
    }

    final Element element = new Element();
    applyElementName(element);
    applyStyle(element.getStyle());
    element.setElementType(new ResourceLabelType());
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.RESOURCE_IDENTIFIER, getResourceBase());
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, getResourceKey());
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NULL_VALUE, getNullString());
    return element;
  }
View Full Code Here

   * @throws IllegalStateException if the field name is not set.
   * @see ElementFactory#createElement()
   */
  public Element createElement()
  {
    final Element element = new Element();
    applyElementName(element);
    applyStyle(element.getStyle());

    element.setElementType(new RectangleType());
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.ARC_WIDTH, arcWidth);
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.ARC_HEIGHT, arcHeight);
    return element;
  }
View Full Code Here

   * @throws IllegalStateException if the text is not defined.
   * @see org.pentaho.reporting.engine.classic.core.elementfactory.ElementFactory#createElement()
   */
  public Element createElement()
  {
    final Element element = new Element();
    element.setElementType(new LabelType());
    applyElementName(element);
    applyStyle(element.getStyle());

    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, getText());
    element.setAttribute(AttributeNames.Excel.NAMESPACE, AttributeNames.Excel.FIELD_FORMULA, getExcelFormula());
    return element;
  }
View Full Code Here

   * @throws IllegalStateException if the field name is not set.
   * @see ElementFactory#createElement()
   */
  public Element createElement()
  {
    final Element element = new Element();
    applyElementName(element);
    applyStyle(element.getStyle());

    element.setElementType(new EllipseType());
    return element;
  }
View Full Code Here

TOP

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

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.