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)
Changing the table properties in beforeFactory()
divyani
<p>Hi,</p>
<p> </p>
<p>We are dynamically adding columns to a table in the beforeFactory() method by following the post in below link.</p>
<p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/24254-creating-column-dynamically/ '>http://developer.actuate.com/community/forum/index.php?/topic/24254-creating-column-dynamically/ </a></p>
;
<p> </p>
<p>The issue being faced is we are unable to set the properties for eg., the font size, color of the font, background color of cells in the script. </p>
<p> </p>
<p>I am sure this would be possible. Please help.</p>
<p> </p>
<p>Thanks in advance!</p>
Find more posts tagged with
Comments
Matthew L.
<p>The properties for elements can be changed using the API quite easily using a simple trick.</p>
<p>For example, if we want to set the properties of a Label element, we can simply use the GUI Palette to drag in a Label element, make the changes we are wanting to have in the output, then look at the reports XML Source to see the properties the element has (See attached LabelProperties.png).</p>
<p> </p>
<p>Using this as a reference, we can change the properties using the API by adding the .setProperty(java.lang.String propName,java.lang.Object value) to the labelHandle.</p>
<p> </p>
<p>Ex: labelHandle.setProperty(<span style="color:#0000ff;">"color"</span>, <span style="color:#0000ff;">"#666666"</span>);</p>
<p>Or: cellHandle.setProperty(<span style="color:#0000ff;">"backgroundColor"</span>, <span style="color:#0000ff;">"#EDEEF3"</span>);</p>
<p> </p>
<p>Other examples:</p>
<pre class="_prettyXprint _lang-js">
//LabelHandle properties
labelHandle.setProperty("fontFamily", "Verdana");
labelHandle.setProperty("fontSize", "12");
labelHandle.setProperty("fontWeight", "Bold");
labelHandle.setProperty("color", "#666666"); //Font color
labelHandle.setProperty("backgroundColor", "#EDEEF3");
//Set cell borders as a function
function cellBorders(cellHandle){
var color = "#808080";
var style = "solid";
var width = "1pt";
cellHandle.setProperty("borderTopColor", color);
cellHandle.setProperty("borderBottomColor", color);
cellHandle.setProperty("borderLeftColor", color);
cellHandle.setProperty("borderRightColor", color);
cellHandle.setProperty("borderTopStyle", style);
cellHandle.setProperty("borderBottomStyle", style);
cellHandle.setProperty("borderLeftStyle", style);
cellHandle.setProperty("borderRightStyle", style);
cellHandle.setProperty("borderTopWidth", width);
cellHandle.setProperty("borderBottomWidth", width);
cellHandle.setProperty("borderLeftWidth", width);
cellHandle.setProperty("borderRightWidth", width);
}
</pre>
divyani
<p>Thank you so much Matthew. It is working! .</p>