maverick911 Posted April 7, 2010 Share Posted April 7, 2010 Hello,I would like to retreive the user id (juser table's pk from jasperserver data base) from a User object in a report.I saw on this page : http://jasperforge.org/plugins/mwiki/index.php/Jasperserver/Cascading_input_controls that I can easily retreive the name, email and much more parameters from the user, but not the id.Is there a way to do this without performing an sql request ?Thank youwww.maverick-zone.frPost Edited by maverick911 at 04/07/2010 08:30 Link to comment Share on other sites More sharing options...
maverick911 Posted April 8, 2010 Author Share Posted April 8, 2010 I am currently solving this problem by performing an SQL request with the email adress given by the User type.Please tell me if there is a better way to retreive the user idwww.maverick-zone.fr Link to comment Share on other sites More sharing options...
mdahlman Posted April 15, 2010 Share Posted April 15, 2010 No, there's no method to get the user ID.I think in general getting the ID would be considered a no-no. It's just a physical necessity for database performance. But it doesn't have any meaning, so it's not something you ought to be looking at. But if you really need it, then your idea of using getEmailAddress() or using getUsername() and then a SQL query using that would be the way to go.Why are you trying to retrieve it?Regards,Matt Link to comment Share on other sites More sharing options...
maverick911 Posted April 16, 2010 Author Share Posted April 16, 2010 To meet the needs of our business, we have an external database containing information linked to the users. The fk is the jasper user id.Thank you for having repliedwww.maverick-zone.fr Link to comment Share on other sites More sharing options...
mdahlman Posted April 16, 2010 Share Posted April 16, 2010 I'm glad it's working.You may find that it's easier to maintain if you create your external table with the FK linking to the JasperServer username instead of the ID. Username is unique, so it should do what you need. And it's available via getUsername(), so you wouldn't need additional SQL.Regards,Matt Link to comment Share on other sites More sharing options...
maverick911 Posted April 16, 2010 Author Share Posted April 16, 2010 That's an ideaThanks a lot :) www.maverick-zone.fr 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