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)
Dynamic sql based on the condition
new member
Hi,
I have a scenario that I have to create a where cluase based on the data I get from my jsp.
Example:
I have an empId and I need to add that empId condition if i get the id other wise I should not add that condition.
Could somebody help.
Thanks in advance
Find more posts tagged with
Comments
JasonW
Why not use a beforeOpen event on the dataset like:
var myuser = reportContext.getHttpServletRequest().getSession().getAttribute("myuser");
if( myuser != null ){
this.queryText = this.queryText + " where userid=" + myuser;
}
Jason
new member
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="74730" data-time="1300289393" data-date="16 March 2011 - 08:29 AM"><p>
Why not use a beforeOpen event on the dataset like:<br />
<br />
var myuser = reportContext.getHttpServletRequest().getSession().getAttribute("myuser");<br />
if( myuser != null ){<br />
<br />
this.queryText = this.queryText + " where userid=" + myuser;<br />
<br />
}<br />
<br />
Jason<br /></p></blockquote>
new member
Thank you so much for the quick reply Jason,
I am completly new to java and BIRT. Can you give me step by step procedure. that would be a great help for me.
Thanks a lot.
JasonW
What this video. It is a bit old but should get you pointed in the right direction.
http://www.eclipse.org/birt/phoenix/examples/reports/birt2.1/querymod/index.php
Jason
new member
Thanks a lot for the support. It's working now.<br />
<br />
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="74735" data-time="1300291392" data-date="16 March 2011 - 09:03 AM"><p>
What this video. It is a bit old but should get you pointed in the right direction.<br />
<a class='bbc_url' href='
http://www.eclipse.org/birt/phoenix/examples/reports/birt2.1/querymod/index.php'>http://www.eclipse.org/birt/phoenix/examples/reports/birt2.1/querymod/index.php</a><br
/>
<br />
Jason<br /></p></blockquote>