Type conversion: Code + Decimal

tro#1
Member Posts: 122
Embarassing... I can`t figure out the solution myself. I also searched the forum and found similar postings but none of them could help me either.
I get following error message:
"Type conversion is not possible because 1 of the operators contains an invalid type.
Code + Decimal"
What I try to do:
Report: Sales Invoice
New Variable: CurrCode
I fill this variable with the corresponding currency code symbol.
I want to show the amount as
CurrCode + Amount
SourceExpr: CurrCode+"Sales Invoice Line"."Amount Including VAT"
and then I get the error message which I understand.
I tried different DataTypes for CurrCode
I also tried FORMAT and EVALUATE but I can`t make it work...
I get following error message:
"Type conversion is not possible because 1 of the operators contains an invalid type.
Code + Decimal"
What I try to do:
Report: Sales Invoice
New Variable: CurrCode
I fill this variable with the corresponding currency code symbol.
I want to show the amount as
CurrCode + Amount
SourceExpr: CurrCode+"Sales Invoice Line"."Amount Including VAT"
and then I get the error message which I understand.
I tried different DataTypes for CurrCode
I also tried FORMAT and EVALUATE but I can`t make it work...
0
Answers
-
SourceExpr: CurrCode + ' ' + FORMAT("Sales Invoice Line"."Amount Including VAT")
0 -
Thank you Malajlo,
the problem with your solution is, that it does not print two decimal places any more. It just prints the actual decimal places - and if there aren`t any then none get printed:
e. g.
€ 63
or
€ 63,1
or
€ 63,11
But it should always print two decimal places.0 -
Complicated... Once I did it cleaner, but forgot where
format(round("Sales Invoice Line"."Amount Including VAT",1))+','+format(("Sales Invoice Line"."Amount Including VAT"-round("Sales Invoice Line"."Amount Including VAT",1,'<'))*100)
0 -
Malajlo wrote:Complicated... Once I did it cleaner, but forgot where
format(round("Sales Invoice Line"."Amount Including VAT",1))+','+format(("Sales Invoice Line"."Amount Including VAT"-round("Sales Invoice Line"."Amount Including VAT",1,'<'))*100)
format(value,0,'<precision,2:2><standard format,0>') ;
0 -
Thank you MBerger.
This is a very elegant solution and it works fine!0 -
You can also use AutoFormatExpr property (set to i.e. "Sales Header"."Currency Code")0
-
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