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

Examples of org.pentaho.reporting.engine.classic.core.event.ReportProgressEvent


    throw new UnsupportedOperationException("Printing is a passive process.");
  }

  public void fireProcessingStarted()
  {
    fireProcessingStarted(new ReportProgressEvent(this));
  }
View Full Code Here


    fireProcessingStarted(new ReportProgressEvent(this));
  }

  public void fireProcessingFinished()
  {
    fireProcessingFinished(new ReportProgressEvent(this));
  }
View Full Code Here

    else
    {
      eventTrigger = Math.min(maxRows, Math.max(maxRows / MAX_EVENTS_PER_RUN, MIN_ROWS_PER_EVENT));
    }

    final ReportProgressEvent repaginationState = new ReportProgressEvent(this);
    // Function processing does not use the PageLayouter, so we don't need
    // the expensive cloning ...
    while (!state.isFinish())
    {
      checkInterrupted();
      if (lastRow != state.getCurrentDataItem())
      {
        lastRow = state.getCurrentDataItem();
        if (eventCount == 0)
        {
          repaginationState.reuse(ReportProgressEvent.PRECOMPUTING_VALUES, state.getCurrentDataItem(), state.getNumberOfRows(),
              state.getCurrentPage(), state.getProgressLevel(), state.getProgressLevelCount());
          fireStateUpdate(repaginationState);
          eventCount += 1;
        }
        else
View Full Code Here

      final ProcessState initialReportState = startState.deriveForStorage();
      final PageState initialPageState = new PageState(initialReportState, outputProcessor.getPageCursor());
      pageStates.add(initialPageState);

      final ReportProgressEvent repaginationState = new ReportProgressEvent(this);

      // inner loop: process the complete report, calculate the function values
      // for the current level. Higher level functions are not available in the
      // dataRow.
      final int eventTrigger;
      if (maxRows <= 0)
      {
        eventTrigger = Math.max(maxRows / MAX_EVENTS_PER_RUN, MIN_ROWS_PER_EVENT);
      }
      else
      {
        eventTrigger = Math.min(maxRows, Math.max(maxRows / MAX_EVENTS_PER_RUN, MIN_ROWS_PER_EVENT));
      }

      ProcessState state = startState.deriveForStorage();
      state.setErrorHandler(errorHandler);
      validate(state);

      int pageEventCount = 0;
      // First and last derive of a page must be a storage derivate - this clones everything and does
      // not rely on the more complicated transactional layouting ..
      ProcessState fallBackState = state.deriveForPagebreak();
      ProcessState globalState = state.deriveForStorage();

      ReportStateKey rollbackPageState = null;
      boolean isInRollBackMode = false;
      final boolean pagebreaksSupported = isPagebreaksSupported();

      int eventCount = 0;
      int lastRow = -1;
      while (!state.isFinish())
      {
        int logPageCount = outputProcessor.getLogicalPageCount();
        int physPageCount = outputProcessor.getPhysicalPageCount();

        checkInterrupted();
        if (lastRow != state.getCurrentDataItem())
        {
          lastRow = state.getCurrentDataItem();
          if (eventCount == 0)
          {
            if (isPagebreaksSupported() && fallBackState != null)
            {
              repaginationState.reuse(ReportProgressEvent.PAGINATING,
                  fallBackState.getCurrentDataItem(), fallBackState.getNumberOfRows(), fallBackState.getCurrentPage(),
                  fallBackState.getProgressLevel(), fallBackState.getProgressLevelCount());
            }
            else
            {
              repaginationState.reuse(ReportProgressEvent.PAGINATING,
                  state.getCurrentDataItem(), state.getNumberOfRows(), state.getCurrentPage(),
                  state.getProgressLevel(), state.getProgressLevelCount());
            }
            fireStateUpdate(repaginationState);
            eventCount += 1;
View Full Code Here

    try
    {
      final ProcessState startState = pageState.getReportState();
      outputProcessor.setPageCursor(pageState.getPageCursor());
      final int maxRows = startState.getNumberOfRows();
      final ReportProgressEvent repaginationState = new ReportProgressEvent(this);
      final DefaultLayoutPagebreakHandler pagebreakHandler = new DefaultLayoutPagebreakHandler();
      // inner loop: process the complete report, calculate the function values
      // for the current level. Higher level functions are not available in the
      // dataRow.
      final int eventTrigger;
      if (maxRows <= 0)
      {
        eventTrigger = Math.max(maxRows / MAX_EVENTS_PER_RUN, MIN_ROWS_PER_EVENT);
      }
      else
      {
        eventTrigger = Math.min(maxRows, Math.max(maxRows / MAX_EVENTS_PER_RUN, MIN_ROWS_PER_EVENT));
      }

      final boolean pagebreaksSupported = isPagebreaksSupported();

      ReportStateKey rollbackPageState = null;

      ProcessState state = startState.deriveForStorage();
      ProcessState fallBackState = state.deriveForPagebreak();
      final ProcessState globalState = state.deriveForStorage();
      state.setErrorHandler(errorHandler);

      boolean isInRollBackMode = false;
      int lastRow = -1;
      int eventCount = 0;
      int pageEventCount = 0;
      while (!state.isFinish())
      {
        checkInterrupted();
        if (lastRow != state.getCurrentDataItem())
        {
          lastRow = state.getCurrentDataItem();
          if (eventCount == 0)
          {
            repaginationState.reuse(ReportProgressEvent.GENERATING_CONTENT,
                state.getCurrentDataItem(), maxRows, state.getCurrentPage(),
                state.getProgressLevel(), state.getProgressLevelCount());
            fireStateUpdate(repaginationState);
            eventCount += 1;
          }
View Full Code Here

    }
  }

  public boolean paginate() throws ReportProcessingException
  {
    fireProcessingStarted(new ReportProgressEvent(this));

    try
    {
      if (isPaginated() == false)
      {
        // Processes the whole report ..
        prepareReportProcessing();
      }
    }
    finally
    {
      fireProcessingFinished(new ReportProgressEvent(this));
    }
    return true;
  }
View Full Code Here

    }
    try
    {
      final long startTime = System.currentTimeMillis();

      fireProcessingStarted(new ReportProgressEvent(this));

      if (isPaginated() == false)
      {
        // Processes the whole report ..
        prepareReportProcessing();
      }

      final long paginateTime = System.currentTimeMillis();
      if (AbstractReportProcessor.logger.isDebugEnabled())
      {
        AbstractReportProcessor.logger.debug(new MemoryUsageMessage
            (System.identityHashCode(Thread.currentThread()) +
                ": Report processing time: Pagination time: " + ((paginateTime - startTime) / 1000.0)));
      }
      if (getLogicalPageCount() == 0)
      {
        throw new EmptyReportException("Report did not generate any content.");
      }

      // Start from scratch ...
      PageState state = getLogicalPageState(0);
      while (state != null)
      {
        state = processPage(state, true);
      }
      final long endTime = System.currentTimeMillis();
      if (AbstractReportProcessor.logger.isDebugEnabled())
      {
        AbstractReportProcessor.logger.debug(new MemoryUsageMessage
            (System.identityHashCode(Thread.currentThread()) +
                ": Report processing time: " + ((endTime - startTime) / 1000.0)));
      }
    }
    catch (EmptyReportException re)
    {
      throw re;
    }
    catch (ReportProcessingException re)
    {
      AbstractReportProcessor.logger.error(System.identityHashCode(
          Thread.currentThread()) + ": Report processing failed.");
      throw re;
    }
    catch (Exception e)
    {
      AbstractReportProcessor.logger.error(System.identityHashCode(
          Thread.currentThread()) + ": Report processing failed.");
      throw new ReportProcessingException("Failed to process the report", e);
    }
    fireProcessingFinished(new ReportProgressEvent(this, getPhysicalPageCount()));
    if (AbstractReportProcessor.logger.isDebugEnabled())
    {
      AbstractReportProcessor.logger.debug(System.identityHashCode(
          Thread.currentThread()) + ": Report processing finished.");
    }
View Full Code Here

    else
    {
      eventTrigger = Math.min(maxRows, Math.max(maxRows / MAX_EVENTS_PER_RUN, MIN_ROWS_PER_EVENT));
    }

    final ReportProgressEvent repaginationState = new ReportProgressEvent(this);
    // Function processing does not use the PageLayouter, so we don't need
    // the expensive cloning ...
    while (!state.isFinish())
    {
      checkInterrupted();
      if (lastRow != state.getCurrentRow())
      {
        lastRow = state.getCurrentRow();
        if (eventCount == 0)
        {
          repaginationState.reuse(ReportProgressEvent.PRECOMPUTING_VALUES, state, 0);
          fireStateUpdate(repaginationState);
          eventCount += 1;
        }
        else
        {
View Full Code Here

      final ProcessState initialReportState = startState.deriveForStorage();
      final PageState initialPageState = new PageState(initialReportState, outputProcessor.getPageCursor());
      pageStates.add(initialPageState);

      final ReportProgressEvent repaginationState = new ReportProgressEvent(this);

      // inner loop: process the complete report, calculate the function values
      // for the current level. Higher level functions are not available in the
      // dataRow.
      final int eventTrigger;
      if (maxRows <= 0)
      {
        eventTrigger = Math.max(maxRows / MAX_EVENTS_PER_RUN, MIN_ROWS_PER_EVENT);
      }
      else
      {
        eventTrigger = Math.min(maxRows, Math.max(maxRows / MAX_EVENTS_PER_RUN, MIN_ROWS_PER_EVENT));
      }

      ProcessState state = startState.deriveForStorage();
      state.setErrorHandler(errorHandler);
      validate(state);

      final OutputProcessorMetaData metaData =
          state.getFlowController().getReportContext().getOutputProcessorMetaData();
      pagebreaksSupported = metaData.isFeatureSupported(OutputProcessorFeature.PAGEBREAKS);

      int pageEventCount = 0;
      // First and last derive of a page must be a storage derivate - this clones everything and does
      // not rely on the more complicated transactional layouting ..
      ProcessState fallBackState = pagebreaksSupported ? state.deriveForPagebreak() : null;
      ProcessState globalState = pagebreaksSupported ? state.deriveForStorage() : null;

      ReportStateKey rollbackPageState = null;
      boolean isInRollBackMode = false;

      int eventCount = 0;
      int lastRow = -1;
      while (!state.isFinish())
      {
        int logPageCount = outputProcessor.getLogicalPageCount();
        int physPageCount = outputProcessor.getPhysicalPageCount();

        checkInterrupted();
        if (lastRow != state.getCurrentRow())
        {
          lastRow = state.getCurrentRow();
          if (eventCount == 0)
          {
            if (isPagebreaksSupported() && fallBackState != null)
            {
              repaginationState.reuse(ReportProgressEvent.PAGINATING, fallBackState, calculatePageCount(fallBackState));
            }
            else
            {
              repaginationState.reuse(ReportProgressEvent.PAGINATING, state, calculatePageCount(state));
            }
            fireStateUpdate(repaginationState);
            eventCount += 1;
          }
          else
View Full Code Here

    try
    {
      final ProcessState startState = pageState.getReportState();
      outputProcessor.setPageCursor(pageState.getPageCursor());
      final int maxRows = startState.getNumberOfRows();
      final ReportProgressEvent repaginationState = new ReportProgressEvent(this);
      final DefaultLayoutPagebreakHandler pagebreakHandler = new DefaultLayoutPagebreakHandler();
      // inner loop: process the complete report, calculate the function values
      // for the current level. Higher level functions are not available in the
      // dataRow.
      final int eventTrigger;
      if (maxRows <= 0)
      {
        eventTrigger = Math.max(maxRows / MAX_EVENTS_PER_RUN, MIN_ROWS_PER_EVENT);
      }
      else
      {
        eventTrigger = Math.min(maxRows, Math.max(maxRows / MAX_EVENTS_PER_RUN, MIN_ROWS_PER_EVENT));
      }

      final boolean pagebreaksSupported = isPagebreaksSupported();

      ReportStateKey rollbackPageState = null;

      ProcessState state = startState.deriveForStorage();
      ProcessState fallBackState = pagebreaksSupported ? state.deriveForPagebreak() : null;
      final ProcessState globalState = pagebreaksSupported ? state.deriveForStorage() : null;
      state.setErrorHandler(errorHandler);

      boolean isInRollBackMode = false;
      int lastRow = -1;
      int eventCount = 0;
      int pageEventCount = 0;
      while (!state.isFinish())
      {
        checkInterrupted();
        if (lastRow != state.getCurrentRow())
        {
          lastRow = state.getCurrentRow();
          if (eventCount == 0)
          {
            repaginationState.reuse(ReportProgressEvent.GENERATING_CONTENT, state, calculatePageCount(state));
            fireStateUpdate(repaginationState);
            eventCount += 1;
          }
          else
          {
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.event.ReportProgressEvent

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.