How to Use User Properties [message #1022810] |
Fri, 22 March 2013 11:10  |
Eclipse User |
|
|
|
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
|
|
|
Re: How to Use User Properties [message #1027388 is a reply to message #1022810] |
Tue, 26 March 2013 19:15   |
Eclipse User |
|
|
|
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.
|
|
|
|
Re: How to Use User Properties [message #1029537 is a reply to message #1027626] |
Fri, 29 March 2013 16:55  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.02839 seconds