Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How can I dynamic add format?(help me)
How can I dynamic add format? [message #1403662] Fri, 25 July 2014 02:17 Go to next message
jack wang is currently offline jack wangFriend
Messages: 1
Registered: July 2014
Junior Member
My english is very poor,sorry!
Hi,every body
I want to add some codes in my progrom,to format number . My code is
"
CellHandle dcell = (CellHandle) mydetail.getCells().get(i+1);//取得明细行单元格

dcell.setProperty("fontFamily","宋体");
dcell.setProperty("fontSize","10.5pt");
dcell.setProperty("borderBottomStyle","none");
dcell.setProperty("borderLeftStyle","none");
dcell.setProperty("textAlign",column[5]);

DataItemHandle myDataItem2 = elementFactory.newDataItem(column[1].toUpperCase());
myDataItem2.setResultSetColumn(column[1].toUpperCase());//column数据集里列的名字

// here ,how to format the column
// 这里如何增加格式化 该列的代码
dcell.getContent().add(myDataItem2);
"

in XML ,like this

<cell id="27">
<data id="44">
<structure name="numberFormat">
<property name="category">Fixed</property>
<property name="pattern">###0.00{RoundingMode=HALF_UP}</property>
</structure>
<property name="textAlign">center</property>
<property name="resultSetColumn">AMOUNT</property>
</data>
</cell>
Re: How can I dynamic add format? [message #1407189 is a reply to message #1403662] Tue, 12 August 2014 04:02 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

So, you want to do the numberFormat stuff on a data element?

If so, try something like:

myDataItem2.getStyle().setNumberFormatCategory(DesignChoiceConstants.NUMBER_FORMAT_TYPE_FIXED);
myDataItem2.getStyle().setNumberFormat("###0.00{RoundingMode=HALF_UP}");


Michael

Developer Evangelist, Silanis
Previous Topic:Cross Tab diagonal color coding
Next Topic:Remove Cassandra from New Data Source Wizard
Goto Forum:
  


Current Time: Mon Jul 23 03:47:40 GMT 2018

Powered by FUDForum. Page generated in 0.01754 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top