Progress bar

anakin
Member Posts: 27
Hi,
I have created a form to import a text file in a navision table: this form contain a textbox for the file name, and a button to start import procedure.
I want add a progress bar to indicate the percentage of import progress; can anybody add a little sample code to show me the usage of progress bar ?
Thanks, Anakin \:D/
I have created a form to import a text file in a navision table: this form contain a textbox for the file name, and a button to start import procedure.
I want add a progress bar to indicate the percentage of import progress; can anybody add a little sample code to show me the usage of progress bar ?
Thanks, Anakin \:D/
0
Comments
-
See Application Designer Guide (w1w1adg.pdf), section "Using an Indicator to Display Values" for more info.0
-
Hi,
Here is a sample code that displays progress bar denoting %completion of synchronizing customer records.Customer.RESET; TotalRecs := Customer.COUNT; IF Customer.FIND('-') THEN BEGIN //Open the progress bar dialog ProgressBar.OPEN(TEXT008 + TEXT009, Customer.AccountNo); { Where, TEXT008 = Synchronising Customers TEXT009 = #1######\@2@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ } //Perform synchronisation of each customer REPEAT BEGIN // do required processing ................. //Update no. of customers processed and calculate percentage progress CurrTotal := CurrTotal + 1; Progress := ROUND(CurrTotal/TotalRecs*10000, 1); //max limit = 10000 //Update progress bar to display current Customer No. & %completion of customer synchronisation ProgressBar.UPDATE(1, Customer."No."); ProgressBar.UPDATE(2, Progress); SLEEP(500); END; UNTIL Customer.NEXT = 0; //Close the progress bar dialog ProgressBar.CLOSE; END;
Hope this will help you.Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)0 -
Hi
1. The function COUNTAPPROX more recommend for this situation.
2. Nice joke with use a SLEEP function =D>0 -
Hi
Yes COUNTAPPROX should be used.
I didn't follow the 2nd comment.2. Nice joke with use a SLEEP functionRegards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)0 -
Hi
Just i think progress need as addition for some work and not the reverse.
By the way may be asked about Indicator control on the form?0 -
Hi
Note that ProgressBar in the above sample code is a variable of type Dialog.
Regards,Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)0 -
hav wrote:Hi
Note that ProgressBar in the above sample code is a variable of type Dialog.
Regards,
I know but exists a Progress control which can be add on form - may be asked about it?0 -
Look at the documentation I refered. There is example and description how to use the Indicator control. Base is, that you set the minimum and maximum on the control, SourceExpr to some variable, and the progress bar will show you the percentage of the variable when Min value is 0% and max value is 100%. (it mean that if you set the min =0 and max = 100 than you need to set the variable used in SourceExpr to percentage you want to show - e.g. Percentage of read bytes from file size (FileVar.POS/FileVar.*100).)0
-
kine wrote:Look at the documentation I refered. There is example and description how to use the Indicator control. Base is, that you set the minimum and maximum on the control, SourceExpr to some variable, and the progress bar will show you the percentage of the variable when Min value is 0% and max value is 100%. (it mean that if you set the min =0 and max = 100 than you need to set the variable used in SourceExpr to percentage you want to show - e.g. Percentage of read bytes from file size (FileVar.POS/FileVar.*100).)
Hi
I think nice so
Min := 0;
Max := Table.COUNTAPPROX;
variable in SourceExpr just will be increase like i += 1;
BUT Min and Max properties is hidden :oops:0 -
Yes, they are not available in runtime. You set them in Design time to know the limits and than you need to recalculate the variable to the percentage as I wrote. Just set the limits to 0 and 100 in design time. Than set the value to percentage you want to show and it is done...0
-
here's another progress bar example w/code
http://www.mibuso.com/forum/viewtopic.php?t=93640
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