Package org.pentaho.reporting.libraries.resourceloader

Examples of org.pentaho.reporting.libraries.resourceloader.ResourceManager.createDirectly()


  @Test
  public void testGraphics2D() throws Exception
  {
    URL resource = getClass().getResource("rich-text-sample1.prpt");
    ResourceManager mgr = new ResourceManager();
    MasterReport report = (MasterReport) mgr.createDirectly(resource, MasterReport.class).getResource();
    report.getReportConfiguration().setConfigProperty(ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "true");

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);
    RenderNode first = MatchFactory.findElementByName(logicalPageBox, "first");
    assertNotNull(first);
View Full Code Here


  @Test
  public void testLineBreaking() throws Exception
  {
    URL resource = getClass().getResource("rich-text-sample1.prpt");
    ResourceManager mgr = new ResourceManager();
    MasterReport report = (MasterReport) mgr.createDirectly(resource, MasterReport.class).getResource();
    report.getReportConfiguration().setConfigProperty(ClassicEngineCoreModule.COMPLEX_TEXT_CONFIG_OVERRIDE_KEY, "true");
    report.getReportHeader().removeElement(report.getReportHeader().getElement(0));
    report.getReportHeader().getElement(0).getStyle().setStyleProperty(TextStyleKeys.DIRECTION, TextDirection.RTL);

    LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);
View Full Code Here

    final URL resource = getClass().getResource("Prd-4653.prpt");
    assertNotNull(resource);

    final ResourceManager mgr = new ResourceManager();
    mgr.registerDefaults();
    final Resource parsed = mgr.createDirectly(resource, MasterReport.class);
    final MasterReport report = (MasterReport) parsed.getResource();
    report.getRootGroup().getElement(0).setName("master-group-header");

    final LogicalPageBox page = DebugReportRunner.layoutPage(report, 1);
    final RenderNode[] elementsByName = MatchFactory.findElementsByName(page, "master-group-header");
View Full Code Here

  {
    final URL url = getClass().getResource("Prd-3529-Stripped.prpt");
    assertNotNull(url);
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource directly = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();

    if (logger.isDebugEnabled())
    {
      final byte[] bytes = DebugReportRunner.createXmlTablePageable(report);
View Full Code Here


    final URL target = LayoutTest.class.getResource("layouting.xml");
    final ResourceManager rm = new ResourceManager();
    rm.registerDefaults();
    final Resource directly = rm.createDirectly(target, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();

    final Band band = report.getReportHeader();
    band.setName("ReportHeader1");
    DebugReportRunner.layoutSingleBand(report, report.getReportHeader(), false, true);
View Full Code Here

      throws ParseException
  {
    try
    {
      final ResourceManager mgr = new ResourceManager();
      final Resource resource = mgr.createDirectly(templateURL, MasterReport.class);
      final MasterReport report = (MasterReport) resource.getResource();
      final URL imageURL = ObjectUtilities.getResource
          ("org/pentaho/reporting/engine/classic/demo/opensource/gorilla.jpg", StraightToPDF.class);
      final Image image = Toolkit.getDefaultToolkit().createImage(imageURL);
      final WaitingImageObserver obs = new WaitingImageObserver(image);
View Full Code Here

      throws ParseException
  {
    try
    {
      final ResourceManager mgr = new ResourceManager();
      final Resource resource = mgr.createDirectly(templateURL, MasterReport.class);
      final MasterReport report = (MasterReport) resource.getResource();
      // plain text does not support images, so we do not care about the logo ..
      report.getParameterValues().put("logo", null);
      return report;
    }
View Full Code Here

  {
    final URL url = getClass().getResource("Crosstab-List.prpt");
    assertNotNull(url);
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource directly = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();
    report.setCompatibilityLevel(ClassicEngineBoot.computeVersionId(4, 0, 0));

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 0);
    //ModelPrinter.print(logicalPageBox);
View Full Code Here

    basereport.setPageDefinition(new SimplePageDefinition(new PageFormat()));

    final URL target = LayoutTest.class.getResource("padding-test.xml");
    final ResourceManager rm = new ResourceManager();
    rm.registerDefaults();
    final Resource directly = rm.createDirectly(target, MasterReport.class);
    final MasterReport report = (MasterReport) directly.getResource();

    final LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand
        (basereport, report.getReportHeader());
    // simple test, we assert that all paragraph-poolboxes are on either 485000 or 400000
View Full Code Here

    saveReport(report, new File("bin/test-tmp/prd-3159-load-save-1.prpt"));

    // load it to establish the context in all resource-keys ..
    final ResourceManager mgr = new ResourceManager();
    mgr.registerDefaults();
    final Resource resource = mgr.createDirectly(new File("bin/test-tmp/prd-3159-load-save-1.prpt"), MasterReport.class);

    // save it once, that changes the bundle ...
    final MasterReport report2 = (MasterReport) resource.getResource();
    saveReport(report2, new File("bin/test-tmp/prd-3159-load-save-2.prpt"));
    // save it twice, that triggers the crash...
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.