Bug 164923 - Format mask
Summary: Format mask
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.1.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 2.5.0 M5   Edit
Assignee: Jun Ouyang CLA
QA Contact: Tianli Zhang CLA
URL:
Whiteboard: Autoed,J-text
Keywords: plan
Depends on:
Blocks:
 
Reported: 2006-11-16 22:55 EST by Hari Nair CLA
Modified: 2010-05-31 05:35 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.