brian_baan
4th September 2003, 21:26
To whom this may concern,
I know that there are a number of posts concerning a progress bar for BaanIV. I found some interesting code that I have modified slightly give the impression that a progress bar fills the lower task bar on session forms when doing some sort of task or calculation.
And in all honesty it give the end user something to keep him busy while waiting for a report to print or information to load.
Many Thanks
Brian.
NvanBeest
5th September 2003, 00:31
Looks good! Thanks for sharing...
Guillaume.G
5th September 2003, 15:03
Hi,
it's a very good solution.
Thank You
Guillaume G.
jmathew
6th September 2003, 10:37
Hi Brian,
I tried to incorporate your coding in one of my customized reports. But I still do not get a progress bar. I have attached a copy of my session script for the report that i have been testing.
I am also not clear about the following in the coding, hence i have commented this line in the code:
import.file.data() |* Do some function with the
imported record
Please help me out with this functionality in Baan IV c4.
Thanks.....
John.
brian_baan
8th September 2003, 16:07
Hey John,
In my example I am importing records from an ASCII file. You are not simply able to cut and paste for use in a report. The function that actually creates the impression of the Progress Bar moving across the lower task bar is update.prog.ind().
The only way that I can see you using this in a report is as the following and if anyone know differently, please post you own recommendations as well. Important to remember there are some performance issues on how often you update the progress bar.
To solve your problem, you have to do two runs through the select statement. However I would suggest trying an index in your first run.
1. First run get record count
2. Second run, calculate percentage (perc = (record no. / record count) * 100)
3. Update progress bar.
The percentage calculation and update of the progress bar must be within the report select statement. The progress bar increments are based on some rudimentry calculations that are done in the before.choice section. If you require further explanation, please feel free to email me directly.
Many Thanks
Brian
NvanBeest
8th September 2003, 16:33
Brian
While browsing around in the Tools directory of BaanIVc4, I found the following functions in ottdllinstall:function extern create.progress.indicator( const string title(), long mode )
function extern destroy.progress.indicator()
function extern update.progress.indicator( long perc.complete, ... )Ever tried to use these?
robertvg
8th September 2003, 18:56
yes, just did: I get all sorts of Fatal errors: "object 0 in process xx not found"
Robert
brian_baan
9th September 2003, 16:03
Nico,
Yes I did, but got the same errors as Robert, I have created a DLL with exactly the same function calls that anyone can use in their script. Makes it a little easier for everybody. I have tried to mimic BaanV progress bar, which pops up a separate window while the session is processing information.
Hope to post a little later today,
Many Thanks
Brian
NPRao
9th September 2003, 20:55
Nico:
If you use the init.gui() function call before you use the progress indicators you wont get the errors.
init.gui
void init.gui( ... )
Expl: - Determine title from calling program
- Call functions to setup the window and form layout
Pre: -
Post: -
Input: - title (optional)
Output: -
here is an example code-
#pragma used dll ottdllinstall
function main()
{
init.gui()
create.progress.indicator("Testing", 1)
update.progress.indicator(25, "In process...")
suspend(1000)
destroy.progress.indicator( )
}
nick_rogers
9th September 2003, 23:05
I take it that these functions you call are just for Baan V ?
NvanBeest
10th September 2003, 00:54
Thanks NP.
Nick, they exist in BaanIV as well.
robertvg
24th September 2003, 10:29
I used init.gui() as NPrao suggested, the errors (on B4c4) are now gone, a separate window opens, but no progress indicator appears. Hourglass shows forever.
Robert
hklett
24th September 2003, 11:18
Try this
#pragma used dll ottdllinstall
function main()
{
init.gui()
create.progress.indicator("Testing", 4)
suspend(500)
update.progress.indicator(10, "In process...")
suspend(500)
update.progress.indicator(25, "In process...")
suspend(500)
update.progress.indicator(50, "In process...")
suspend(500)
update.progress.indicator(75, "In process...")
suspend(500)
update.progress.indicator(100, "In process...")
suspend(5000)
destroy.progress.indicator( )
}
robertvg
24th September 2003, 11:34
Fantastic !!! It works !
Strangely enough it was the 'mode' parameter that did the trick: previously we used create.progress.indicator("testing", 1); it shows nothing, but with mode 4 it works.
The only problem I now have is that the window (created by the init.gui() command) remains open. Any idea on how to destroy that window ?
kind regards,
Robert
günther
24th September 2003, 12:10
The first time that I've seen a progress indicator - my first tests with these functions started in July 2000! Congratulation!
I have the same problem as Robert, ie. the window does not appear. Baan IVc4.
Günther
techfan
24th September 2003, 12:22
Originally posted by robertvg
I used init.gui() as NPrao suggested, the errors (on B4c4) are now gone, a separate window opens, but no progress indicator appears. Hourglass shows forever.
Robert
Try using the following code:
#pragma used dll ottdllinstall
function main()
{
init.gui()
create.progress.indicator("Testing",3 )
for i = 10 to 100 step 10
update.progress.indicator(i, "In process...")
suspend(500)
endfor
destroy.progress.indicator( )
destroy.objects()
}
You should see a moving indicator now.
zardoz
24th September 2003, 13:11
Seems ok, but if I try to incorporate the code in my script (a simple printout) - if I call the destroy.objects() functions I receive a BW error (maybe because tries to kill the main window also?) - if I don't put this instruction the progress bar window last till exiting the session.
But, anyway, it works!
PS.:
I've used also a parameter in init.gui() to change the title from the "import data dictionary" used as default...
init.gui("Work in progress")
robertvg
24th September 2003, 13:26
I have the same errors with 'destroy.objects' : object xxx in process yyy not found. I also noticed that the message parameter in the update.progress.indicator(percentage, message) does not show anywhere on the form.
Are there anymore parameters for the init.gui() call ?
Maybe to resize the window a bit smaller ?
regards,
Robert
robertvg
25th September 2003, 15:01
you can program an exit() instead of destroy.objects to neatly close the progress bar window and the main window
rgrds,
Robert
niteshsharma
27th September 2003, 07:22
Hi all,
i am very happy to know this tool in Baan 4c3 as tht can be very useful for baan Customizations.
Well i am developing two sessions which are following
1. A print session
2. A maintain session
-----------------------------------------------------
In case 1.
----------------------------------------------------
i want to show my progress bar on the base of my records processes to the report and when process gets completed i want to end up my progress bar so that user should be able to know how long will report take time to print
say i have a table of customer from where i am fatching record to print it on report. in tht case i want to link my customer id with progress bar as soon as my customer id processes progress bar should get updated.
------------------------------------------------------
In case 2
------------------------------------------------------
In maintain session when i update record i want to incorporate this same feature at the time of updateing table
say when i insert some new data into table and press continue button to update my progress bar should display the status of updation and as i want tht two button should also display on progress bar window 1.stop 2.cancel
when i press cancel button Transaction should be rollback
and logically then database table should not be updated
and if database gets updated then my progress bar should end up
well for second case i will have to use
#include <bic_dam>
but i don't find it anyware in my $bse/include6.1/
plz. help me about this also
plz. help me about this matter
its very intresting and urgent 4 me
thanx
plz help.
n.s.
triton45
11th November 2003, 18:09
To get the progress indicator window to exit, I modified the posted code below
#pragma used dll ottdllinstall
function main()
{
id.orig = current.mwindow() |get current window id
init.gui("Title of window")
create.progress.indicator("Testing",3 )
for i = 10 to 100 step 10
update.progress.indicator(i, "In process...")
suspend(500)
endfor
id.new = current.mwindow() |get progess indicator window id
change.mwindow(id.orig) |set current window to orig window
destroy.mwindow(id.new) |remove progress indicator window
}
works in IVc4
Andy
vinay sharma
10th November 2010, 14:18
hi
it has been not working
mark_h
10th November 2010, 15:23
The code above posted by andy works for me in 4c4.
vinay sharma
11th November 2010, 06:04
hi
where should i call this function, should i make this a form command function