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)
optional parameters in report
kpfamous
Hello friends,
Can some one help me how to create a report using optional parameters.
ie in the existing eval version of BIRT open source examples take any example.
thanks & regards
krishna prasad
Find more posts tagged with
Comments
mwilliams
Hi krishna,
All you would need to do is create your parameters without the "is required" option selected. Then, if you're using a SQL dataSet, you'd put in a simple SQL statement like "select blah from blah", no where statement. This will be used if the user enters no value. If they do enter a value, you'll just have to add the where statement to the query in the dataSet's beforeOpen script like:
if (params["parameterName"] != null){
this.queryText = this.queryText + " where blah = " + params["parameterName"];
}
Hope this helps. Let me know if you need an example along with this description.
kpfamous
Dear Michael,
Thanks for your prompt reply,As mentioned by you not im not using is_required option.
I will try and get back to you,Might be handy if you could please send me link for the example.
thanks & regards
Krishna
mwilliams
Krishna,
What version of BIRT are you using?
kpfamous
Dear Michael,
Im using the latest opensource download .Not actuate commercial version.
thanks
Krishna
mwilliams
Krishna,
Check out this example. It was made in BIRT 2.5.2. You'll see the code to add the where clause for the parameter in the beforeOpen of the dataSet.
kpfamous
Dear Michael,
Thanks for your assistance.Sorry for late reply.Im searching to get the version ?which you mentioned .I could not find on Birt downloads.I can see BIRT 2.5.1 .
Thanks
Krishna Prasad
mwilliams
Krishna,
I thought you had said you were using the latest version. If you're using 2.5.1, you can probably just change the version info in the xml source of the design I posted in here to the version info of a report created with your 2.5.1 version.