Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to auto-refresh a report?(.. HTML)
How to auto-refresh a report? [message #518770] Thu, 04 March 2010 23:06 Go to next message
Lawrence Gaalswyk is currently offline Lawrence GaalswykFriend
Messages: 16
Registered: November 2009
Junior Member
I have a table-based report and I wish the HTML version's page to automatically refresh every X seconds. How can I do this?

i tried putting the following in a text element at the top of my report but it doesn't work, I think I have to put it someplace else or use Javascript somewhere:

<meta http-equiv="refresh" content="60" >

I am using BIRT 2.2.1.

Thanks!
Re: How to auto-refresh a report? [message #519065 is a reply to message #518770] Fri, 05 March 2010 18:26 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Lawrence,

I do not remember if this works in 2.2.1 but it works in the latest
versions of BIRT. Add a text element set the type to html and enter a
value similar to the following.


<form name="input" onSubmit="return reloadPage();">

<script type="text/javascript">


function reloadPage() {
//alert("Reload time");
var temp = new String(location.href);
var targetURL = new String();

if(temp.indexOf("__overwrite=") != -1 ){
targetURL = temp.substring(0, temp.indexOf("&__overwrite") -1);
}else{
targetURL = temp;
}

targetURL += "&__overwrite=true";



//alert( targetURL );
location.replace(targetURL);

return false;
}

timer=setTimeout('reloadPage()', 5000);
</script>



</form>


Jason

Lawrence Gaalswyk wrote:
> I have a table-based report and I wish the HTML version's page to
> automatically refresh every X seconds. How can I do this?
>
> i tried putting the following in a text element at the top of my report
> but it doesn't work, I think I have to put it someplace else or use
> Javascript somewhere:
>
> <meta http-equiv="refresh" content="60" >
>
> I am using BIRT 2.2.1.
>
> Thanks!
Re: How to auto-refresh a report? [message #521175 is a reply to message #519065] Tue, 16 March 2010 16:17 Go to previous messageGo to next message
Lawrence Gaalswyk is currently offline Lawrence GaalswykFriend
Messages: 16
Registered: November 2009
Junior Member
Jason, this works great in 2.2.1 -- once again THANK YOU !
Re: How to auto-refresh a report? [message #531198 is a reply to message #518770] Tue, 04 May 2010 07:38 Go to previous messageGo to next message
Lawrence Gaalswyk is currently offline Lawrence GaalswykFriend
Messages: 16
Registered: November 2009
Junior Member
In case it's useful to anyone, I am posing the actual, shortened version I used which works ok in 2.2.1. Basically,I removed the "overwrite" section from Jason's example above -- and it seems to work fine. Is there any specific reason for the overwrite section?

<form name="input" onSubmit="return reloadPage();">

<script type="text/javascript">

function reloadPage() {
var targetURL = new String(location.href);
location.replace(targetURL);
return false;
}

timer=setTimeout('reloadPage()', 60000);
</script>

</form>

[Updated on: Tue, 04 May 2010 07:39]

Report message to a moderator

Re: How to auto-refresh a report? [message #531323 is a reply to message #531198] Tue, 04 May 2010 14:33 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

The overwrite section causes the report to re-execute producing an
updated rptdocument. Without it changes in source data may not be
picked up.

Jason



On 5/4/2010 3:38 AM, Lawrence Gaalswyk wrote:
> In case it's useful to anyone, I am posing the actual, shortened version
> I used which works ok in 2.2.2. Basically,I removed the "overwrite"
> section from Jason's example above -- and it seems to work fine. Is
> there any specific reason for the overwrite section?
>
> <form name="input" onSubmit="return reloadPage();">
>
> <script type="text/javascript">
>
> function reloadPage() {
> var targetURL = new String(location.href);
> location.replace(targetURL);
> return false;
> }
>
> timer=setTimeout('reloadPage()', 60000);
> </script>
>
> </form>
Re: How to auto-refresh a report? [message #531395 is a reply to message #518770] Tue, 04 May 2010 17:42 Go to previous messageGo to next message
Lawrence Gaalswyk is currently offline Lawrence GaalswykFriend
Messages: 16
Registered: November 2009
Junior Member
Jason,
Ok, I get it, sorry for butchering your code. I put it back as you originally stated, and remembered why I took out the overwrite section: for a report that has a required parameter, it re-prompts me for that parameter(s). So now I can't figure out how to refresh the report with the same parameter(s) as it was originally run with, while keeping the "overwrite" parameter section.
Re: How to auto-refresh a report? [message #531420 is a reply to message #531395] Tue, 04 May 2010 19:55 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Are you putting the parameter values in the url?

On 5/4/2010 1:42 PM, Lawrence Gaalswyk wrote:
> Jason,
> Ok, I get it, sorry for butchering your code. I put it back as you
> originally stated, and remembered why I took out the overwrite section:
> for a report that has a required parameter, it re-prompts me for that
> parameter(s). So now I can't figure out how to refresh the report with
> the same parameter(s) as it was originally run with, while keeping the
> "overwrite" parameter section.
Re: How to auto-refresh a report? [message #531425 is a reply to message #518770] Tue, 04 May 2010 20:42 Go to previous messageGo to next message
Lawrence Gaalswyk is currently offline Lawrence GaalswykFriend
Messages: 16
Registered: November 2009
Junior Member
Yes I am putting parameters in the URL. Also, I need this to work both for some reports which do have parameters in the URL, and also for some other reports which have no parameters. Maybe that means 2 different scripts I think.

Thank you again for any further advice.
Re: How to auto-refresh a report? [message #531687 is a reply to message #531425] Wed, 05 May 2010 18:26 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Can you post the script/report you are using? If the parameters are in
the URL the parameter box should not be prompting.

Jason

On 5/4/2010 4:42 PM, Lawrence Gaalswyk wrote:
> Yes I am putting parameters in the URL. Also, I need this to work both
> for some reports which do have parameters in the URL, and also for some
> other reports which have no parameters. Maybe that means 2 different
> scripts I think.
>
> Thank you again for any further advice.
Re: How to auto-refresh a report? [message #1773147 is a reply to message #519065] Fri, 22 September 2017 08:17 Go to previous message
Tejaswi D is currently offline Tejaswi DFriend
Messages: 1
Registered: September 2017
Junior Member
Hi Jason

I used the code provided by in my report with refresh interval as 30sec,

Every 30 sec page is getting refreshed but the data updated at back end is not reflecting.

I have used complete javascript code with overwrite option.

Also once i execute the report from BIRT tool it will open the report with dateTime at the left end of window and this dateTime value also not getting updated with page refresh.

I am using Birt

Actuate BIRT Designer Professional
Version: 4.4.0
Build id: v20150710

Thank you
Tejas
Previous Topic:Parameter wildcard value
Next Topic:Birt 4.6 intergration with Wildfly 10.1.0
Goto Forum:
  


Current Time: Thu Mar 28 13:36:17 GMT 2024

Powered by FUDForum. Page generated in 0.04581 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top