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

Examples of org.pentaho.reporting.engine.classic.core.modules.output.pageable.graphics.PrintReportProcessor


    PrintRequestAttributeSet attributes =
        Java14PrintUtil.copyConfiguration(null, report);
    attributes = Java14PrintUtil.copyAuxillaryAttributes(attributes, report);

    final PrintReportProcessor reportPane = new PrintReportProcessor(report);
    final DocPrintJob job = printService.createPrintJob();
    final SimpleDoc document = new SimpleDoc
        (reportPane, DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);

    try
    {
      job.print(document, attributes);
    }
    finally
    {
      reportPane.close();
    }

  }
View Full Code Here


    if (service == null)
    {
      return false;
    }

    final PrintReportProcessor reportPane = new PrintReportProcessor(report);
    if (progressListener != null)
    {
      reportPane.addReportProgressListener(progressListener);
    }

    try
    {
      reportPane.fireProcessingStarted();

      final DocPrintJob job = service.createPrintJob();
      final SimpleDoc document = new SimpleDoc
          (reportPane, DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);

      job.print(document, attributes);
    }
    finally
    {
      reportPane.fireProcessingFinished();
      reportPane.close();

      if (progressListener != null)
      {
        reportPane.removeReportProgressListener(progressListener);
      }
    }
    return true;
  }
View Full Code Here

    final MasterReport report = (MasterReport) directly.getResource();
    final EventMonitorFunction eventMonitorFunction = new EventMonitorFunction("Name");
    eventMonitorFunction.setDeepTraversing(true);
    report.addExpression(eventMonitorFunction);

    final PrintReportProcessor prc = new PrintReportProcessor(report);
    final PageDrawable pageDrawable = prc.getPageDrawable(2);
    assertNotNull(pageDrawable);
    final RenderNode[] renderNodes = pageDrawable.getNodesAt(1, 1, null, null);
    for (int i = 0; i < renderNodes.length; i++)
    {
      RenderNode renderNode = renderNodes[i];
View Full Code Here

  public static boolean execGraphics2D(final MasterReport report)
  {
    try
    {
      final PrintReportProcessor proc = new PrintReportProcessor(report);
      final int nop = proc.getNumberOfPages();
      if (proc.isError())
      {
        throw proc.getErrorReason();
      }
      if (nop == 0)
      {
        return false;
      }
      for (int i = 0; i < nop; i++)
      {
        if (proc.getPageDrawable(i) == null)
        {
          return false;
        }
      }
      proc.close();
      return true;
    }
    catch (ReportParameterValidationException ve)
    {
      final ValidationResult validationResult = ve.getValidationResult();
View Full Code Here

  public static boolean execGraphics2D(final MasterReport report)
  {
    try
    {
      final PrintReportProcessor proc = new PrintReportProcessor(report);
      final int nop = proc.getNumberOfPages();
      if (proc.isError())
      {
        if (proc.getErrorReason() instanceof ReportParameterValidationException)
        {
          return true;
        }
        return false;
      }
      if (nop == 0)
      {
        return false;
      }
      for (int i = 0; i < nop; i++)
      {
        if (proc.getPageDrawable(i) == null)
        {
          return false;
        }
      }
      proc.close();
      return true;
    }
    catch (ReportParameterValidationException p)
    {
      // reports that have mandatory parameters are ok to fail.
View Full Code Here

    final MasterReport report = (MasterReport) directly.getResource();
    final EventMonitorFunction eventMonitorFunction = new EventMonitorFunction("Name");
    eventMonitorFunction.setDeepTraversing(true);
    report.addExpression(eventMonitorFunction);

    final PrintReportProcessor prc = new PrintReportProcessor(report);
    assertEquals("18 pages", 18, prc.getNumberOfPages());
    final PageDrawable pageDrawable = prc.getPageDrawable(2);
    assertNotNull(pageDrawable);
    final RenderNode[] renderNodes = pageDrawable.getNodesAt(1, 1, null, null);
    for (int i = 0; i < renderNodes.length; i++)
    {
      RenderNode renderNode = renderNodes[i];
View Full Code Here

    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource directly = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();

    final PrintReportProcessor prc = new PrintReportProcessor(report);
    if (prc.isError())
    {
      prc.getErrorReason().printStackTrace();
      fail();
    }
    final PageDrawable pageDrawable = prc.getPageDrawable(20);
    assertNotNull(pageDrawable);
    for (int i = 0; i < prc.getNumberOfPages(); i++)
    {
      System.out.println("I = " + i);
      if (i == 6)
      {
        DebugLog.logHere();
      }
      System.out.println(prc.getPageDrawable(i));

    }
  }
View Full Code Here

    final MasterReport report = (MasterReport) directly.getResource();
    final EventMonitorFunction eventMonitorFunction = new EventMonitorFunction("Name");
    eventMonitorFunction.setDeepTraversing(true);
    report.addExpression(eventMonitorFunction);

    final PrintReportProcessor prc = new PrintReportProcessor(report);
    final PageDrawable pageDrawable = prc.getPageDrawable(2);
    assertNotNull(pageDrawable);
    final RenderNode[] renderNodes = pageDrawable.getNodesAt(1, 1, null, null);
    for (int i = 0; i < renderNodes.length; i++)
    {
      RenderNode renderNode = renderNodes[i];
View Full Code Here


    try
    {
      final MasterReport reportJob = getReportJob();
      printReportProcessor = new PrintReportProcessor(reportJob);

      paginationWorker = createWorker();
      paginationWorker.setWorkload(new RepaginationRunnable(printReportProcessor));
    }
    catch (ReportProcessingException e)
View Full Code Here

  }

  public void testPageCount() throws Exception
  {
    final MasterReport report = getReport();
    final PrintReportProcessor proc = new PrintReportProcessor(report);
    assertEquals(3, proc.getNumberOfPages());
    proc.close();
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.modules.output.pageable.graphics.PrintReportProcessor

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.