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
Designing Analytics Reports
beforeOpen for dataset not working
Migrateduser
<p>Hi All ,</p>
<p> </p>
<p>I am quite new to BIRT. I am trying use cascading Parameter group in which one of the List Box(say B depends on multiple selected values of previously List Box(say A). I have written beforeOpen script for data set of ListBox B which is as follows ,</p>
<div> </div>
<div>importPackage(Packages.java.io); </div>
<div>logFileName ="birt_before.log"; </div>
<div>out = new PrintWriter(new FileWriter(logFileName, true));</div>
<div>out.println("Parameter 2:"+params["ProjectType"].value.join("','"));</div>
<div>this.queryText = this.queryText.replace('<strong>ddd</strong>' , <strong>params["ProjectType"].value.join("','")</strong>);</div>
<div>out.println("queryText=" + this.queryText); </div>
<div>out.close();</div>
<div> </div>
<div>I can see values getting replaced in birt_before.log but still List Box B is fetching Null.Have verified query(in logs) by manually firing it on DB (it works). I am confused here am I missing something here?</div>
<div>Query before :</div>
<div>
<div> select upper(b.value) as FilterValue from a , b </div>
<div> where a.OBJID = b.parent_id and b.code='test' and upper('By Market') = ? and upper(a.TYPE) in ( '<strong>ddd</strong>' )</div>
<div> group by b.value</div>
</div>
<div> </div>
<div>Query after replacement in Logs :</div>
<div>
<div> select upper(b.value) as FilterValue from a , b </div>
<div> where a.OBJID = b.parent_id and b.code='test' and upper('By Market') = ? and upper(a.TYPE) in ( '<strong>test1','test2</strong>' )</div>
<div> </div>
<div>Have Verified the data set with only one condition that is upper('By Market') = ? (it works)</div>
<div> </div>
<div>How come the values are getting replaced in queryText and query is not working?</div>
<div>Also interesting this is to note is if I use <strong>params["ProjectType"].value instead of </strong><strong>params["ProjectType"].value.join("','") </strong>query works but only with single value getting replaced that is 'test1'. Please help me out here....</div>
<div> </div>
</div>
<div>using BIRT version : 3.2.23</div>
<div>Eclipse BIRT Designer Version 4.3.0.v201306041519</div>
<div> </div>
Find more posts tagged with
Comments
There are no comments yet