[英]Integrating Jasper Reports from Jasper Report Server in web application
我正在嘗試在我的 JSF web 應用程序上顯示來自 Jasper Report Server 的 Jasper 報告,但我找不到任何描述如何實現它的文檔或資源。 我目前在我的項目中使用 Jasper 報告,但我計划將報告移動到 Jasper 報告服務器以獲得更好的性能和維護,並使用任何適配器或庫從 Jasper 報告服務器訪問報告。
解決方案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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.