Community Tip - Need help navigating or using the PTC Community? Contact the community team. 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.

2 REPLIES 2

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 

Announcements


Top Tags