Jump to content
Changes to the Jaspersoft community edition download ×

Get user id from User object


maverick911

Recommended Posts

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 you

www.maverick-zone.fr



Post Edited by maverick911 at 04/07/2010 08:30
Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

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

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

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