Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Developing Analytics Applications
JSAPI - How to Initialize Cascading Report Param?
Migrateduser
<p>Hi,</p>
<p> </p>
<p>I'm wondering if you can help me with some JSAPI code. (I am using a custom application which embeds a BVT report in an html page.)<br><br>
I have a dataset ('Regions') which is linked to a hidden report parameter ('reportOwner').<br>
The Regions dataset is used by a cascading report parameter ('userRegions').<br><br>
I want to (1) set the hidden report parameter ('reportOwner') to a value using JSAPI code in the browser page (this I can do) and (2) refresh the cascading report parameter ('userRegions') so that the Regions dataset it uses gets updated corresponding to the new value of the reportOwner report parameter. All of this should occur before displaying the parameters on the browser page.<br><br>
I can get (1) to work using the code below, but not (2) - the cascading report parameter ('userRegions') still displays the original list of values.<br><br>
</p>
<pre class="_prettyXprint">
<script>
var param;
var viewer;
var reportPath;
var url='${reportViewerUrl}';
reportPath = "/crm_charts/crm_rep_calls_chart.rptdesign";
function initReport() {
if (!actuate.isConnected(url, null)){
actuate.load('viewer');
actuate.load('parameter');
actuate.initialize( url, null,null,null,displayParams );
} else {
displayParams();
}
}
function displayParams(){
$('#param-container').css('border-width', 1);
param = new actuate.Parameter( 'param-container' );
param.setReportName(reportPath);
param.submit( function () {this.descriptionbox.style.visibility = 'visible'; this.reportTitleBox.style.visibility = 'visible';});
param.downloadParameters(setUser);
}
function setUser( paramdefs ) {
// Iterate through params and update the reportOwner param
for(var i=0; i<paramdefs.length; i++){
if(paramdefs[i].getName() == 'reportOwner') {
paramdefs[i].setDefaultValue(1);
}
}
param.renderContent(paramdefs);
}
...
</script>
</pre>
<p>Any help much appreciated.</p>
<p> </p>
<p>Cheers,</p>
<p> </p>
<p>Richard</p>
Find more posts tagged with
Comments
There are no comments yet