-   Code & Utilities (
-   -   Progress Bar for BaanIV (

brian_baan 4th September 2003 20:26

Progress Bar for BaanIV
1 Attachment(s)
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

NvanBeest 4th September 2003 23:31

Looks good! Thanks for sharing...

Guillaume.G 5th September 2003 14:03

Yes, it's Beautyfull

it's a very good solution.

Thank You

Guillaume G.

jmathew 6th September 2003 09:37

progress bar in Baan IVc4
1 Attachment(s)
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: |* Do some function with the
imported record

Please help me out with this functionality in Baan IV c4.



brian_baan 8th September 2003 15:07

Progress Bar not working in BaanIV
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

NvanBeest 8th September 2003 15:33


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 17:56

yes, just did: I get all sorts of Fatal errors: "object 0 in process xx not found"


brian_baan 9th September 2003 15:03

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

NPRao 9th September 2003 19:55


If you use the init.gui() function call before you use the progress indicators you wont get the errors.

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()
create.progress.indicator("Testing", 1)
update.progress.indicator(25, "In process...")
destroy.progress.indicator( )

nick_rogers 9th September 2003 22:05

I take it that these functions you call are just for Baan V ?

NvanBeest 9th September 2003 23:54

Thanks NP.

Nick, they exist in BaanIV as well.

robertvg 24th September 2003 09: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.


hklett 24th September 2003 10:18

Try this


#pragma        used        dll        ottdllinstall
function main()
create.progress.indicator("Testing", 4)
update.progress.indicator(10, "In process...")
update.progress.indicator(25, "In process...")
update.progress.indicator(50, "In process...")
update.progress.indicator(75, "In process...")
update.progress.indicator(100, "In process...")

destroy.progress.indicator( )

robertvg 24th September 2003 10: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,

günther 24th September 2003 11: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.


All times are GMT +2. The time now is 23:01.

©2001-2017 - -