2

I am making a report containing a table using Jasper Report. I want that table to refresh its content on a specified interval, say every 5 minutes. How to do this?

I am thinking about making a thread to reload the .jasper file. What do you think? Any body has the same experience?

4

2 回答 2

1

在 iReporter 中,我遇到了这个问题。我可以通过在每次编辑后进行预览来刷新它。

于 2012-08-15T01:38:13.290 回答
1

转到jasper 服务器安装文件上的ViewReport.jsp 。

然后为它添加下面的代码。(实际上我们使用java脚本来做到这一点。)

<script type="text/javascript">
 var url = window.location.href; //take current tab url
 var dash = 'http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&_flo...';

 if(url == dash ){
    setTimeout(function(){
        window.location.reload(1);
    }, 5000);
 }
</script>

url是当前显示报告的 url。

dash是我们要刷新的 url。否则所有报告将在每 5 秒内刷新一次。

5000是要刷新的时间间隔(以毫秒为单位)。

重新启动碧玉服务器。

您可以添加包含要刷新urldash数据的表的报告链接,并根据需要设置刷新时间(以毫秒为单位)。

于 2018-08-10T04:51:53.283 回答