Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Retrieving style properties at runtime
Forty2
Hi,<br />
<br />
I was wondering if it is possible to retrieve certain style properties of a report element at runtime which are not defined by the item itself but are passed on to the element by its parents.<br />
The only way I found was using a while-loop to walk up the element-tree to find the style instance that defines the required property:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
IScriptStyle style = null;
IReportElementInstance parent = <currentElement>;
while (parent != null && parent.getStyle().getFontFamily() == null) {
parent = parent.getParent();
}
String fontFamily = parent.getStyle().getFontFamily();
</pre>
<br />
It does do the trick but is somewhat tedious to implement and I was wondering if there exists an easier way to do this.<br />
<br />
Lukas
Find more posts tagged with
Comments
There are no comments yet