Baanboard.com

Baanboard.com (http://www.baanboard.com/baanboard/index.php)
-   Code & Utilities (http://www.baanboard.com/baanboard/forumdisplay.php?f=33)
-   -   Progress Bar for BaanIV (http://www.baanboard.com/baanboard/showthread.php?t=12849)

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
Brian.

NvanBeest 4th September 2003 23:31

Looks good! Thanks for sharing...

Guillaume.G 5th September 2003 14:03

Yes, it's Beautyfull
 
Hi,

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:

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 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
Brian

NvanBeest 8th September 2003 15:33

Brian

While browsing around in the Tools directory of BaanIVc4, I found the following functions in ottdllinstall:
Code:

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

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


Robert

brian_baan 9th September 2003 15: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 19:55

Nico:

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


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-
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 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.

Robert

hklett 24th September 2003 10:18

Try this

Code:


#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 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,
Robert

günther 24th September 2003 11:10

Wow!
 
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


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


vB.Sponsors
©2001-2017 - Baanboard.com - Baanforums.com