Using a Progress Indicator in a Dialog window
deepblue
Member Posts: 152
hello,
I have an application where some processing take a long time, and I need to have a Progress Indicator ina Dialog window.
What can I do?
Thanks!
I have an application where some processing take a long time, and I need to have a Progress Indicator ina Dialog window.
What can I do?
Thanks!
0
Answers
-
Use a Dialog box with an indicator field.
For details, see in the online help, fct Dialog.OPEN and Dialog.UPDATEDialog.OPEN(String [, Variable1], ...)
Dialog
Data type: dialog
Once you define this variable, you can open the dialog and then use other dialog functions.
String
Data type: text constant or code
This string contains the text you want the system to display in the window. Use a back slash (\) to start a new line. Use pound signs (#) to insert variable values into the string, Place the pound signs where you want the system to substitute the variable value.
If you use @ characters instead of #, the string can be used as an indicator. In this case, use @ characters only for the string, and let the variable be an integer. The limits of the indicator are 0 and 9999 - meaning that the integer you use for updating the indicator should have a value within this range.
Hope that help ...0 -
Some example:
globals:
Name DataType Subtype Length
diaProgress Dialog
intProgress Integer
intProgressI Integer
intProgressTotal Integer
timProgress TimerecSalesLine.RESET; // + filters diaProgress.OPEN('@1@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\',intProgress); intProgressTotal := recSalesLine.COUNT; // be carefull : this can be slow if filters don't use the key // SQL : use COUNTAPPROX, but this doesn't give an exact number timProgress := TIME; IF recSalesLine.FIND('-') THEN REPEAT // Progress bar intProgressI := intProgressI + 1; IF timProgress < TIME - 3000 THEN BEGIN // every 3 seconds timProgress := TIME; intProgress := ROUND(intProgressI / intProgressTotal * 10000,1); diaProgress.UPDATE; END; // other things you have to do UNTIL recSalesLine.NEXT; diaProgress.CLOSE;Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
hi kriki,
Thank you, it seems to work !!! but i have an error message during the process:
overflow in the conversion of the type Decimal to Integer
value:498,09
what could i do?
thank you!!0 -
You have to define the "intProgress*" as integer.
If you already did that, check if the error isn't in another point. I used that code already thousands of times and never had any problem.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
That's why the ROUND statement is in the code snippet. The progress bar only knows how to handle integer values from 0 to 10000.0
-
I suppose he did that.DenSter wrote:That's why the ROUND statement is in the code snippet. The progress bar only knows how to handle integer values from 0 to 10000.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
