Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Create Multiple Filters in an SQL Query - Connecting via JDBC( Create Multiple Filters in an SQL Query - Connecting via JDBC)
Create Multiple Filters in an SQL Query - Connecting via JDBC [message #1843853] Fri, 20 August 2021 14:49 Go to next message
Igor Davanço is currently offline Igor DavançoFriend
Messages: 7
Registered: August 2021
Junior Member
Good morning people!
How are you?
I'm developing a report in BIRT that uses the JDBC connection, I would like to create a SQL query receiving parameters, but I would like to test these parameters (by IF-ELSE for example) and depending on the parameters that are informed selects the WHERE clause I need. In BIRT is it possible to do this? How would it be? I'm in doubt.
Re: Create Multiple Filters in an SQL Query - Connecting via JDBC [message #1843860 is a reply to message #1843853] Fri, 20 August 2021 20:27 Go to previous messageGo to next message
Jerry Sheets is currently offline Jerry SheetsFriend
Messages: 76
Registered: July 2009
Location: Salt Lake City, UT
Member
I do that by extending the SQL Query Where Clause in the Data Set beforeOpen method similar to the following:

// Append Where Clause for Status
if (params["rprmReport"].value == "Ready"){
this.queryText = this.queryText + " AND ae_cp_consult_inv.status_code = 'READY FOR INTERFACE'"
}
if (params["rprmReport"].value == "Sent"){
this.queryText = this.queryText + " AND ae_cp_consult_inv.status_code = 'SENT TO FINET'"
}
if (params["rprmReport"].value == "Error"){
this.queryText = this.queryText + " AND ae_cp_consult_inv.status_code = 'VALIDATION ERROR'"
}
Re: Create Multiple Filters in an SQL Query - Connecting via JDBC [message #1843894 is a reply to message #1843860] Mon, 23 August 2021 14:08 Go to previous message
Igor Davanço is currently offline Igor DavançoFriend
Messages: 7
Registered: August 2021
Junior Member
Thank you my friend! I managed to perfectly accomplish what I needed, you helped me a lot!
Previous Topic:NULL issue
Next Topic:birt runningsum on group
Goto Forum:
  


Current Time: Fri Apr 26 17:19:03 GMT 2024

Powered by FUDForum. Page generated in 0.04358 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top