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

Examples of org.pentaho.reporting.engine.classic.core.layout.output.ReportProcessor


      final FileRepository targetRepository = new FileRepository(targetDirectory);
      final ContentLocation targetRoot = targetRepository.getRoot();

      final FileRepository dataRepository = new FileRepository(dataDirectory);
      final ContentLocation dataRoot = dataRepository.getRoot();
      final ReportProcessor sp;
      if ("pageable".equals(exportMethod))//$NON-NLS-1$
      {
        final PageableHtmlOutputProcessor outputProcessor = new PageableHtmlOutputProcessor(report.getConfiguration());
        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());
        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 FlowReportProcessor(report, outputProcessor);
      }
      if (progressDialog != null)
      {
        progressDialog.setModal(false);
        progressDialog.setVisible(true);
        sp.addReportProgressListener(progressDialog);
      }
      sp.processReport();
      sp.close();

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

      if (statusListener != null)
      {
        statusListener.setStatus(StatusType.INFORMATION, messages.getString
View Full Code Here


      final ZipRepository zipRepository = new ZipRepository(out);
      final ContentLocation root = zipRepository.getRoot();
      final ContentLocation data = RepositoryUtilities.createLocation
          (zipRepository, RepositoryUtilities.splitPath(dataDirectory, "/")); //$NON-NLS-1$

      final ReportProcessor sp;
      if ("pageable".equals(exportMethod))//$NON-NLS-1$
      {
        final PageableHtmlOutputProcessor outputProcessor = new PageableHtmlOutputProcessor(report.getConfiguration());
        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());
        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 FlowReportProcessor(report, outputProcessor);
      }
      if (progressDialog != null)
      {
        progressDialog.setModal(false);
        progressDialog.setVisible(true);
        sp.addReportProgressListener(progressDialog);
      }
      sp.processReport();
      sp.close();

      zipRepository.close();
      out.close();
      out = null;

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

      if (statusListener != null)
      {
        statusListener.setStatus(StatusType.INFORMATION, messages.getString
View Full Code Here

    final StreamHtmlOutputProcessor outputProcessor = new StreamHtmlOutputProcessor(report.getConfiguration());
    //outputProcessor.setFlowSelector(new DisplayAllInterceptor());
    final HtmlPrinter printer = new SingleItemHtmlPrinter(report.getResourceManager(), null);

    outputProcessor.setPrinter(printer);
    final ReportProcessor srp = new StreamReportProcessor(report, outputProcessor);
    srp.processReport();

  }
View Full Code Here

        final FileOutputStream fout = new FileOutputStream(tempFile);
        try
        {
          final BufferedOutputStream bout = new BufferedOutputStream(fout);
          ReportStructureValidator validator = new ReportStructureValidator();
          ReportProcessor reportProcessor;
          if (validator.isValidForFastProcessing(report) == false)
          {
            final FlowExcelOutputProcessor target =
                new FlowExcelOutputProcessor(report.getConfiguration(), bout, report.getResourceManager());
            target.setUseXlsxFormat(true);
            reportProcessor = new FlowReportProcessor(report, target);
          }
          else
          {
            reportProcessor = new FastExcelExportProcessor(report, bout, true);
          }

          reportProcessor.addReportProgressListener(progressDialog);
          progressDialog.setVisibleInEDT(true);

          reportProcessor.processReport();
          reportProcessor.close();
          bout.flush();
          reportProcessor.removeReportProgressListener(progressDialog);
        }
        finally
        {
          fout.close();
        }
View Full Code Here

        try
        {
          final BufferedOutputStream bout = new BufferedOutputStream(fout);

          ReportStructureValidator validator = new ReportStructureValidator();
          ReportProcessor reportProcessor;
          if (validator.isValidForFastProcessing(report) == false)
          {
            final FlowExcelOutputProcessor target =
                new FlowExcelOutputProcessor(report.getConfiguration(), bout, report.getResourceManager());
            target.setUseXlsxFormat(false);
            reportProcessor = new FlowReportProcessor(report, target);
          }
          else
          {
            reportProcessor = new FastExcelExportProcessor(report, bout, false);
          }

          reportProcessor.addReportProgressListener(progressDialog);
          progressDialog.setVisibleInEDT(true);

          reportProcessor.processReport();
          reportProcessor.close();
          bout.flush();
          reportProcessor.removeReportProgressListener(progressDialog);
        }
        finally
        {
          fout.close();
        }
View Full Code Here

        try
        {

          final BufferedOutputStream bout = new BufferedOutputStream(fout);

          ReportProcessor reportProcessor;
          ReportStructureValidator validator = new ReportStructureValidator();
          if (validator.isValidForFastProcessing(report) == false)
          {
            final StreamCSVOutputProcessor target = new StreamCSVOutputProcessor(bout);
            reportProcessor = new StreamReportProcessor(report, target);
          }
          else
          {
            reportProcessor = new FastCsvExportProcessor(report, bout);
          }

          reportProcessor.addReportProgressListener(progressDialog);
          progressDialog.setVisibleInEDT(true);

          reportProcessor.processReport();
          reportProcessor.close();
          bout.flush();
          reportProcessor.removeReportProgressListener(progressDialog);
        }
        finally
        {
          fout.close();
        }
View Full Code Here

        {
          final FileRepository targetRepository = new FileRepository(tempDir);
          final ContentLocation targetRoot = targetRepository.getRoot();


          ReportProcessor reportProcessor;
          ReportStructureValidator validator = new ReportStructureValidator();
          if (validator.isValidForFastProcessing(report) == false)
          {
            final HtmlOutputProcessor outputProcessor = new StreamHtmlOutputProcessor(report.getConfiguration());
            final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
            printer.setContentWriter(targetRoot, new DefaultNameGenerator(targetRoot, "index", "html"));
            printer.setDataWriter(targetRoot, new DefaultNameGenerator(targetRoot, "content")); //$NON-NLS-1$
            printer.setUrlRewriter(new FileSystemURLRewriter());
            outputProcessor.setPrinter(printer);
            reportProcessor = new StreamReportProcessor(report, outputProcessor);
          }
          else
          {
            FastHtmlContentItems printer = new FastHtmlContentItems();
            printer.setContentWriter(targetRoot, new DefaultNameGenerator(targetRoot, "index", "html"));
            printer.setDataWriter(targetRoot, new DefaultNameGenerator(targetRoot, "content")); //$NON-NLS-1$
            printer.setUrlRewriter(new FileSystemURLRewriter());
            reportProcessor = new FastHtmlExportProcessor(report, printer);
          }

          reportProcessor.addReportProgressListener(progressDialog);
          progressDialog.setVisibleInEDT(true);

          reportProcessor.processReport();
          reportProcessor.close();

          reportProcessor.removeReportProgressListener(progressDialog);
          progressDialog.setVisibleInEDT(false);

          final File previewFile = new File(tempDir, "index.html");//$NON-NLS-1$
          ExternalToolLauncher.openURL(previewFile.toURI().toURL().toExternalForm());
        }
View Full Code Here

      final LocalFontRegistry localFontRegistry = new LocalFontRegistry();
      localFontRegistry.initialize();
      final XmlTableOutputProcessor outputProcessor =
          new XmlTableOutputProcessor(outputStream, new XmlTableOutputProcessorMetaData(
              XmlTableOutputProcessorMetaData.PAGINATION_FULL, localFontRegistry));
      final ReportProcessor streamReportProcessor = new PageableReportProcessor(report, outputProcessor);
      try
      {
        streamReportProcessor.processReport();
      }
      finally
      {
        streamReportProcessor.close();
      }
    }
    finally
    {
      outputStream.close();
View Full Code Here

    final InterceptingXmlTableOutputProcessor outputProcessor = new InterceptingXmlTableOutputProcessor
        (new NullOutputStream(), new XmlTableOutputProcessorMetaData
            (XmlTableOutputProcessorMetaData.PAGINATION_MANUAL, localFontRegistry));
    outputProcessor.setFlowSelector(new SinglePageFlowSelector(page, true));
    final ReportProcessor proc = new FlowReportProcessor(report, outputProcessor);
    proc.processReport();

    if (outputProcessor.getLogicalPageBox() == null)
    {
      Assert.fail("Did not find the requested page");
    }
View Full Code Here

    try
    {
      final XmlTableOutputProcessor outputProcessor =
          new XmlTableOutputProcessor(outputStream, new XmlTableOutputProcessorMetaData(
              XmlTableOutputProcessorMetaData.PAGINATION_FULL, localFontRegistry));
      final ReportProcessor streamReportProcessor = new PageableReportProcessor(report, outputProcessor);
      try
      {
        streamReportProcessor.processReport();
      }
      finally
      {
        streamReportProcessor.close();
      }
    }
    finally
    {
      outputStream.close();
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.layout.output.ReportProcessor

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.