Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Birt Report's Buttons with Mozilla
viju
Hi All,
I am using Birt 3.7.2,
I am facing one issue in my Birt report. I have created a birt report having button on it. on clicking of button I am calling one java script function. this script is written inside text palette.
This button is working with birt viewer and IE, but while I execute it with birt viewer and Mozilla 18.0 this button is not working, on clicking of that button it is not calling that function. following code I am using.
<script>
function nextData( a ){
var cl = new String(location.href);
var targetURL = new String();
var tst = cl.indexOf("&like");
if( tst == -1 ){
cl = cl + "&like=" + a;
}else{
var ch = cl.indexOf("&like=");
cl = cl.substring(0, ch) + "&like=" + a;
}
window.location = cl;
}
function goData( a ){
var cl = new String(location.href);
a=(document.getElementById('pagenum').value)+a;
var targetURL = new String();
var tst = cl.indexOf("&like");
if( tst == -1 ){
cl = cl + "&like=" + a;
}else{
var ch = cl.indexOf("&like=");
cl = cl.substring(0, ch) + "&like=" + a;
}
window.location = cl;
}
</script>
<input type="button" value="Previous" style="background-color:#A2A8B2;height:20px;width: 65px;font-weight:bold"
onclick="nextData('<VALUE-OF>prev;</VALUE-OF><VALUE-OF>sOutput;</VALUE-OF>')" >
<input type="button" value="Next" style="background-color:#A2A8B2;height:20px;width: 40px;font-weight:bold"
onclick="nextData('<VALUE-OF>next;</VALUE-OF><VALUE-OF>sOutput;</VALUE-OF>')">
<input type="button" value="All" style="background-color:#A2A8B2;height:20px;width: 30px;font-weight:bold"
onclick="nextData('<VALUE-OF>-1;</VALUE-OF><VALUE-OF>sOutput;</VALUE-OF>')" >
Go To page: <input type="text" name="" size="2" id='pagenum' style="height:15px">
<input type="button" value="Go" style="background-color:#18B117;height:20px;width:30px;font-weight:bold" onclick="goData('<VALUE-OF>goVal;</VALUE-OF><VALUE-OF>sOutput;</VALUE-OF>')">
Please help me out...
Thanks
Find more posts tagged with
Comments
Clement Wong
I tried a similar Javascript like your code in a sample design, and the buttons were working in both IE and Firefox 18.0. Did you try testing Chrome? And if you don't see expected results in Chrome, you can use the very useful built-in Developer Tools (F12).
Otherwise, for Firefox, you'll need to download Firebug or a debugging tool equivalent to help track why the script is not working in Firefox. Or you could start by looking at Firefox's Error Console to see if there were any Javascript errors.
You might want run the report with a smaller set of data, view as HTML, and then debug the HTML within Firefox (or Chrome).
If you're still having trouble, it would be helpful if you could post a sample design file with similar code that we could use to help troubleshoot this issue. Also, please let us know what context you are deploying and give a sample value for location.href.
viju
Hi,<br />
Thanks for reply<br />
<br />
As you suggested I had use fire bug for mozilla browser and found an error onclick of button, error is <strong class='bbc'>ReferenceError: nextData is not defined</strong><br />
<br />
I am not able to attach rptdesign, it is giving following error.Please have a look and let me know solution for this.<br />
<br />
<strong class='bbc'><span style='font-size: 18px;'>ReferenceError: nextData is not defined<br />
onclick(event=click clientX=994, clientY=70)frames...onclick (line 2)<br />
[Break On This Error] <br />
<br />
nextData('2&like=1')</span></strong><br />
<br />
Thank you very much.
Clement Wong
Without a sample design, proper context, or the generated HTML, it will be difficult to diagnose this issue.
Please provide the additional items so we can assist in troubleshooting your issue.