Progress Bar

sabzam
Member Posts: 1,149
Hi, I have created a progress bar but for some reason or another it starts immediately from 100% instead of progressing from 1% to 100%. The following is the code.
Can anyone help please?
Regards
TempFileName := ConvertPath(ImportFileName); Window.OPEN( Text003 +' . . '+TempFileName +'\' + Text004 +'@1@@@@@@@@@@@@@@@@@@@@@\'); Window.UPDATE(1); TotalRecNo := "Transactions".COUNTAPPROX; RecNo :=0;
Can anyone help please?
Regards
0
Comments
-
sabzam wrote:
Window.UPDATE(1);
You probably mentWindow.UPDATE(1, 0)
The second argument must be an integer in the range 0 to 10000 so:Window.UPDATE(1, ROUND("Progress %" * 100, 1, '<'));
I usually round down to reduce the 'still running at 100%' effect.Robert de Bath
TVision Technology Ltd0 -
Unfortunately still not working I don't know why..... What I am doing is uploading records through a dataport and I want to show the upload progress but it is starting from 100% immediately.
Can you help please?
Regards0 -
TempFileName := ConvertPath(ImportFileName); Window.OPEN( Text003 +' . . '+TempFileName +'\' + Text004 +'@1@@@@@@@@@@@@@@@@@@@@@\'); Window.UPDATE(1); TotalRecNo := "Transactions".COUNTAPPROX; RecNo :=0;
What should "1" update? Which variable should there set?
Is the Window.upadate in a loop or in a dataport or where?
Normally the souirce for a progressbar in a dialog looks like this:Counts := FromSomewhere.counts; //or countapprox <- need updated statistics i := 0; Window.open('My little progress bar: @1@@@@@@@@'); if CONDITION then begin repeat i += 1; Window.update(1,round(i*100/counts*100,1)); until LOOPSTOPCOMMAND; end; Window.close;
RegardsDo you make it right, it works too!0 -
Hi,What should "1" update? Which variable should there set?
Is the Window.upadate in a loop or in a dataport or where?
1 is Updating TEXT004 which is a constant i.e. the one that populates the progress bar
Window.update is in a dataport OnAfterImportRecord() trigger and there is no need loops for loops i think
So... OnAfterImportRecord() trigger I have the following code:RecNo := RecNo + 1; Window.UPDATE(1,ROUND(RecNo/TotalRecNo * 10000,1));
And in PreDataport() trigger I have the following:TempFileName := ConvertPath(ImportFileName); Window.OPEN( Text003 +' . . '+TempFileName +'\' + Text004 +'@1@@@@@@@@@@@@@@@@@@@@@\'); Window.UPDATE(1, 0); TotalRecNo := "EBet Transactions".COUNTAPPROX; RecNo :=0;
Where:
Name ConstValue
Text003 Filename:
Text004 Progress:
Is it better this way?? Can you help please??
Regards0 -
Unfortunately still not working I don't know why..... What I am doing is uploading records through a dataport and I want to show the upload progress but it is starting from 100% immediately.
Can you help please?
Regards
Errm, (feels like there might be a do'h moment coming ...)
Where are you getting your total count from?
Are you getting it from the empty table before the import ... are there zero records in the table?
For a Import dataport you use
Window.UPDATE(1, ROUND(CurrFile.POS / CurrFile.LEN * 10000, 1));Robert de Bath
TVision Technology Ltd0
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