on 10-14-2016 7:44 PM
Hi,
Could anyone help me on how to dynamically format a column number in crystal 2008
This is the table
Header. Jan Feb Mar
Contracts. 20 30 50
Sale amount. $10 $40 $50
Profit. 3% 4% 8%
All these are in detail section.the header ( contracts,sale ,) are from dB fields.
Hi Lalitha,
One way to do this would be to have a formula convert the numbers to a string then format according to the record type like:
Select {Orders.Customer ID}
Case "sales": "$" & ToText ({Orders.Order Amount})
Case "profit": ToText ({Orders.Order Amount}, 0, "") & "%"
Case "contracts": ToText ({Orders.Order Amount}, 0, "")
Default: ToText ({Orders.Order Amount});
You can right justify the columns when done.
Good luck,
Brian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if my header has value "profit" then the values displayed for each month should be in %format
If "sales" then the value displayed should be in $format.
Hope I explained better.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank You ! for your suggestion.
I came up with one more solution to achieve the same . If we use totext formulae the numbers will be changed to text format.To display Negative values and while exporting to excel we need to retain number format. we can do it as right click on the field (tablename.object}in the format field->select the number format ->customize->in the currency symbol tab (check on ->enable currency symbol ->floating->
select currency symbol->type a formula with in it as below
local stringvar string1:={orders.Header);
if {orders.Header)="sales" then "$"
else if {orders.Header)="Profit" then "%"
else
""
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lalitha,
Could you elaborate on 'dynamically format a column'?
You'd need to highlight a particular column and use the formatting toolbar on the top to either insert a % sign or a currency symbol.
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.