|
Re: How to auto-refresh a report? [message #519065 is a reply to message #518770] |
Fri, 05 March 2010 18:26 |
|
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 #531198 is a reply to message #518770] |
Tue, 04 May 2010 07:38 |
Lawrence Gaalswyk 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 |
|
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 #531420 is a reply to message #531395] |
Tue, 04 May 2010 19:55 |
|
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 #531687 is a reply to message #531425] |
Wed, 05 May 2010 18:26 |
|
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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04581 seconds