Jump to content

single select-query input parameter for jasper report


mandm

Recommended Posts

 i have a tricky question, which  i will be glad if addressed by the forum, my worry is that i have a input parameter which i need to have the values changed dynamically, e.g unit_name which can change based on each table so i have a mapping table which i use via the $P{LoggedInUser}.getUsername() parameter in the report, to run a report for a specific user....

But can i use this $P{LoggedInUser}.getUsername() in the single select query option on the server?

my query is 

 

select distinct key from table1 where lst_id in (

select lst_id from table2 where Name = 'units' and file_id in (select fileid from usermap where userid = $P{LoggedInUser}.getUsername())

)

union 

select '%' as key_value

order by key_value asc

 
in this query  i need to derive the distinct keys based on each logged in users table...
 
Can this be done in jasper?

 

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

 yes i used this file to install the jasper server 

jasperreports-server-cp-4.0.0-linux-installer.bin

So i am guessing i have the Community edition, but i have user $P, $P! etc...successfully in my reports, its just that i do not know how to use it on the query based input parameters

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