Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There are no chart images #1652

Open
khauser opened this issue May 16, 2024 · 1 comment
Open

There are no chart images #1652

khauser opened this issue May 16, 2024 · 1 comment

Comments

@khauser
Copy link

khauser commented May 16, 2024

Hi there,

we try to use the pentaho reporting SDK within a spring boot application.

build.gradle:

plugins {
    id 'java'
    id 'org.springframework.boot' version '3.2.5'
    id 'io.spring.dependency-management' version '1.1.4'
}
...
java {
    sourceCompatibility = '21'
}

repositories {
    mavenCentral()
    maven { url 'https://repo.orl.eng.hitachivantara.com/artifactory/pnt-mvn/'  }
}

ext {
    pentahoReportingVersion = '9.4.0.0-343'
    postgresqlVersion = '42.7.1'
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-boot-starter-freemarker'
    implementation 'org.springframework.boot:spring-boot-starter-jdbc'

    runtimeOnly group: 'org.postgresql', name: 'postgresql', version: "${postgresqlVersion}"

    implementation group: 'org.pentaho.reporting.engine', name: 'classic-core', version: "${pentahoReportingVersion}"
    implementation group: 'org.pentaho.reporting.engine', name: 'classic-extensions', version: "${pentahoReportingVersion}"
    implementation group: 'org.pentaho.reporting.engine', name: 'legacy-charts', version: "${pentahoReportingVersion}"

    implementation group: 'org.jfree', name: 'jfreechart', version: '1.0.19'
...

ReportingService.java:

        ClassicEngineBoot.getInstance().start();

        final ResourceManager resourceManager = new ResourceManager();
        resourceManager.registerDefaults();

        final var baos = new ByteArrayOutputStream();

        try
        {
            Resource res = resourceManager.createDirectly(
                            resourceLoader.getResource(REPORTING_FILE_PATH).getURI().toURL(), MasterReport.class);
            final MasterReport masterReport = (MasterReport)res.getResource();
            queryParams = Map.ofEntries(....);

            addParametersToReport(masterReport, queryParams);

            HtmlReportUtil.createStreamHTML(masterReport, baos);

With this our report is generated but there are no chart images shown. What could be the problem here?
In the report designer the charts show up.

Thanks for help!
Karsten

@khauser
Copy link
Author

khauser commented May 17, 2024

If I use HtmlReportUtil.createDirectoryHTML the images are there. Now I should be able to create a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant