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

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


      {
        group = (RelationalGroup) maybeDefaultGroup;
      }
      else
      {
        group = new RelationalGroup();
        group.setName(groupName);
        group.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource());
      }
    }
    else
    {
      group = new RelationalGroup();
      group.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource());
    }
  }
View Full Code Here


   */
  protected void doneParsing() throws SAXException
  {
    super.doneParsing();

    final RelationalGroup group = (RelationalGroup) getElement();
    if (fieldsReadHandler != null)
    {
      final String[] fields = fieldsReadHandler.getFields();
      group.setFields(Arrays.asList(fields));
    }
    if (headerReadHandler != null)
    {
      group.setHeader((GroupHeader) headerReadHandler.getElement());
    }
    if (footerReadHandler != null)
    {
      group.setFooter((GroupFooter) footerReadHandler.getElement());
    }
    if (groupBodyReadHandler != null)
    {
      group.setBody(groupBodyReadHandler.getGroupBody());
    }
  }
View Full Code Here

    }
  }

  protected Element createElement(final String elementType)
  {
    return new RelationalGroup();
  }
View Full Code Here

    final int groupSize = getReport().getGroupCount();
    for (int i = 0; i < groupSize; i++)
    {

      // todo: This is probably not correct.
      final RelationalGroup g = (RelationalGroup) getReport().getGroup(i);
      writer.writeTag(ExtParserModule.NAMESPACE, ReportDescriptionWriter.GROUP_TAG,
          "name", g.getName(), XmlWriterSupport.OPEN);

      final List fields = g.getFields();
      if (fields.isEmpty() == false)
      {
        writer.writeTag(ExtParserModule.NAMESPACE, ReportDescriptionWriter.FIELDS_TAG, XmlWriterSupport.OPEN);

        for (int f = 0; f < fields.size(); f++)
        {
          final String field = (String) fields.get(f);
          writer.writeTag(ExtParserModule.NAMESPACE, ReportDescriptionWriter.FIELD_TAG, XmlWriterSupport.OPEN);
          writer.writeTextNormalized(field, false);
          writer.writeCloseTag();
        }
        writer.writeCloseTag();
      }
      else
      {
        writer.writeTag(ExtParserModule.NAMESPACE, ReportDescriptionWriter.FIELDS_TAG, XmlWriterSupport.CLOSE);
      }

      writeRootBand(ReportDescriptionWriter.GROUP_HEADER_TAG, g.getHeader());
      writeRootBand(ReportDescriptionWriter.GROUP_FOOTER_TAG, g.getFooter());

      writer.writeCloseTag();
    }

    writer.writeCloseTag();
View Full Code Here

      {
        group = (RelationalGroup) maybeDefaultGroup;
      }
      else
      {
        group = new RelationalGroup();
        group.setName(groupName);
        group.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource());
      }
    }
    else
    {
      group = new RelationalGroup();
      group.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource());
    }
  }
View Full Code Here

    super(s);
  }

  public void testCreate() throws Exception
  {
    final RelationalGroup g1 = new RelationalGroup();
    assertNotNull(g1.clone());
    assertNotNull(g1.getFields());
    assertNotNull(g1.getFooter());
    assertNotNull(g1.getHeader());
    assertNotNull(g1.getName());
    assertNotNull(g1.toString());
  }
View Full Code Here

    assertNotNull(g1.toString());
  }

  public void testMethods()
  {
    final RelationalGroup g = new RelationalGroup();

    try
    {
      g.setHeader(null);
      fail();
    }
    catch (NullPointerException npe)
    {
      // expected, ignored
    }
    try
    {
      g.setFooter(null);
      fail();
    }
    catch (NullPointerException npe)
    {
      // expected, ignored
    }
    try
    {
      g.addField(null);
      fail();
    }
    catch (NullPointerException npe)
    {
      // expected, ignored
View Full Code Here

  }

  private static RelationalGroup createGroup(String name, String[] fields)
  {
    final RelationalGroup group = new RelationalGroup();
    group.setFields(Arrays.asList(fields));
    group.setName(name);
    return group;
  }
View Full Code Here

  {
    MasterReport report = new MasterReport();
    final ItemBand itemBand = new ItemBand();
    itemBand.setName("ItemBand!");
    report.setItemBand(itemBand);
    report.addGroup(new RelationalGroup());
    report.addGroup(createGroup("second", new String[]{"field"}));
    report.addGroup(createGroup("third", new String[]{"field", "field2"}));

    assertEquals(4, report.getGroupCount());
    assertEquals("ItemBand!", report.getItemBand().getName());
View Full Code Here

    band.addElement(nfef.createElement());
  }

  private void setupGroup(final MasterReport report)
  {
    final RelationalGroup group = new RelationalGroup();
    group.setName("Category Group");
    group.addField("Category");

    final GroupHeader gh = group.getHeader();
    gh.setRepeat(true);
    gh.getStyle().setStyleProperty(ElementStyleKeys.MIN_HEIGHT, new Float(26));

    final TextFieldElementFactory factory1 = new TextFieldElementFactory();
    factory1.setName("CategoryTextField");
View Full Code Here

TOP

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

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.