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

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


    this.groupList = new GroupList();
  }

  protected void startParsing(final PropertyAttributes attrs) throws SAXException
  {
    final ReportDefinition report = (ReportDefinition)
        getRootHandler().getHelperObject(ReportParserUtil.HELPER_OBJ_REPORT_NAME);

    final int groupCount = report.getGroupCount();
    for (int i = 0; i < groupCount; i++)
    {
      final Group g = report.getGroup(i);
      if (g instanceof RelationalGroup)
      {
        groupList.add((RelationalGroup) g);
      }
      else
View Full Code Here


    if (isSameNamespace(uri) == false)
    {
      return null;
    }

    final ReportDefinition report = (ReportDefinition)
        getRootHandler().getHelperObject(ReportParserUtil.HELPER_OBJ_REPORT_NAME);

    if ("report-header".equals(tagName))
    {
      return new RootBandReadHandler(report.getReportHeader());
    }
    else if ("report-footer".equals(tagName))
    {
      return new RootBandReadHandler(report.getReportFooter());
    }
    else if ("page-header".equals(tagName))
    {
      return new BandReadHandler(report.getPageHeader());
    }
    else if ("page-footer".equals(tagName))
    {
      return new BandReadHandler(report.getPageFooter());
    }
    else if ("watermark".equals(tagName))
    {
      return new BandReadHandler(report.getWatermark());
    }
    else if ("no-data-band".equals(tagName))
    {
      return new RootBandReadHandler(report.getNoDataBand());
    }
    else if ("groups".equals(tagName))
    {
      return new GroupsReadHandler(groupList);
    }
    else if ("itemband".equals(tagName))
    {
      return new RootBandReadHandler(report.getItemBand());
    }
    return null;
  }
View Full Code Here

  public void init(final RootXmlReadHandler rootHandler,
                   final String uri,
                   final String tagName)
  {
    super.init(rootHandler, uri, tagName);
    final ReportDefinition report = (ReportDefinition)
        rootHandler.getHelperObject(ReportParserUtil.HELPER_OBJ_REPORT_NAME);
    styleSheetCollection = report.getStyleSheetCollection();
  }
View Full Code Here

    rootAttributes.addNamespaceDeclaration("swing", AttributeNames.Swing.NAMESPACE);
    rootAttributes.addNamespaceDeclaration("pdf", AttributeNames.Pdf.NAMESPACE);

    writer.writeTag(BundleNamespaces.STYLE, "style", rootAttributes, XmlWriterSupport.OPEN);

    final ReportDefinition report = styleFileState.getReport();
    if (report instanceof MasterReport)
    {
      // only the master report can carry page-definitions ..
      final PageDefinition definition = report.getPageDefinition();
      writePageDefinition(writer, definition);
    }

    // write list of styles
    final StyleSheetCollection styles = report.getStyleSheetCollection();
    final String[] styleNames = styles.getStyleNames();

    for (int i = 0; i < styleNames.length; i++)
    {
      final String name = styleNames[i];
      final ElementStyleSheet style = styles.getStyleSheet(name);

      StyleWriterUtility.writeStyleRule(BundleNamespaces.STYLE, "style-rule", writer, style, true);
    }

    // write layout processor section
    if (ExpressionWriterUtility.isGlobalLayoutExpressionActive(styleFileState))
    {
      writer.writeTag(BundleNamespaces.LAYOUT, "layout-processors", XmlWriterSupport.OPEN);
      ExpressionWriterUtility.writeGlobalLayoutExpressions(bundle, styleFileState, writer);
      writer.writeCloseTag();
    }

    // write watermark
    final Watermark watermark = report.getWatermark();
    final BundleElementWriteHandler watermarkHandler = BundleElementWriterFactory.createHandler(watermark);
    watermarkHandler.writeElement(bundle, styleFileState, writer, watermark);

    // write page-header
    final PageHeader pageHeader = report.getPageHeader();
    final BundleElementWriteHandler pageHeaderHandler = BundleElementWriterFactory.createHandler(pageHeader);
    pageHeaderHandler.writeElement(bundle, styleFileState, writer, pageHeader);

    // write page-footer
    final PageFooter pageFooter = report.getPageFooter();
    final BundleElementWriteHandler pageFooterHandler = BundleElementWriterFactory.createHandler(pageFooter);
    pageFooterHandler.writeElement(bundle, styleFileState, writer, pageFooter);


    writer.writeCloseTag();
View Full Code Here

    if (FunctionUtilities.isLayoutLevel(event) == false)
    {
      // dont do anything if there is no printing done ...
      return;
    }
    final ReportDefinition definition = event.getReport();
    processRootBand(definition.getNoDataBand());
    processRootBand(definition.getDetailsHeader());

    processFooterBands(event.getState());
  }
View Full Code Here

    if (FunctionUtilities.isLayoutLevel(event) == false)
    {
      // dont do anything if there is no printing done ...
      return;
    }
    final ReportDefinition definition = event.getReport();
    processRootBand(definition.getDetailsFooter());

    processFooterBands(event.getState());
  }
View Full Code Here

  protected void processFooterBands(ReportState state)
  {
    while (state != null)
    {
      final ReportDefinition reportDefinition = state.getReport();
      processRootBand(reportDefinition.getPageFooter());
      processRootBand(reportDefinition.getDetailsFooter());
      Group g = reportDefinition.getRootGroup();
      while (g != null)
      {
        processRootBand(g.getFooter());
        final GroupBody body = g.getBody();
        if (body instanceof SubGroupBody == false)
View Full Code Here

    if (maybeReport instanceof ReportDefinition == false)
    {
      throw new ParseException("Invalid internal configuration for 'report-obj'", getLocator());
    }

    final ReportDefinition def = (ReportDefinition) maybeReport;
    final StyleSheetCollection styleSheetCollection = def.getStyleSheetCollection();

    final String name = attrs.getValue(getUri(), "name");
    if (name == null)
    {
      throw new ParseException("Required attribute 'name' is not defined.", getLocator());
View Full Code Here

    if (maybeReport instanceof ReportDefinition == false)
    {
      throw new ParseException("Invalid internal configuration for 'report-obj'", getLocator());
    }

    final ReportDefinition def = (ReportDefinition) maybeReport;
    final StyleSheetCollection styleSheetCollection = def.getStyleSheetCollection();

    final String parent = attrs.getValue(getUri(), "parent");
    if (parent != null)
    {
      final String[] classes = StringUtils.split(parent, " ", "'");
View Full Code Here

    final ElementStyleSheet es = report.getStyleSheetCollection().createStyleSheet("test");
    es.setStyleProperty(ElementStyleKeys.HREF_TITLE, "Hello World!");
    report.getReportHeader().getStyle().addParent(es);
    assertEquals(report.getReportHeader().getStyle().getStyleProperty(ElementStyleKeys.HREF_TITLE), "Hello World!");

    final ReportDefinition rd = new ReportDefinitionImpl(report, report.getPageDefinition());
    assertEquals(rd.getReportHeader().getStyle().getStyleProperty(ElementStyleKeys.HREF_TITLE), "Hello World!");

    // redefining the outside stylesheet must not change the stylesheet
    // inside the report definition.
    // check for deep-cloning!
    es.setStyleProperty(ElementStyleKeys.HREF_TITLE, "Hello Little Green Man!");
    assertSame(rd.getReportHeader().getStyle().getStyleProperty(ElementStyleKeys.HREF_TITLE), "Hello World!");

  }
View Full Code Here

TOP

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

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.