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)
Need help with passing parameters to BIRT
kilo316
Hello,
I have created several BIRT reports that prompt the user for parameters and then pass them to the sql (using ? placed within the sql). I did this all using the BIRT IDE.
BUT, now I need to pass in a parameter in that contains sql, such as myID='1234' and have that placed into the BIRT report sql, and then have the BIRT report run using the sql passed in.
How do you do this? I think I have to use java script, but how can I implement this? Can someone provide an example????
Find more posts tagged with
Comments
Tubal
You can modify (or write) your dataset query in the beforeOpen event of the dataset using this.queryText.<br />
<br />
So for example:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>this.queryText = "SELECT * FROM myTable WHERE myColumn = " + params["myParam"];</pre>
<br />
Or you could just edit a portion of your dataset query:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>this.queryText = this.queryText.replace("/**some placeholder in my query**/","AND myID=" + params["myParam"]);</pre>