ngutierrez Posted July 21, 2008 Share Posted July 21, 2008 I have a report made in ireport 3.0.0 wich receives a string parameter from another application; this is the query report:SELECT accounts.`name` AS accounts_name, accounts.`account_type` AS accounts_account_type, accounts.`industry` AS accounts_industry, accounts.`billing_address_street` AS accounts_billing_address_street, accounts.`billing_address_city` AS accounts_billing_address_city, accounts.`billing_address_country` AS accounts_billing_address_countryFROM `accounts` accountsWHERE accounts.name >= $P{CUENTA_DESDE} and accounts.name <= $P{CUENTA_HASTA}In CUENTA_DESDE I have some strings like: Agencia "La buena suerte" or Kiosco "El grande", and the parameter in ireport truncates as Agencia or Kiosco. Any idea to solucionate this? How to put quotes? Sorry for my english Link to comment Share on other sites More sharing options...
lshannon Posted July 21, 2008 Share Posted July 21, 2008 Maybe you could try converting the " to ' ?In mySQL you could use the REPLACE function to do this:http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replaceAlso you could try to do it in Java.Create a second parameter in the report who's default value is:$P{originalParameter}.replaceAll(""", "'")Then use this second parameter in your query.Hope this helps. Link to comment Share on other sites More sharing options...
ngutierrez Posted July 22, 2008 Author Share Posted July 22, 2008 I tried doing that and when I put the second parameter in the WHERE clause like: accounts.name >= $P{CUENTA_DESDE2} and accounts.name <= $P{CUENTA_HASTA2} I get the following error: Error: sourced file: inline evaluation of: ` ` param_CUENTA_DESDE.replaceAll(""","'");"Any idea of what this error is? 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