Skip to main content
3-Newcomer
Feb 13, 2025 12:26 PM UTC
Question

Call Jasper Report from Workflow process

Does anyone have experience calling and generating a Jasper Report from a Workflow expression. The challenge here is that the workflow runs on Master node, which only has BGMS and no foreground MS, in the cluster configuration. Reports can be generated successfully in a monolithic setup where Jasper, BGMS and MS are on same machine.

3 replies

17-Peridot
Feb 14, 2025 7:58 AM UTC

which methods are you using to create the Jasper report? Perhaps there are some different possibilities. I'm doing that successfully, but I do have a foreground method server. Is your report running only with WRS or IE? Or do you use also some own classes to fill the report?

My call looks like this in the WF:

public Path generate() {
 Path reportFile = null;
 try {
 Report report = retrieveReport(reportName);
 Map<String, Object> parameters = combineParameters(persistable, report, locale);
 Path tempFolder = retrieveTempFolder();
 reportFile =
 Path.of(tempFolder.toString(), fileBaseName + jasperExportFormat.getFileExtension());
 try (FileOutputStream fileOutputStream = new FileOutputStream(reportFile.toString())) {
 OutputStreamProxy outputStreamProxy = new OutputStreamProxy(fileOutputStream);
 JasperReportExecutor executer = new JasperReportExecutor();
 executer.executeReport(report,
 parameters,
 jasperExportFormat.getInternValue(),
 outputStreamProxy);
 }
 } catch (WTException e) {
 log.error("ERROR-375524: ", e);
 } catch (IOException e) {
 log.error("ERROR-1002193: ", e);
 }
 return reportFile;
 }
Translate
Community Moderator
Mar 11, 2025 7:55 PM UTC

Hi @ssharma,

 

I wanted to see if you got the help you needed.

If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Of course, if you have more to share on your issue, please pursue the conversation. 

 

Thanks,
Anurag 

Translate
HelesicPetr
22-Sapphire II
Apr 1, 2025 7:33 AM UTC

Hi @ssharma 

It would be nice to see some errors. 

I can say, that there is no difference if the code is run from foreground MS or Background MS

The code is run same way. Bacground just cares about code from workflows and queues. 

It does same work . 

You can have an issue with some vault synchronization or different issue that is connected to the not synchronized cluster temp or memory.

PetrH

Translate