Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 164923

Summary: Format mask
Product: z_Archived Reporter: Hari Nair <haridasan.t>
Component: BIRTAssignee: Jun Ouyang <jouyang>
Status: VERIFIED FIXED QA Contact: Tianli Zhang <tzhang>
Severity: enhancement    
Priority: P3 CC: bluesoldier, wenfeng.fwd, wyan, xxue
Version: 2.1.1Keywords: plan
Target Milestone: 2.5.0 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard: Autoed,J-text

Description Hari Nair CLA 2006-11-16 22:55:07 EST
this.style can be used only for single column, - this is not working for html text with an expression such as

<value-of format="###,###,###.00"> row["AMOUNT"] </VALUE-OF>

NOW THE NUMERIC FORMAT WILL BE AVAILABLE AS A PARAMETER SUCH AS
params["NumericFormat"]

when i write the script in oncreate

<value-of format=params["NumericFormat"]> row["AMOUNT"] </VALUE-OF>

this does not seems to work.  The formating is ignored.  Is there any workaround?
regards
Comment 1 Wei Yan CLA 2006-11-20 00:26:29 EST
what's the data type of row["amount"]? Is it a number?
Comment 2 Hari Nair CLA 2006-11-21 22:50:49 EST
what's the data type of row["amount"]? Is it a number?
Yes , number
Comment 3 Wei Wang CLA 2006-11-30 21:46:31 EST
Could you attach the report designs which working and not?

Thanks.
Comment 4 Hari Nair CLA 2006-11-30 22:30:45 EST
The issue is for expressions, i am not able to change numeric format as detailed below
<value-of format=params["NumericFormat"]> row["AMOUNT"] </VALUE-OF>

other it is fine
Comment 5 Wei Yan CLA 2006-12-17 22:12:32 EST
could we support this feature as:

<value-of format-expr="params["NumericFormat"]"> row["AMOUNT"] </VALUE-OF>

the format-expr defines a expression and the result is used as the format pattern. The "format" property will overide the format-expr.
Comment 6 Hari Nair CLA 2006-12-18 22:18:02 EST
This will add lot of value , since in most cases we need to provide expressions (Total.sum) etc .  Currently the only alternative is to use data instad of Total.sum
and get the formating done. RThis is bit lenghtly. esplly. when there are more sub totals (grouping)

If we can provide 
<value-of format-expr="params["NumericFormat"]"> row["AMOUNT"] </VALUE-OF>
like this , it will add value
since the formating can be controlled using a parameter 

Thks

Comment 7 Hari Nair CLA 2007-01-28 22:47:02 EST
<value-of format-expr="params["NumericFormat"]"> row["AMOUNT"] </VALUE-OF>

the format-expr defines a expression and the result is used as the format
pattern. The "format" property will overide the format-expr.


This may be better way to format numeric and also ddate expressions
Comment 8 Jun Ouyang CLA 2009-01-15 22:53:43 EST
Add attribute ¡°format-expr¡± to support specifying format by script.
Comment 9 Jun Ouyang CLA 2009-01-15 22:54:04 EST
Fixed.
Comment 10 Tianli Zhang CLA 2009-01-16 03:35:01 EST
I have submitted a enhancement to support this new attribute in Dynamic Text of Text Item in designer. Please refer to enhancement #261310.
Comment 11 Tianli Zhang CLA 2009-01-18 22:20:25 EST
I have tried following cases, for example:

by parameter expression:
<VALUE-OF format-expr='params["format"]'>1234</VALUE-OF>

by constant
<VALUE-OF format-expr='"Fixed"'>1234</VALUE-OF>

by script
StringFormat= "@@@-@@@"
<VALUE-OF format-expr=StringFormat>Hello</VALUE-OF>

by column binding script
<VALUE-OF format-expr='row["Format"]'>1234</VALUE-OF>

They worked in 2.5.0 v20090119-0630 build. I will track the UI enhancement for this new attribute and some related bugs of using invalid expression. 

Mark this bug as verified first.