Jump to content
JasperReports Library 7.0 is now available ×

Select statement with Parameters $P


Recommended Posts


I am trying to re-use a value held in my report - which has been calculated in a sub-report. Its a percentage total that I want to use to draw the pie chart. Is something like this possible:


select 'Top 10', $P{Usage_Percentage}

from dual


select 'Rest', 100-$P{Usage_Percentage}

from dual


(I dont want to re-execute queries for the pie chart)


Ireports does not seem to like having Parameters in the select statement. Can anyone please advise, would be very appreciated.


Thank You,


Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

:) Hey ... that worked - shows a sql error when you define but compiles fine. THANK YOU!


But now I dont seem to be able to pass a variable as a parameter to the chart. Any ideas please?


I have read lots of stuff on the forum about a variable not being the same as a parameter, but I cant find anything about either assigning the variable to the parameter or passing a variable in some way.


If you have any idea ... please let me know.



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