Kamikaz0r Posted May 11, 2021 Share Posted May 11, 2021 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 : 1name :company2 value : 2how 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 More sharing options...
yama818 Posted May 12, 2021 Share Posted May 12, 2021 It may be good to write as followsLoggedInUserAttribute_<attribute name>ex)LoggedInUserAttribute_company1LoggedInUserAttribute_company2 Reference URLhttps://community.jaspersoft.com/questions/538920/profile-attributes-within-main-query Link to comment Share on other sites More sharing options...
yama818 Posted May 12, 2021 Share Posted May 12, 2021 . Link to comment Share on other sites More sharing options...
Kamikaz0r Posted May 21, 2021 Author Share Posted May 21, 2021 Hello , i tried put on my Database query SELECT * FROM viewTestWHERE $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 viewTestWHERE COMPANY LIKE LoggedInUserAttribute_company1" Link to comment Share on other sites More sharing options...
yama818 Posted May 22, 2021 Share Posted May 22, 2021 As shown in the linked post.'$X' can only be used for multiple return parameters.So you need to use '$P'.ex1)SELECT * FROM viewTestWHERE COMPANY = $P{LoggedInUserAttribute_company}ex2)SELECT * FROM viewTestWHERE COMPANY = $P{LoggedInUserAttribute_company1} OR COMPANY = $P{LoggedInUserAttribute_company2} Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now