Package org.pentaho.reporting.libraries.resourceloader

Examples of org.pentaho.reporting.libraries.resourceloader.Resource


    public void run()
    {
      try
      {
        final ResourceManager mgr = new ResourceManager();
        final Resource directly = mgr.createDirectly(file, ElementStyleDefinition.class);
        styleDefinition = (ElementStyleDefinition) directly.getResource();
      }
      catch (Exception e)
      {
        this.exception = e;
      }
View Full Code Here


    {
      try
      {
        // Update the definition source to be the location from which the file is saved
        final ResourceManager resourceManager = report.getResourceManager();
        final Resource bundleResource = resourceManager.createDirectly(target, DocumentBundle.class);
        final DocumentBundle bundle = (DocumentBundle) bundleResource.getResource();
        final ResourceKey bundleKey = bundle.getBundleKey();
        report.setDefinitionSource(bundleKey);
        report.setContentBase(bundleKey);
        report.setBundle(bundle);
        report.setResourceManager(bundle.getResourceManager());
View Full Code Here

  }

  public static MasterReport loadReport(final Object selectedFile, final ResourceManager resourceManager)
      throws ResourceException, IOException
  {
    final Resource directly = resourceManager.createDirectly(selectedFile, MasterReport.class);
    final MasterReport resource = (MasterReport) directly.getResource();
    final DocumentBundle bundle = resource.getBundle();
    if (bundle == null)
    {
      // Ok, that should not happen if we work with the engine's parsers, but better safe than sorry.
      final MemoryDocumentBundle documentBundle = new MemoryDocumentBundle(resource.getContentBase());
View Full Code Here

  public void testItemBandLayout() throws ResourceException, ReportProcessingException, ContentProcessingException
  {
    final URL url = ReportLayouterTest.class.getResource("Prd-4109.prpt");
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource resource = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport report = (MasterReport) resource.getResource();

    final ReportLayouter l = new ReportLayouter
        (new ReportRenderContext(report, report, null, new GlobalAuthenticationStore()));
    final LogicalPageBox layout = l.layout();
View Full Code Here

  {
    final URL url = getClass().getResource("Prd-3931.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 pageBox = DebugReportRunner.layoutPage(report, 0);
  //  ModelPrinter.INSTANCE.print(pageBox);
  }
View Full Code Here

    final File file = new File (textField.getText());

    try
    {
      ResourceManager manager = new ResourceManager();
      Resource res = manager.createDirectly(file, MasterReport.class);
      return (MasterReport) res.getResource();
    }
    catch (Exception e)
    {
      throw new ReportDefinitionException("Parsing failed", e);
    }
View Full Code Here

  {
    final URL url = getClass().getResource("subreport-crash.prpt");
    assertNotNull(url);
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource directly = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport resource = (MasterReport) directly.getResource();

    DebugReportRunner.executeAll(resource);

  }
View Full Code Here

    // right now, this ends in a infinite loop. Not funny ..
    final URL url = getClass().getResource("subreport-pageheader.prpt");
    assertNotNull(url);
    final ResourceManager resourceManager = new ResourceManager();
    resourceManager.registerDefaults();
    final Resource directly = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport resource = (MasterReport) directly.getResource();

    DebugReportRunner.executeAll(resource);
    // subreports in the page-header must be handled gracefully.
  }
View Full Code Here

  public MasterReport createReport() throws ReportDefinitionException
  {
    try
    {
      final ResourceManager resourceManager = new ResourceManager();
      final Resource directly = resourceManager.createDirectly(getReportDefinitionSource(), MasterReport.class);
      return (MasterReport) directly.getResource();
    }
    catch (Exception rde)
    {
      throw new ReportDefinitionException("Failed", rde);
    }
View Full Code Here

  public MasterReport createReport() throws ReportDefinitionException
  {
    try
    {
      final ResourceManager resourceManager = new ResourceManager();
      final Resource directly = resourceManager.createDirectly(getReportDefinitionSource(), MasterReport.class);
      return (MasterReport) directly.getResource();
    }
    catch (Exception rde)
    {
      throw new ReportDefinitionException("Failed", rde);
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.resourceloader.Resource

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.