Skip to main content



      Home
Home » Archived » BIRT » How can I dynamic add format?(help me)
How can I dynamic add format? [message #1403662] Thu, 24 July 2014 22:17 Go to next message
Eclipse UserFriend
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 00:02 Go to previous message
Eclipse UserFriend
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}");
Previous Topic:Cross Tab diagonal color coding
Next Topic:Remove Cassandra from New Data Source Wizard
Goto Forum:
  


Current Time: Wed Jul 23 16:42:25 EDT 2025

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

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

Back to the top