cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Translate the entire conversation x

Call Jasper Report from Workflow process

ssharma
3-Newcomer

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 3

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;
  }

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 

HelesicPetr
22-Sapphire II
(To:ssharma)

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

Announcements
Top Tags