Package org.pentaho.reporting.engine.classic.core.modules.output.pageable.base

Examples of org.pentaho.reporting.engine.classic.core.modules.output.pageable.base.PageableReportProcessor


  {
    OutputStream out = new NullOutputStream();
    try
    {
      final PdfOutputProcessor outputProcessor = new PdfOutputProcessor(report.getConfiguration(), out, report.getResourceManager());
      final PageableReportProcessor proc = new PageableReportProcessor(report, outputProcessor);
      proc.processReport();
      return true;
    }
    catch (ReportParameterValidationException e)
    {
     return true;
View Full Code Here


      final OutputStream outputStream = contentItem.getOutputStream();

      try
      {
        final PdfOutputProcessor outputProcessor = new PdfOutputProcessor(configuration, outputStream);
        final PageableReportProcessor streamReportProcessor =
            new PageableReportProcessor(masterReport, outputProcessor);
        try
        {
          final ReportProgressListener[] progressListeners = getReportProgressListeners();
          for (int i = 0; i < progressListeners.length; i++)
          {
            final ReportProgressListener listener = progressListeners[i];
            streamReportProcessor.addReportProgressListener(listener);
          }
          streamReportProcessor.processReport();
        }
        finally
        {
          streamReportProcessor.close();
        }
      }
      finally
      {
        outputStream.close();
View Full Code Here

        final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
        printer.setContentWriter(targetRoot, new DefaultNameGenerator(targetRoot, filename, suffix));
        printer.setDataWriter(dataRoot, new DefaultNameGenerator(dataRoot, "content")); //$NON-NLS-1$
        printer.setUrlRewriter(new FileSystemURLRewriter());
        outputProcessor.setPrinter(printer);
        sp = new PageableReportProcessor(report, outputProcessor);
      }
      else
      {
        final HtmlOutputProcessor outputProcessor = createOutputProcessor();
        final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
View Full Code Here

        final TextFilePrinterDriver driver = new TextFilePrinterDriver
            (outputStream, ParserUtil.parseInt(cpiText, 10), ParserUtil.parseInt(lpiText, 6));

        final PageableTextOutputProcessor outputProcessor =
            new PageableTextOutputProcessor(driver, configuration);
        final PageableReportProcessor streamReportProcessor =
            new PageableReportProcessor(masterReport, outputProcessor);
        try
        {
          final ReportProgressListener[] progressListeners = getReportProgressListeners();
          for (int i = 0; i < progressListeners.length; i++)
          {
            final ReportProgressListener listener = progressListeners[i];
            streamReportProcessor.addReportProgressListener(listener);
          }
          streamReportProcessor.processReport();
        }
        finally
        {
          streamReportProcessor.close();
        }
      }
      finally
      {
        outputStream.close();
View Full Code Here

        final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
        printer.setContentWriter(root, new DefaultNameGenerator(root, "report.html")); //$NON-NLS-1$
        printer.setDataWriter(data, new DefaultNameGenerator(data, "content")); //$NON-NLS-1$
        printer.setUrlRewriter(new SingleRepositoryURLRewriter());
        outputProcessor.setPrinter(printer);
        sp = new PageableReportProcessor(report, outputProcessor);
      }
      else
      {
        final HtmlOutputProcessor outputProcessor = createOutputProcessor();
        final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
View Full Code Here

  /**
   * Exports the report into a plain text file.
   */
  public void run()
  {
    PageableReportProcessor proc = null;
    OutputStream out = null;
    File file = null;
    try
    {
      file = new File(fileName).getCanonicalFile();
      final File directory = file.getParentFile();
      if (directory != null)
      {
        if (directory.exists() == false)
        {
          if (directory.mkdirs() == false)
          {
            PlainTextExportTask.logger.warn("Can't create directories. Hoping and praying now.."); //$NON-NLS-1$
          }
        }
      }
      out = new BufferedOutputStream(new FileOutputStream(file));

      final PageableTextOutputProcessor outputProcessor = new PageableTextOutputProcessor
          (getPrinterCommandSet(out), report.getConfiguration());
      proc = new PageableReportProcessor(report, outputProcessor);

      if (progressDialog != null)
      {
        progressDialog.setModal(false);
        progressDialog.setVisible(true);
        proc.addReportProgressListener(progressDialog);
      }

      proc.processReport();

      if (statusListener != null)
      {
        statusListener.setStatus
            (StatusType.INFORMATION, messages.getString("PlainTextExportTask.USER_TASK_FINISHED"), null); //$NON-NLS-1$
      }
    }
    catch (ReportInterruptedException re)
    {
      if (statusListener != null)
      {
        statusListener.setStatus
            (StatusType.WARNING, messages.getString("PlainTextExportTask.USER_TASK_ABORTED"), null); //$NON-NLS-1$
      }
      try
      {
        out.close();
        out = null;
        if (file.delete() == false)
        {
          PlainTextExportTask.logger.warn("Unable to delete incomplete export:" + file); //$NON-NLS-1$
        }
      }
      catch (SecurityException se)
      {
        // ignore me
      }
      catch (IOException ioe)
      {
        // ignore me...
      }
    }
    catch (Exception re)
    {
      PlainTextExportTask.logger.error("PlainText export failed", re); //$NON-NLS-1$
      if (statusListener != null)
      {
        statusListener.setStatus
            (StatusType.ERROR, messages.getString("PlainTextExportTask.USER_TASK_FAILED"), re); //$NON-NLS-1$
      }
    }
    finally
    {
      try
      {
        if (out != null)
        {
          out.close();
        }
      }
      catch (Exception e)
      {
        PlainTextExportTask.logger.error("Unable to close the output stream.", e); //$NON-NLS-1$
        // if there is already another error, this exception is
        // just a minor obstactle. Something big crashed before ...
      }

      if (progressDialog != null)
      {
        proc.removeReportProgressListener(progressDialog);
      }

    }
    if (progressDialog != null)
    {
View Full Code Here

      pc.setEndOfLine(lineSeparator.toCharArray());
      pc.setEndOfPage(lineSeparator.toCharArray());

      final PageableTextOutputProcessor outputProcessor = new PageableTextOutputProcessor(pc,
          report.getConfiguration());
      final PageableReportProcessor proc = new PageableReportProcessor(report, outputProcessor);
      proc.processReport();
      proc.close();
      fout.close();
      fout = null;
    }
    finally
    {
View Full Code Here

    final TextFilePrinterDriver pc = new TextFilePrinterDriver(outputStream, charsPerInch, linesPerInch);
    final PageableTextOutputProcessor outputProcessor = new PageableTextOutputProcessor(pc, report.getConfiguration());
    outputProcessor.setEncoding(encoding);

    final PageableReportProcessor proc = new PageableReportProcessor(report, outputProcessor);
    proc.processReport();
    proc.close();
  }
View Full Code Here

   *
   * @see Thread#run()
   */
  public void run()
  {
    PageableReportProcessor proc = null;
    OutputStream fout = null;
    try
    {
      fout = new BufferedOutputStream(new FileOutputStream(targetFile));
      final PdfOutputProcessor outputProcessor = new PdfOutputProcessor(report.getConfiguration(), fout,
          report.getResourceManager());
      proc = new PageableReportProcessor(report, outputProcessor);
      if (progressListener != null)
      {
        proc.addReportProgressListener(progressListener);
        progressListener.setVisible(true);
      }
      proc.processReport();
      if (statusListener != null)
      {
        statusListener.setStatus
            (StatusType.INFORMATION, messages.getString("PdfExportTask.USER_EXPORT_COMPLETE"), null); //$NON-NLS-1$
      }
    }
    catch (Exception e)
    {
      if (statusListener != null)
      {
        statusListener.setStatus
            (StatusType.ERROR, messages.getString("PdfExportTask.USER_EXPORT_FAILED"), e); //$NON-NLS-1$
      }
      PdfExportTask.logger.error("Failed"); //$NON-NLS-1$
    }
    finally
    {
      if (proc != null)
      {
        if (progressListener != null)
        {
          proc.removeReportProgressListener(progressListener);
        }
        proc.close();
      }
      if (fout != null)
      {
        try
        {
View Full Code Here

      try
      {
        final PageableExcelOutputProcessor outputProcessor =
            new PageableExcelOutputProcessor(configuration, outputStream, masterReport.getResourceManager());
        outputProcessor.setUseXlsxFormat(true);
        final PageableReportProcessor streamReportProcessor =
            new PageableReportProcessor(masterReport, outputProcessor);
        try
        {
          final ReportProgressListener[] progressListeners = getReportProgressListeners();
          for (int i = 0; i < progressListeners.length; i++)
          {
            final ReportProgressListener listener = progressListeners[i];
            streamReportProcessor.addReportProgressListener(listener);
          }
          streamReportProcessor.processReport();
        }
        finally
        {
          streamReportProcessor.close();
        }
      }
      finally
      {
        outputStream.close();
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.modules.output.pageable.base.PageableReportProcessor

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.