Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to Use User Properties
How to Use User Properties [message #1022810] Fri, 22 March 2013 15:10 Go to next message
Thomas P. is currently offline Thomas P.Friend
Messages: 25
Registered: April 2012
Junior Member
Hello,

can someone explaine me how (or for what) to use User Properties? I can set a user property for every element in the design. But I only can defined it, not set a value for it. Can I do this only per Java/Javascript? I want to define a property (with value) in the Report.

Example:
For an image I want to say: grayscale = true; Than I read the Property during the birt process and create my Image in grayscale mode. Parsing the Reportdesign is no Problem. I can read everything with the birt api, but I found no "Definition-Place" for this Information.

But I think, the user Properties are for this usage, or?

Thanks,

Thomas


Thomas
Re: How to Use User Properties [message #1027388 is a reply to message #1022810] Tue, 26 March 2013 23:15 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

When you give an element a user property, you're simply assigning a new property for the element. Once you've give a new property, you can set that property via "setProperty(propertyName,propertyValue)". For example, if you created a user property for an element called "isgray", then set the value of that parameter in your beforeFactory or wherever, like:

reportContext.getDesignHandle().findElement("myTable").setProperty("isgray",params["isgray"]);

The property "isgray" for the table is now set to whatever the parameter value is. In your onCreate, you can check the value of this property, like:

if(this.getUserPropertyValue("isgray") == "yes"){
this.getStyle().backgroundColor = "gray";
}

If the parameter is "yes", it'll be gray, if it's "no", it'll be the default color.


Michael

Developer Evangelist, Silanis
Re: How to Use User Properties [message #1027626 is a reply to message #1027388] Wed, 27 March 2013 07:37 Go to previous messageGo to next message
Thomas P. is currently offline Thomas P.Friend
Messages: 25
Registered: April 2012
Junior Member
Hello,

thank you very much. That is a way I can go. But why couldn't I set a "Default" with the Report Designer. Could may be a feature Request.

Regards

Thomas


Thomas
Re: How to Use User Properties [message #1029537 is a reply to message #1027626] Fri, 29 March 2013 20:55 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Yeah. I'm not certain why a default is not available. You could definitely request an enhancement for a default value setting. If you log the request, put the info in here for others to vote on the feature. Thanks.

Michael

Developer Evangelist, Silanis
Previous Topic:List display records new new row in xls vesrion.
Next Topic:NullPointerException on chart with mouseover tooltip
Goto Forum:
  


Current Time: Thu Apr 25 21:25:17 GMT 2024

Powered by FUDForum. Page generated in 0.42502 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top