# Progress Bar

**URL:** <https://techcommunity.softwareag.com/t/progress-bar/189177>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, NaturalONE, Natural-for-AJAX\
**Created:** [June 22, 2016, 6:44pm UTC](https://techcommunity.softwareag.com/t/progress-bar/189177 "2016-06-22T18:44:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandre\_Oliveira](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/alexandre_oliveira/32/1017_2.png) [@Alexandre\_Oliveira](https://techcommunity.softwareag.com/u/Alexandre_Oliveira)\
**Post date:** [June 22, 2016, 6:44pm UTC](https://techcommunity.softwareag.com/t/progress-bar/189177/1 "2016-06-22T18:44:31Z")

</div>

Hi,

I would like show to user the percentage of records read. I think to do this with a DIV, but I don’t know how to update the percentage while reading. I tried using NJX:TRIGGEREVENT component, but don’t work.

Best regards,

Alexandre Marques de Oliveira

---

<div class="post-metadata">

**Author:** ![Christine\_Zimmermann](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@Christine\_Zimmermann](https://techcommunity.softwareag.com/u/Christine_Zimmermann)\
**Post date:** [June 22, 2016, 9:17pm UTC](https://techcommunity.softwareag.com/t/progress-bar/189177/2 "2016-06-22T21:17:39Z")

</div>

Hi Alexandre,

the NJX:TRIGGEREVENT is only for triggering events and exchanging data between Natural and the web application tier (for instance Tomcat). It does not allow to trigger events in the browser.

If you want to somehow “block” the screen you could use a little modal dialog with a timer control and a scheduleline control. The schedulline control implements the “progress bar”. The timer control triggers events in the Natural program every X milliseconds. The Natural program can then set the corresponding values in the scheduleline and stop the timer and close the pop-up when finished (see attached screenshot)

If you don’t want to block the screen, an option would be implement a small custom control which is showing the progress using Java Script.

Best Regards,  
Christine

 ![progressbar.jpg](https://global.discourse-cdn.com/techcommunity/original/2X/a/a3c70918e23819af1e2e7983b3a448a85aa9910d.jpeg)

---

<div class="post-metadata">

**Author:** ![Alexandre\_Oliveira](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/alexandre_oliveira/32/1017_2.png) [@Alexandre\_Oliveira](https://techcommunity.softwareag.com/u/Alexandre_Oliveira)\
**Post date:** [June 30, 2016, 1:51pm UTC](https://techcommunity.softwareag.com/t/progress-bar/189177/3 "2016-06-30T13:51:35Z")

</div>

Hi Christine,

Unfortunately, I can’t implement the progress bar. Do you have the source code of this example?

Best regards,

Alexandre

---

<div class="post-metadata">

**Author:** ![Christine\_Zimmermann](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@Christine\_Zimmermann](https://techcommunity.softwareag.com/u/Christine_Zimmermann)\
**Post date:** [August 11, 2016, 12:38pm UTC](https://techcommunity.softwareag.com/t/progress-bar/189177/4 "2016-08-11T12:38:51Z")

</div>

Hi Alexandre,

sorry for the delay, I forgot to attach the sample. Here it is.

It’s a Natural ONE project. Of course you can style it differently (colors …).

Best Regards,  
Christine

[ProgressBar.zip](https://techcommunity.softwareag.com/uploads/short-url/c3f12mOzOAzWhMS170Jirkv8TaR.zip) (8.49 KB)

---

<div class="post-metadata">

**Author:** ![Alexandre\_Oliveira](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/alexandre_oliveira/32/1017_2.png) [@Alexandre\_Oliveira](https://techcommunity.softwareag.com/u/Alexandre_Oliveira)\
**Post date:** [March 27, 2017, 6:47pm UTC](https://techcommunity.softwareag.com/t/progress-bar/189177/5 "2017-03-27T18:47:47Z")

</div>

Hi Christine,

Very good!!!

I only saw today the file with the example.  
The program stops working when you try to run CALL ‘CMROLL’  
I imagine it is a routine written in ASSEMBLER or C that is not available.  
I am using z/VSE. Does the routine exist for this environment?

Best regards,

Alexandre

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [March 28, 2017, 7:04am UTC](https://techcommunity.softwareag.com/t/progress-bar/189177/6 "2017-03-28T07:04:26Z")

</div>

CMROLL is available on z/VSE, what happens when you call it ?

Take a look at program SUSPEND in lib SYSEXTP, or use USR2027N from lib SYSEXT.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Oliveira](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/alexandre_oliveira/32/1017_2.png) [@Alexandre\_Oliveira](https://techcommunity.softwareag.com/u/Alexandre_Oliveira)\
**Post date:** [March 28, 2017, 12:59pm UTC](https://techcommunity.softwareag.com/t/progress-bar/189177/7 "2017-03-28T12:59:53Z")

</div>

Wolfgang,

Thank you for your explanation.  
I understood the routine and I will not need to use it.  
Now progressbar is working.

Christine… thank you for your help.

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [March 28, 2017, 1:14pm UTC](https://techcommunity.softwareag.com/t/progress-bar/189177/8 "2017-03-28T13:14:23Z")

</div>

For those users with “plain vanilla” Natural, here is some code which can be used with percentages. The technique would be the same except for the letter progress; which would involve code depending on how you wanted to determine a percentage “break”.

DEFINE DATA LOCAL  
1 #BAR (A60)  
1 #LOOP (N2)  
1 #DELAY (I2) INIT \<1\>  
1 #LETTER (A1)  
1 MYVIEW VIEW OF EMPLOYEES  
2 NAME  
END-DEFINE  
\*  
READ MYVIEW IN LOGICAL SEQUENCE BY NAME  
AT BREAK OF NAME /1/  
ADD 1 TO #LOOP  
MOVE OLD (NAME) TO #LETTER  
SET CONTROL ‘N’  
CALL ‘CMROLL’ #DELAY  
RESET #BAR  
MOVE ‘&’ TO SUBSTRING (#BAR,#LOOP,1)  
WRITE 3/5 #BAR (AD=V CD=PI DY=&N$) ‘UPTO LETTER’ #LETTER  
NEWPAGE  
END-BREAK  
END-READ  
END

CMROLL is just a routine that “slows down” the bar chart, by guaranteeing a one second delay between letters.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Oliveira](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/alexandre_oliveira/32/1017_2.png) [@Alexandre\_Oliveira](https://techcommunity.softwareag.com/u/Alexandre_Oliveira)\
**Post date:** [March 28, 2017, 3:23pm UTC](https://techcommunity.softwareag.com/t/progress-bar/189177/9 "2017-03-28T15:23:55Z")

</div>

Thanks for your help, Steve.  
My problem is to create a progressbar using the PROCESS PAGE command.  
The SET CONTROL ‘N’ command does not work with a web page.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:36pm UTC](https://techcommunity.softwareag.com/t/progress-bar/189177/10 "2021-04-02T15:36:19Z")

</div>

Closed on April 2, 2021, 3:36pm UTC


