Report Field Format on the Report (negative amount)

gison
Member Posts: 128
Dear all,
I got a requirement from our user.
They like to show the amount while it's negative number as (100) instead of -100
I saw there is a format property on the report field. Is it possible to leverage this property?
anyone got a idea would be thankful.
I got a requirement from our user.
They like to show the amount while it's negative number as (100) instead of -100
I saw there is a format property on the report field. Is it possible to leverage this property?
anyone got a idea would be thankful.
0
Comments
-
Use ABS(Number)0
-
u need only the absolute value without the sign or instead of the sign the () :?:
like
-333 --> 300
or
-333 --> (300)
:?:Do you make it right, it works too!0 -
this one
-333 --> (300)
333 --> 300
so i think i cannot use ABS(number) function0 -
Hi Gison,
Then you will have to create a function in your report like this:PROCEDURE FormatNumber(YourNumber : Integer) : Text[250]; BEGIN IF YourNumber >= 0 THEN EXIT(FORMAT(YourNumber)) ELSE EXIT('(' + FORMAT(ABS(YourNumber)) + ')'); END;
And put in the SourceExpr of you textbox “FormatNumber(YourNumber)”
Regards,Reijer Molenaar
Object Manager0 -
reijermolenaar wrote:Hi Gison,
Then you will have to create a function in your report like this:PROCEDURE FormatNumber(YourNumber : Integer) : Text[250]; BEGIN IF YourNumber >= 0 THEN EXIT(FORMAT(YourNumber)) ELSE EXIT('(' + FORMAT(ABS(YourNumber)) + ')'); END;
And put in the SourceExpr of you textbox “FormatNumber(YourNumber)”
Regards,
The problem here is that, since they are now text, columns of numbers will not line up properly on the decimal point.There are no bugs - only undocumented features.0 -
Did you try Control Panel->Regional & Language Options->Regional Options->Customize->Dill down on Negative Number Format-> Change to (1.1) :-k0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions