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

JasperSoft Server - get atrributes user


Kamikaz0r

Recommended Posts

0

 

i have the installed Jasper Server , where i have create the follow attributes for the user joeuser , the attributes that i create its called/value .

name :company1 value : 1

name :company2 value : 2

how could i retrieve this on my parameters ? when i use

$P{LoggedInUserAttributeValues}.iterator().next() , i get only the values: 1 , but how could i get the value of company2 ?

i tried do something like '$P{LoggedInUserAttributeValues}.iterator().next().next()' , but dont return nothing.

what i wanna it's receive the values and use inside my query Builder IN Clause.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

Hello , i tried put on my Database query 

 

SELECT * FROM viewTest
WHERE $X{IN,COMPANY,LoggedInUserAttribute_company}

 

but return me a error on JasperServer

 

"

Error message There was an error on the server. Try again or contact the site administrators. (Error UID: d8b35d11-ee82-4c61-aae6-f1746b5e95ca)" 

the same error occured when i try this database query

"SELECT * FROM viewTest
WHERE COMPANY LIKE LoggedInUserAttribute_company1"

 

Link to comment
Share on other sites

As shown in the linked post.
'$X' can only be used for multiple return parameters.
So you need to use '$P'.

ex1)
SELECT * FROM viewTest
WHERE COMPANY = $P{LoggedInUserAttribute_company}

ex2)
SELECT * FROM viewTest
WHERE COMPANY = $P{LoggedInUserAttribute_company1}
   OR COMPANY = $P{LoggedInUserAttribute_company2}

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