Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Altering Properties of Crosstab Grouping DataItem
Migrateduser
<p>I have a crosstab with three user selectable top groupings and three user selectable left groupings. I am using code to attempt to modify the formatting of the groupings based on the fields the user selects (in a set of parameters).<br><br>
I have the code like this:<br>
</p>
<pre class="_prettyXprint">
var groupingElement = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("topGrouping1");
updateProperties("dataFormat", groupingElement.getProperty("numberFormat"), "###0{RoundingMode=HALF_DOWN}", "pattern")</pre>
<p>groupingElement finds the element in question and <strong>updateProperties</strong> using a function I wrote to modify the property. This function works perfectly well elsewhere in my report on a dynamically created label that get added to a table:<br>
</p>
<pre class="_prettyXprint">
var agg = elementFactory.newDataItem( null );
.
.
.
if(data_type == "Number") numFormat = updateProperties("dataFormat", agg.getProperty("numberFormat"), fieldInfo[8], "pattern");
.
.
.</pre>
<p>When I use it on an existing dataitem (topGrouping1) in the crosstab the object <strong>groupingElement.getProperty("numberFormat")</strong> is null even though you can see it has the numberFormat property through Eclipse BIRT GUI and I can see it in the cached properties of the dataElement sub-object when I view groupingElement variable in the debugger.<br><br>
Is this because it exists already and is there anyway to get or alter the property via a different route?</p>
<p> </p>
<p>Edit:<br>
Additional Info:<br><br>
1) updateProperties function<br>
The updateProperties function takes the following arguments:<br><br><strong>class:</strong> The name of the array of properties allowed<br><strong>properties object:</strong> A properties object<br><strong>value:</strong> This is either a value for the default property or a semi-colon delimited list of property name/value pairs.<br><strong>default property:</strong> The property to use if no property name is specified. (see value above)<br><br>
This function would to the properties object either set the default property with a single value or if the value is a delimited list work through each one and set all the properties given.<br><br>
2) I may be able to workround this problem by using the getStyle().<em>property_name</em> method but I would need to write an function that takes the property name and sets the appropriate property. This would be an ineligant way to do this.<br>
</p>
Find more posts tagged with
Comments
There are no comments yet