Home
Analytics
Scripting: Access to Report Parameter
indie
<strong class='bbc'>Is there a possibility to access a Report Parameter from within a script?</strong><br />
<br />
<strong class='bbc'>For example:</strong><br />
I run a report from Java Code, and pass several Parameters.<br />
One of these Parameters should be the marker line value.<br />
Then I want to set a marker line according to the passed value.<br />
How can i accomplish that? Please help!
Find more posts tagged with
Comments
cypherdj
In your script, use the following to retrieve the value of your parameter:
markerLine = params["markerLine"].value
indie
thx for the reply ... unfortunatly your solution isn't working in my environment ...<br />
<br />
nevertheless i finally figured it out ...<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeGeneration(chart, icsc)
{
[B]var reportContext = icsc.getExternalContext().getScriptable();
ml = reportContext.getParameterValue("MarkerLine")[/B]
chart = icsc.getChartInstance();
marker = chart.getAxes().get(0).getAssociatedAxes().get(0).getMarkerLines().get(0).getValue().setValue(ml);
}
</pre>