How to reload a jasper report repeatedly within every one minute

I use a jasper report as my dashboard on Jasper Server 6.4.2 version.on that report, I have to display current time with live updates without reloading the report manually. I tried to schedule the report and set as output options as Overwrite Files and it's not worked.

Basically,I want to reload a report when it already opened and displayed withing every given time period repeatedly until I close the report. How can I do this?

prabuddha.kulatunga's picture
Joined: Aug 8 2018 - 10:03pm
Last seen: 11 months 1 week ago

5 Answers:

Found a way by myself.

Go to ViewReport.jsp on jasper server installation files.

Then add below code for it.(Actually we use java script to do this.)

 <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 is the current display report url.

dash is the url that we want to refresh. otherwise all the reports will be refresh withn every 5seconds.

5000 is time gap want to refresh.

restart the jasper server.

that's it..

 

prabuddha.kulatunga's picture
Joined: Aug 8 2018 - 10:03pm
Last seen: 11 months 1 week ago

If you are using Java Then use multithreading while file output to load every time period given by you

arun.rout31's picture
Joined: Jul 26 2018 - 6:55am
Last seen: 1 month 3 weeks ago

No. I use JasperSoft Studio and Jasper Server only.

prabuddha.kulatunga's picture
Joined: Aug 8 2018 - 10:03pm
Last seen: 11 months 1 week ago

Try this... 

Once you open the Report with parameter selections, the REST URL will be populated with all the parameters that it needs. 

Use some kind of browser refresh plugins to refresh the browser page

personally I use chrome 

https://chrome.google.com/webstore/detail/auto-refresh-plus/oilipfekkmnc...

reportdev's picture
10566
Joined: Oct 12 2015 - 12:05pm
Last seen: 9 months 2 weeks ago

Have you tried setting "Refresh Settings" - "Auto-refresh dashlet contents"

https://community.jaspersoft.com/documentation/tibco-jasperreports-serve...

hozawa's picture
170749
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 9 months ago
Feedback
randomness