Align numbers in Confirm dialog

Calico
Member Posts: 31
I am trying to produce a message of three lines each with two numbers in them and to make it tidier and more readable I would like to align the numbers in two columns like so
Line 1 some text ....123456.78....543210.43
Line 2 longer text........... 3.00..6453981.22
Line 3 text.................123.45.........78.99
but what I get looks like this no matter what I try
Line 1 some text 123456.78 543210.43
Line 2 longer text 3.00 6453981.22
Line 3 text 123.45 78.99
Which looks a mess specially as the numbers can range from 0 to over 1,000,000 - and in fact when I test this post in preview I have just the same problem unless I replace the spaces with dots.
Has anyone got any ideas? I've tried %1, #1######, formatting the numbers as strings but they still won't align properly
Line 1 some text ....123456.78....543210.43
Line 2 longer text........... 3.00..6453981.22
Line 3 text.................123.45.........78.99
but what I get looks like this no matter what I try
Line 1 some text 123456.78 543210.43
Line 2 longer text 3.00 6453981.22
Line 3 text 123.45 78.99
Which looks a mess specially as the numbers can range from 0 to over 1,000,000 - and in fact when I test this post in preview I have just the same problem unless I replace the spaces with dots.
Has anyone got any ideas? I've tried %1, #1######, formatting the numbers as strings but they still won't align properly
0
Comments
-
could you please post your source here to understood what you mean.Do you make it right, it works too!0
-
I don't think it will help much to post the code - since it doesn't work (and also I have tried several different options) but here goes -
IF DIALOG.CONFIRM(Text001+Text002+Text003+Text004+Text005,FALSE,"Housing Allowance",gHseAmt,"Trans. Allowance",
gTrnAmt,"Other Allowances",gOthAmt,"No.") THEN UpdateAllowance;
The text constants are as follows:
Name ConstValue
Text001 %7 Current Calculated\
Text002 Housing : %1 %2\
Text003 Transport: %3 %4\
Text004 Other : %5 %6\\
Text005 Do you want to update record?
and the values are all decimals and despite the way it posts, the substitution markers are all lined up in columns in the text constants.
I should point0 -
well the numbers don't "need" to remain numbers in an info box.
:-k
My thought would use FORMAT to convert to text.
Use STRLEN to get the length of the string.
subtract that from the largest possible # of characters you expect to have.
then you have a number of "dots" that you need.
not sure if it works with dialog boxes - but you can try.......
have a look at this post:
viewtopic.php?f=23&t=362190 -
You can do this in other way - by save all this paraameters in temporary table (text,number1,number2) and run form with question instead of confirm. Maybe even without the table just by pass parameters to form.
Its easier to develop good looking form i think0 -
JedrzejT wrote:You can do this in other way - by save all this paraameters in temporary table (text,number1,number2) and run form with question instead of confirm. Maybe even without the table just by pass parameters to form.
Its easier to develop good looking form i think
:thumbsup:
This is also how I would do it. Its really hard to get messages looking exactly as you need them, and Forms are cheaper than the customer paying you to write code and experiment.David Singleton0 -
Thanks for the help. I think the form option is probably the only solution. Because NAV does not distinguish between fixed length text fields and variable length strings, there is no way that the figures can be aligned in a dialog box - or at least not without an inordinate amount of coding.
Have a good weekend.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