简体   繁体   English

在 web 应用程序中集成来自 Jasper 报表服务器的 Jasper 报表

[英]Integrating Jasper Reports from Jasper Report Server in web application

I am trying to display Jasper reports from Jasper Report Server on my JSF web application, but I am not able to find any documentation or resource that describe how to achieve it.我正在尝试在我的 JSF web 应用程序上显示来自 Jasper Report Server 的 Jasper 报告,但我找不到任何描述如何实现它的文档或资源。 I am currently using Jasper reports in my project, but I am planning to move the reports to Jasper Report Server for better performance and maintenance and access the reports from the Jasper report server using any adaptor or library.我目前在我的项目中使用 Jasper 报告,但我计划将报告移动到 Jasper 报告服务器以获得更好的性能和维护,并使用任何适配器或库从 Jasper 报告服务器访问报告。

Solution 1:解决方案1:

I am answering to help anyone searching for similar question.我正在回答以帮助任何搜索类似问题的人。

I am able to integrate JR Server using jrs-rest-client .我能够使用jrs-rest-client集成 JR 服务器。 Here is my sample code这是我的示例代码

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();

Solution 2:解决方案2:

There is another solution.还有另一种解决方案。 I find on this link.我在这个链接上找到。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM