karthik.clarity Posted July 28, 2016 Share Posted July 28, 2016 Hello Champs,We have a requirement where we need to make adhoc filters as Case insensitive and we are on Oracle, so we mofidied applicationContext-semanticLayer.xmlAs per this article - http://community.jaspersoft.com/wiki/how-enable-case-insensitive-search-adhoc-filters-oracle-dbAnd I am able to make it work for Starts with by adding ^ in the regular expression and it worked with no issuesreturn " regexp_like(" + sqlArgs[0] + "," + "'^" + search.replace("'","''") + "', 'i')"But I am trying to change it for Ends with so it should be $ so I tried with below line but ended up with no luck and Ends with stopped working.return " regexp_like(" + sqlArgs[0] + "," + "'" + search.replace("'","''") + "$', 'i')" Link to comment Share on other sites More sharing options...
karthik.clarity Posted July 28, 2016 Author Share Posted July 28, 2016 It is fixed now. For other readers benefit, here is the solution$ in grovvy needs to be escaped by So here is the xml snippet <entry key="EndsWith"> <value> def search = args[1].value; if (search == null) return sqlArgs[0] + " like '%' || " + sqlArgs[1] if (! (search instanceof String)) { search = search.value } return " regexp_like(" + sqlArgs[0] + "," + "'" + search.replace("'","''") + "$', 'i')" </value> </entry> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now