gpt4 book ai didi

java - 使用quartz调度程序调度jasper报告

转载 作者:行者123 更新时间:2023-12-01 10:01:40 27 4
gpt4 key购买 nike

我正在使用 quartz 来创建计划并运行作业。但是,我需要在其中一项工作中生成并发送碧 Jade 报告。我知道 jasper 服务器可用于安排报告,但我已安排在我的 java 应用程序中创建。如何使用 java 应用程序创建报告。

我阅读了链接 - Jasper Report scheduler

简而言之,如何要求 jasper 服务器创建报告并让quartz 作业向给定用户发送电子邮件。

public class MyJob implements Job {

@Override
public void execute(JobExecutionContext context) throws JobExecutionException {

System.out.println("Context : " + context.toString());

//Can we create the jasper report here and then send using email, I have jasper server but I wanted to use the separate job to process the report and send.

}

最佳答案

您可以通过 REST API 访问 JasperServer 并在 Quarz 调度程序中完成其余工作。
1) 启动 Quartz 作业。
2) 在 Jasper 服务器上进行身份验证 ( here is documentation )
3)通过REST API调用报告( documentation )
4) 获取结果并执行您想要的任何操作(例如发送到电子邮件)。
5) 结束 Quartz 工作。

关于java - 使用quartz调度程序调度jasper报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36776062/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com