formatting attributes dynamically
I need help.
I want change all atributes in beforeFactory or initialize
I have
#FF0000
Custom
(#0.00)
right
col01
I can change color,textAlign,resultSetColumn
elemento="Data04"
myLabelHandle = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement(elemento);
myLabelHandle.setStringProperty("resultSetColumn", "col02");
myLabelHandle.setStringProperty("color", "Red");
myLabelHandle.setStringProperty("textAlign", "left");
How can I change numberFormat/pattern ?
Antônio Carlos
Best Answer
-
In the onCreate event of a label:
this.text = Formatter.format(parseFloat(this.text), "$##,####.##");When formatting an element that has the Format Number property, set the format dynamically using:
this.getStyle().numberFormat = "$##,####.##"Warning No formatter is installed for the format ipb0
Answers
-
In the onCreate event of a label:
this.text = Formatter.format(parseFloat(this.text), "$##,####.##");When formatting an element that has the Format Number property, set the format dynamically using:
this.getStyle().numberFormat = "$##,####.##"Warning No formatter is installed for the format ipb0 -
I need help.
I want change all atributes in beforeFactory or initialize
I have<data name="Data04" id="1269"> <property name="color">#FF0000</property> <structure name="numberFormat"> <property name="category">Custom</property> <property name="pattern">(#0.00)</property> </structure> <property name="textAlign">right</property> <property name="resultSetColumn">col01</property> </data>
I can change color,textAlign,resultSetColumn
elemento="Data04"
myLabelHandle = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement(elemento);
myLabelHandle.setStringProperty("resultSetColumn", "col02");
myLabelHandle.setStringProperty("color", "Red");
myLabelHandle.setStringProperty("textAlign", "left");
How can I change numberFormat/pattern ?
Antônio Carlos0 -
jfranken ,
thanks.my request was to put parentheses and red color when the number is negative, what I did was
I create a new style ("style_parentheses") with the format="(#,###.##)"
and in beforeFactory I didmyLabelHandle = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Data04");
hr = StructureFactory.createHighlightRule();hr.setTestExpression("row['col01']";);
hr.setValue1(0);
hr.setProperty("operator","lt");
hr.setProperty("color","Red");
hr.setProperty("style","style_parentheses");ph = myHandle.getPropertyHandle("highlightRules");
ph.addItem(hr);Antonio Carlos
0
Categories
- All Categories
- 108 Developer Announcements
- 53 Articles
- 106 General Questions
- 145 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 899 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 120 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management