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

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


   *
   * @return The styles.
   */
  private ElementStyleSheet[] collectStyles()
  {
    final ReportDefinition report = getReport();
    collectStylesFromBand(report.getReportHeader());
    collectStylesFromBand(report.getReportFooter());
    collectStylesFromBand(report.getPageHeader());
    collectStylesFromBand(report.getPageFooter());
    collectStylesFromBand(report.getItemBand());
    for (int i = 0; i < report.getGroupCount(); i++)
    {
      final Group g = report.getGroup(i);
      collectStylesFromBand(g.getHeader());
      collectStylesFromBand(g.getFooter());
    }

    return (ElementStyleSheet[])
View Full Code Here


    // activating this state after the page has ended is invalid.
    setCurrentEvent(event);
    try
    {
      // activating this state after the page has ended is invalid.
      final ReportDefinition report = event.getReport();
      if (event.getState().isSubReportEvent() == false)
      {
        renderer.startReport(report);

        final ReportState reportState = event.getState();
View Full Code Here

    {
      // activating this state after the page has ended is invalid.
      updateFooterArea(event);

      renderer.startSection(Renderer.TYPE_NORMALFLOW);
      final ReportDefinition report = event.getReport();
      print(getRuntime(), report.getReportHeader());
      addSubReportMarkers(renderer.endSection());
    }
    catch (FunctionProcessingException fe)
    {
      throw fe;
View Full Code Here

    {
      return;
    }

    final ProcessingContext processingContext = getRuntime().getProcessingContext();
    final ReportDefinition report = state.getReport();
    LayouterLevel[] levels = null;
    ExpressionRuntime runtime = null;
    final OutputProcessorMetaData metaData = renderer.getOutputProcessor().getMetaData();
    if (metaData.isFeatureSupported(OutputProcessorFeature.WATERMARK_SECTION))
    {
      renderer.startSection(Renderer.TYPE_WATERMARK);
      // a new page has started, so reset the cursor ...
      // Check the subreport for sticky watermarks ...
      levels = DefaultOutputFunction.collectSubReportStates(state, processingContext);

      for (int i = levels.length - 1; i >= 0; i -= 1)
      {
        final LayouterLevel level = levels[i];
        final ReportDefinition def = level.getReportDefinition();
        final Watermark watermark = def.getWatermark();
        if (watermark.isSticky())
        {
          if (isPageHeaderPrinting(watermark, state))
          {
            print(level.getRuntime(), watermark);
          }
          else
          {
            printEmptyRootLevelBand();
          }
        }
      }

      // and finally print the watermark of the subreport itself ..
      final Band watermark = report.getWatermark();
      if (isPageHeaderPrinting(watermark, state))
      {
        runtime = createRuntime(state.getFlowController().getMasterRow(), state, processingContext);
        print(runtime, watermark);
      }
      addSubReportMarkers(renderer.endSection());
    }

    if (metaData.isFeatureSupported(OutputProcessorFeature.PAGE_SECTIONS))
    {
      renderer.startSection(Renderer.TYPE_HEADER);
      // after printing the watermark, we are still at the top of the page.

      if (levels == null)
      {
        levels = DefaultOutputFunction.collectSubReportStates(state, processingContext);
      }

      for (int i = levels.length - 1; i >= 0; i -= 1)
      {
        // This is propably wrong (or at least incomplete) in case a subreport uses header or footer which should
        // not be printed with the report-footer or header ..
        final LayouterLevel level = levels[i];
        final ReportDefinition def = level.getReportDefinition();
        final PageHeader header = def.getPageHeader();
        if (header.isSticky())
        {
          if (isPageHeaderPrinting(header, state))
          {
            print(level.getRuntime(), header);
          }
          else
          {
            printEmptyRootLevelBand();
          }
        }
      }

      // and print the ordinary page header ..
      final Band b = report.getPageHeader();
      if (isPageHeaderPrinting(b, state))
      {
        if (runtime == null)
        {
          runtime = createRuntime(state.getFlowController().getMasterRow(), state, processingContext);
        }
        print(runtime, b);
      }

      /**
       * Dive into the pending group to print the group header ...
       */

      for (int i = levels.length - 1; i >= 0; i -= 1)
      {
        final LayouterLevel level = levels[i];
        final ReportDefinition def = level.getReportDefinition();

        for (int gidx = 0; gidx < level.getGroupIndex(); gidx++)
        {
          final Group g = def.getGroup(gidx);
          final GroupHeader header = g.getHeader();
          if (header.isSticky())
          {
            if (header.isRepeat())
            {
              print(level.getRuntime(), header);
            }
            else
            {
              printEmptyRootLevelBand();
            }
          }
        }

        if (level.isInItemGroup())
        {
          final DetailsHeader detailsHeader = def.getDetailsHeader();
          if (detailsHeader.isRepeat())
          {
            print(level.getRuntime(), detailsHeader);
          }
        }
View Full Code Here

      return;
    }

    renderer.startSection(Renderer.TYPE_FOOTER);

    final ReportDefinition report = event.getReport();

    boolean somethingSticks = false;

    final ReportState state = event.getState();
    if (state.isInItemGroup())
    {
      final DetailsFooter detailsFooter = report.getDetailsFooter();
      if (detailsFooter.isRepeat())
      {
        print(getRuntime(), detailsFooter);
        somethingSticks = detailsFooter.isSticky();
      }
    }

    /**
     * Repeating group header are only printed while ItemElements are
     * processed.
     */
    final int groupsPrinted = state.getCurrentGroupIndex();
    for (int gidx = groupsPrinted; gidx >= 0; gidx -= 1)
    {
      final Group g = report.getGroup(gidx);
      final GroupFooter footer = g.getFooter();
      if (footer.isRepeat())
      {
        print(getRuntime(), footer);
        somethingSticks |= footer.isSticky();
      }
    }

    final LayouterLevel[] levels = DefaultOutputFunction.collectSubReportStates(event.getState(), getRuntime().getProcessingContext());
    final int levelCount = levels.length;
    for (int i = 0; i < levelCount; i++)
    {
      final LayouterLevel level = levels[i];
      final ReportDefinition def = level.getReportDefinition();

      if (level.isInItemGroup())
      {
        final DetailsFooter subDetailsFooter = report.getDetailsFooter();
        if (subDetailsFooter.isSticky())
        {
          if (subDetailsFooter.isRepeat())
          {
            print(level.getRuntime(), subDetailsFooter);
          }
          else
          {
            printEmptyRootLevelBand();
          }
          somethingSticks = true;
        }
        else if (somethingSticks)
        {
          printEmptyRootLevelBand();
        }
      }

      for (int gidx = level.getGroupIndex(); gidx >= 0; gidx -= 1)
      {
        final Group g = def.getGroup(gidx);
        final GroupFooter footer = g.getFooter();
        if (footer.isSticky())
        {
          if (footer.isRepeat())
          {
            print(level.getRuntime(), footer);
          }
          else
          {
            printEmptyRootLevelBand();
          }
          somethingSticks = true;
        }
        else if (somethingSticks)
        {
          printEmptyRootLevelBand();
        }
      }
    }

    final PageFooter pageFooter = report.getPageFooter();
    final ElementStyleSheet pageFooterStyle = pageFooter.getStyle();
    if (state.getCurrentPage() == 1)
    {
      if (pageFooterStyle.getBooleanStyleProperty(BandStyleKeys.DISPLAY_ON_FIRSTPAGE) == true)
      {
        print(getRuntime(), pageFooter);
      }
      else if (somethingSticks)
      {
        printEmptyRootLevelBand();
      }
    }
    else if (isLastPagebreak())
    {
      if (pageFooterStyle.getBooleanStyleProperty(BandStyleKeys.DISPLAY_ON_LASTPAGE, false) == true)
      {
        print(getRuntime(), pageFooter);
      }
      else if (somethingSticks)
      {
        printEmptyRootLevelBand();
      }
    }
    else
    {
      if (somethingSticks)
      {
        printEmptyRootLevelBand();
      }
      else
      {
        print(getRuntime(), pageFooter);
      }
    }
    somethingSticks |= pageFooter.isSticky();

    for (int i = 0; i < levelCount; i++)
    {
      final LayouterLevel level = levels[i];
      final ReportDefinition def = level.getReportDefinition();
      final PageFooter b = def.getPageFooter();
      if (b.isSticky() == false)
      {
        if (somethingSticks)
        {
          printEmptyRootLevelBand();
View Full Code Here

        return base;
      }
      final Section parentSection = e.getParentSection();
      if (parentSection != null)
      {
        final ReportDefinition reportDefinition1 = parentSection.getReportDefinition();
        if (reportDefinition1 instanceof AbstractReportDefinition)
        {
          e = (AbstractReportDefinition) reportDefinition1;
        }
        else
View Full Code Here

        return base;
      }
      final Section parentSection = e.getParentSection();
      if (parentSection != null)
      {
        final ReportDefinition reportDefinition1 = parentSection.getReportDefinition();
        if (reportDefinition1 instanceof AbstractReportDefinition)
        {
          e = (AbstractReportDefinition) reportDefinition1;
        }
        else
View Full Code Here

    while (e != null)
    {
      final Section parentSection = e.getParentSection();
      if (parentSection != null)
      {
        final ReportDefinition reportDefinition1 = parentSection.getReportDefinition();
        if (reportDefinition1 instanceof MasterReport)
        {
          return (MasterReport) reportDefinition1;
        }
        else if (reportDefinition1 instanceof AbstractReportDefinition)
View Full Code Here

  private void handleStyleClass(final PropertyAttributes attr)
  {
    final String styleClass = attr.getValue(getUri(), AbstractElementReadHandler.STYLE_CLASS_ATT);
    if (styleClass != null)
    {
      final ReportDefinition report = (ReportDefinition) getRootHandler().getHelperObject
          (ReportParserUtil.HELPER_OBJ_REPORT_NAME);
      final ElementStyleSheet existingStyleSheet =
          report.getStyleSheetCollection().getStyleSheet(styleClass);
      if (existingStyleSheet != null)
      {
        getBand().getStyle().addParent(existingStyleSheet);
      }
      else
      {
        getBand().getStyle().addParent
            (report.getStyleSheetCollection().createStyleSheet(styleClass));
      }
    }
  }
View Full Code Here

    element = getElementFactory().createElement();
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource());

    if (styleClass != null)
    {
      final ReportDefinition report = (ReportDefinition) getRootHandler().getHelperObject
          (ReportParserUtil.HELPER_OBJ_REPORT_NAME);
      final ElementStyleSheet existingStyleSheet =
          report.getStyleSheetCollection().getStyleSheet(styleClass);
      if (existingStyleSheet != null)
      {
        element.getStyle().addParent(existingStyleSheet);
      }
      else
      {
        element.getStyle().addParent(report.getStyleSheetCollection().createStyleSheet(styleClass));
      }
    }

    for (int i = 0; i < styleExpressionHandlers.size(); i++)
    {
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.