Jump to content
Changes to the Jaspersoft community edition download ×

Report query in summary band


Recommended Posts

I'm using iReport to display DB results from application testing. It would be convenient to be able to present the query that was used to generate a report within the report itself, say in the Summary band, so that others could validate the SQL.


Is there any facility in iReport to accomplish this?

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

If you don't pass parameters into your query then you could define your entire query inside a parameter. Your query expression would then simply be $P!{yourQueryParameter}.



You could then set up a Field Text box in the summary section with it's expression being $P{yourQueryParameter}.



But remember you can't pass a parameter into another parameter before the query is filled, so this would only work for static queries.

Link to comment
Share on other sites

If you pass parameters into a query then you can simply replicate the query text in a Text Field. For example, if you have an SQL query like this:



select *

from tbl_site_$P!{SITE_CODE}

where site_status=$P{SITE_STATUS}

and property_group = $P{PROP_GROUP}



then your Text Field expression would be:



"select * from tbl_site_" + $P{SITE_CODE} + " where site_status=" + $P{SITE_STATUS} + " and property_group > " + $P{PROP_GROUP}

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...