Which is the goal of UUID attribute for Jasper elements?

Hi friends!

Every report we mount with Jasper Studio includes UUID numbers for every element. It will be very useful, if I can retrieve these elements using the generated UUID, but... is it possible? I would like to retrieve an element in a JRElement (for instance), inside a scriptlet, to manipulate it... But I could not find any method or example in that way, like: "JRElement jre = reportResource.findByUUID(<UUID>);" or something...

If it's impossible to do such a thing, why this UUID attribute exists?

 

silvio.araujo's picture
Joined: Feb 25 2019 - 12:51pm
Last seen: 4 years 6 months ago

3 Answers:

UUID is used mostly for the interactive elements like tables and crosstabs to identify the elements for sorting/filtering/etc. It's used in the viewer and on the engine level, I am not sure there is useful API available to interact with elements using UUID.

Friendly User's picture
Joined: Oct 8 2009 - 5:59am
Last seen: 1 week 15 hours ago

Haven't tried this but seems like creating a Map with values from JRIdentifiable.getUUID() and then searching the Map?

hozawa's picture
190849
Joined: Apr 24 2010 - 4:31pm
Last seen: 4 years 3 months ago

@hozawa, that was near what I need, but not exactly... I verify that it's possible to use this getUUID() from uncompiled "jrxml" files, but not "on-the-fly". What I want is to pick an element within a scriptlet, using its UUID (or its key), to change its attributes based on data beeing processed. But I guess it is not possible...

 

silvio.araujo's picture
Joined: Feb 25 2019 - 12:51pm
Last seen: 4 years 6 months ago
Feedback
randomness