使用 quartz 调度器调度 jasper 报告

Schedule jasper report using quartz scheduler

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

我通读了 link - 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 作业。