Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Assign value to external report parameter in java scritp
pjActuate
Hi All,
Please resolve,
In BIRT 2.2 Is it possible to assign a value to exernal report parameter in Report script(janascript)? If yes then how(give sample code/syntax)? and If no then how would you change the report parameter value at runtime without using interactivity?
In another way, suppose report has a global declared variable in its script (javascript) which change the value at runtime and this runtime value need to pass to another report but the report interactivity exptression builder have only report parameters to send!!! now the question is how would report pass runtime value which required to use as a filter in called(drilled report) report.
We know report has other alternatives in interactivity for its value but be specific to above exmple!!!!
Thanks.
Find more posts tagged with
Comments
mwilliams
pjActuate,
If I understand your question correctly, you can create a hidden, non-required parameter and set the value of it in script with the 'reportContext.setParameterValue()' function. If I'm not understanding correctly, please let me know. Thanks.
pjActuate
Hi Williams,
The function 'reportContext.setParameterValue()' that you mention is work only in EVENT script. But the problem where I came across does not belong to this context rather it is in reprt layout's Text block.
This particular text block has <script>;</script> tab and in that tab the report parameter should get updated.
Thanks
Prashant
mwilliams
Prashant,
I'm not sure I'm understanding correctly. If you can create an example of this issue in a report using the sample database, that may help. If not, could you please explain further. Thanks.
TheRealDea
Prashant and/or MWilliams
Do either of you know whether a resolution has been discovered?
bhanley
I do not believe this is supported. I have done some testing and the Client-side Javascript executed as a part gfo the rendering of the HTML of a report is in fact not aware of the concept of a parameter. The ability to access parameters in the scripting layer is scoped to the event-based scripts which actually execute on the server side of the transaction.
TheRealDea
One other thought then is to change the parameters in the URL.
I have seen the following scenario "sort-of" work:
1. Text control(html)
<FORM name="form_name">
Institution:
<INPUT TYPE=TEXT name="txtControl" id="txtControlID">
</FORM>
2. Text control(html)
<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";
targetURL += "&RP_INST_CD=" + document.form_name.txtControl.value;
//alert( targetURL );
location.replace(targetURL);
return false;
}
</script>
<table width=100%>
<tr>
<td colspan=2><input type="button" value="Submit" onEnter = "reloadPage()" onclick="reloadPage()"></td>
</tr>
</table>
</form>