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)
Passing entire query as Parameter to BIRT Report from JSP through url
Nagalakshmi Venkatesan
<p>Hi,</p>
<p>I have a report .I want to pass my entire query(assigned to variable) to BIRT dataset before open from JSP through URL. Is there any option to do that. Please suggest.</p>
<p>ex:</p>
<p>In jsp:</p>
<p>Var query = "select *....";</p>
<p>windows.open=url+"&queryParam="+query;</p>
<p> </p>
<p>In BIRT:</p>
<p>I have created report parameter(queryParam). I am doing the following on beforeopen condition of dataset.</p>
<p><b>var </b>condition = params["queryParam"];</p>
<p><b>this</b>.queryText = <b>this</b>.queryText + condition;</p>
<p> </p>
<p>I am able to pass parameters from Jsp to report through url. But I am not able to pass query like this. </p>
Find more posts tagged with
Comments
micajblock
<p>From a security perspective this is a VERY bad idea as this can open up to SQL injection hacks. What is the use case here?</p>
Nagalakshmi Venkatesan
In my query i have more than ten conditions. So instead of passing values for those parameters from jsp to report through url,i tried to pass entire query using variable.Can you please tell me,is there any other way to values for the conditions mentioned in th report dataset through url. and if there is no value, i want to apply % for the condition
micajblock
<p>Passing whole where clauses is also not recommended. What is wrong with 10 parameters? In any case for optional parameters just add the specific portion of the where clause. </p>
<pre class="_prettyXprint">
this.queryText = this.queryText + "columname=" + params["myParam"];</pre>
<p>You might need to insert in the middle somewhere depending on your SQL.</p>