Jump to content
We've recently updated our Privacy Statement, available here ×

getting 3 double quotes in the report


mithileshbhende

Recommended Posts

I am getting a problem while creating a jasper report using a query. My requirement is that I want double quotes the result that the query gives me. For eg. if my query gives me the result as : dance
then I want to show the result as "dance" on my report.
For this, I modified my query to

select '"' || dance_column || '"' from table_name

but when I run the report the result that I am able to see is """dance"""

Is this a known problem?

I also tried this
select '"' || dance_column || '"' from table_name

But this doesn't work.
Please help me out!

Thanks in advance!

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Have you looked at the results when you run the query directly from the database.  You don't specify which dB you are using so that could be the source of your problem.

If you are using Oracle you could also try enclosing your double quotes in single quotes:

SELECT '"' || 'myname' || '"'

or using CHR(34) instead

SELECT CHR(34)  || 'myname' || CHR(34) as bob from dual

 

 

Link to comment
Share on other sites

Thanks for responding!

Yes. I have tried both the options as you suggested from the database.

I am using the Oracle database.

It works correctly in the database but not working in the iReport.

 

I think for a double quote, it is putting its own escape character which is one more double quote and at the same time it is enclosing the entire value in the double quotes. Hence the three quotes appear on both sides of the value.

 

For example: The value "bob" returned by the database becomes """bob"""

 

I think no changes in the query will work for this problem.

Is there any setting in the iReport parameter where this can be tackled?

Link to comment
Share on other sites

I cannot replicate the problem, but I have seen it before.  Unfortunately i can't remember how I solved it.  Looks like something in your Java-land is expecting the quote marks to be escaped.

Can you post the snippet of XML that contains your report query and the field definitions please?  It would also be handy to see the xml for the textbox that displays the multiple quotes, so post that too.



Post Edited by jmurray at 10/26/2010 20:49
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...