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)
Null Parameter Issue Designing Birt Report
dilber
I am new in BIRT Report Designing, got an issue that I have given a Parameter named Tickedit . If I give the value the Report runs successfully to the particular value. Now here I need that if I give no value or null; it should runs with all values. what would be the syntax or query.
I have given following parameter query.
WHERE (t.ticketid = ?)
Thanks in advance.
Find more posts tagged with
Comments
keiko
Try this, if using Oracle.
WHERE (t.ticketid = NVL(?,t.ticketid))
And this, if using MYSQL.
WHERE (t.ticketid = IFNULL(?,t.ticketid))
thuston
BIRT does not currently support Ad-Hoc parameters. You'll need to modify your SQL to allow this to work.
The easiest is to add another parameter and then OR.
WHERE ( 1 = :pShowAll OR column = :pColValue )
WHERE ( 1 = ? OR column = ? )
This way if pShowAll is true, it doesn't matter what value is in pColValue.
You can even hide the pShowALL and script the report's beforeFactory() to set the value.
if( params["pColValue"].value == null || params["pColValue"].value == "" ){
params["pShowAll"].value = true;
}
dilber
<blockquote class='ipsBlockquote' data-author="'keiko'" data-cid="66069" data-time="1277990203" data-date="01 July 2010 - 06:16 AM"><p>
Try this, if using Oracle.<br />
<br />
WHERE (t.ticketid = NVL(?,t.ticketid))<br />
<br />
And this, if using MYSQL.<br />
<br />
WHERE (t.ticketid = IFNULL(?,t.ticketid))<br /></p></blockquote>
<br />
<br />
Hi,<br />
Thanks for prompt reply.<br />
I used this following syntax in my report query for oracle.<br />
<br />
WHERE (t.ticketid = NVL(?,t.ticketid))<br />
<br />
it works for input parameters when I give parameter it shows the required 0utput. but when I sont give any value it asks that Ticketid is required. I also checked the "Is Required" Field. If I uncheck this Field; it does not ask any ask and show any Input parameter window and Report automatically runs and shows all records.<br />
as file is attached<br />
<br />
My Requirement is: in both conditions it should works either I input any parameter or null.