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)
Cascading Params (select all option)
E.G.M.G.
<p>Hello,</p>
<p>I'm using two different groups (let's call them A and B using two different datasets A and B also each of them with three levels of cascade -A1, A2, A3 and B1, B2,B3) of cascading parameters as input for a report.</p>
<p> </p>
<p>So, the result (selection) from A3 among with selection in B (B1+B2+B3) becomes the input for the final query to Dataset B which returns the info to present in the report, I'm trying to include the --select all option -- in the params boxes in A3.</p>
<p>As long as I actualy select something in A3 evrything goes OK. The selected values are joined to the query in an (AND AA.Whatever in( A3.value.join(",")) fashion. The problem comes when selecting "--select all--" I'm not able to retrieve the final A3 drill (which is a very restrictive where clause) and the final query goes over all the data.</p>
<p> </p>
<p>I've seen the onFetch approach but I'had not success with it. I thought I might get the contents (options) in A3 param box and I've been able to do it ( using )</p>
<p> </p>
<p>"</p>
<p><script></p>
<p>var options2 = document.getElementById("CIUDAD_selection");</p>
<div> </div>
<div>var b = [];</div>
<div>for( var l = 0; l < options2.length; l++ )</div>
<div>{</div>
<div> </div>
<div>b[l] = options2[l].text;</div>
<div>var tempText = options2[l].text;</div>
<div>var tempValue = options2[l].value;</div>
<div> </div>
<div>}</div>
<div></script></div>
<div>"</div>
<div> </div>
<div>from a text element using the approach of the collect_parameters function in DialogBirtParameterDialog.js</div>
<div> </div>
<div>However, the problem I'm having is getting this info fetch from A3 param dialog, manipulating it in (report.initialize) and sending it to DataSet.B.beforeOpen. I believe is something related with client/server JS issues but I'm not seeing it. Any help will be appreciated and if not this approach anything that help me get the A3 whole params list to send it to B before Open.</div>
<div> </div>
<div>Thx</div>
Find more posts tagged with
Comments
E.G.M.G.
<p>Btw, community birt</p>
<p>version 4.4.2</p>
E.G.M.G.
<p>Solved, I was a little bit lost and although I've been able to retrieve params from client side I was missing the whole point.</p>
<p>Finally I've managed to set it up in before factory. I have also mokve my initilize code here so I believe I have solved variable scope issues I was having.</p>
<p> </p>
<p>The key's been using getSelectionListForCascadingGroup. which I finally come to thanks to a resource which I found in the forum (</p>
<p> </p>
<div>prjList = [];</div>
<div> </div>
<div>var jp = params["JJ"];</div>
<div>var rele = params["Rele"];</div>
<div> </div>
<div>var keys = [jp, rele];</div>
<div>var selectionList = tsk.getSelectionListForCascadingGroup("Projects", keys);</div>
<div>if ( selectionList != null )</div>
<div>{</div>
<div> </div>
<div>//Aqui los ponemos</div>
<div>for ( var sliter = selectionList.iterator( ), j = 0; sliter.hasNext( ); j++ ){</div>
<div>var selectionItem = sliter.next( );</div>
<div>prjList[j] = selectionItem.getLabel();</div>
<div>var lbl = selectionItem.getLabel();</div>
<div>var value = selectionItem.getValue( );</div>
<div>}</div>
<div>}</div>