Pentaho report chart is not displayed in Java application

272 Views Asked by At

I am trying to convert a report with chart and a grid into html and render it to a iframe, but it renders without chart. In my controller I am not using HtmlReportUtil.createStreamHTML (learned from other posts).

I tried to use HtmlReportUtil.createDirectoryHTML(), but I still cant get the chart or image. It creates plain HTML with grid, but charts and images are missing. I also tried to write custom HTML printer and tried this piece of code from here.

final StreamRepository targetRepository = new StreamRepository(response.getOutputStream());
final ContentLocation targetRoot = targetRepository.getRoot();

final HtmlOutputProcessor outputProcessor = new StreamHtmlOutputProcessor(report.getConfiguration());
final HtmlPrinter printer = new ReportHtmlPrinter(report.getResourceManager());

printer.setContentWriter(targetRoot, new DefaultNameGenerator(targetRoot, "index", "html"));
printer.setDataWriter(null,null);
printer.setUrlRewriter(rewriter);

outputProcessor.setPrinter(printer);

final StreamReportProcessor sp = new StreamReportProcessor(report, outputProcessor);
sp.processReport();
sp.close();

Please help me to figure out how I can use charts in a Spring MVC web application. Thanks in advance.

0

There are 0 best solutions below