【问题标题】:Integrating Jasper Reports from Jasper Report Server in web application在 Web 应用程序中集成来自 Jasper Report Server 的 Jasper Reports
【发布时间】:2021-05-04 16:11:15
【问题描述】:

我正在尝试在我的 JSF Web 应用程序上显示来自 Jasper Report Server 的 Jasper 报告,但我找不到任何描述如何实现它的文档或资源。我目前在我的项目中使用 Jasper 报告,但我计划将报告移动到 Jasper 报告服务器以获得更好的性能和维护,并使用任何适配器或库从 Jasper 报告服务器访问报告。

【问题讨论】:

    标签: java jsf jasperserver


    【解决方案1】:

    解决方案 1:

    我正在回答以帮助任何搜索类似问题的人。

    我可以使用jrs-rest-client 集成 JR 服务器。 这是我的示例代码

    RestClientConfiguration configuration = new RestClientConfiguration("http://localhost:8080/jasperserver");
    JasperserverRestClient client = new JasperserverRestClient(configuration);
    Session session = client.authenticate("user", "password");
    
    OperationResult<InputStream> result = session
        .reportingService()
        .report("/E_Reports/myReport")
        .prepareForRun(ReportOutputFormat.PDF, 1)
        .parameter("param", "702558")
        .run();
    
    InputStream report = result.getEntity();
    

    解决方案 2:

    还有另一种解决方案。我在这个链接上找到。

    https://community.jaspersoft.com/questions/815042/run-report-using-restv2-and-java

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-06-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-07
      • 1970-01-01
      • 2015-04-13
      相关资源
      最近更新 更多