Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Syntax for Progress Bar
Tue, Oct 7 2014 12:35 PMPermanent Link

Ben Sprei

CustomEDP

Im looking to add a Progress Bar  to show progress on the execution of a
query.
What would be the syntax.

Ben

PS:  If Im in the wrong group please excuse me and let me know which group
to park my question.
Tue, Oct 7 2014 2:01 PMPermanent Link

Raul

Team Elevate Team Elevate

On 10/7/2014 12:35 PM, Ben wrote:
> Im looking to add a Progress Bar  to show progress on the execution of a
> query.
> What would be the syntax.

You'd need to show the progress bar before executing query and then
update it from OnProgress event of the query :

http://www.elevatesoft.com/manual?action=viewevent&id=edb2&product=rsdelphiwin32&version=XE6&comp=TEDBQuery&event=OnProgress

Raul
Tue, Oct 7 2014 2:33 PMPermanent Link

Ben Sprei

CustomEDP

How do you show the PB and how do you update it

"Raul"  wrote in message
news:A989EF40-8511-4861-A020-E9C68B656C38@news.elevatesoft.com...

On 10/7/2014 12:35 PM, Ben wrote:
> Im looking to add a Progress Bar  to show progress on the execution of a
> query.
> What would be the syntax.

You'd need to show the progress bar before executing query and then
update it from OnProgress event of the query :

http://www.elevatesoft.com/manual?action=viewevent&id=edb2&product=rsdelphiwin32&version=XE6&comp=TEDBQuery&event=OnProgress

Raul
Wed, Oct 8 2014 3:29 AMPermanent Link

Uli Becker

It's not clear what you mean.
Raul showed you the right way: just use the OnProgress event of the query and write code to change the position of the progressbar.

Uli
Wed, Oct 8 2014 4:00 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ben


Drop your progress bar on the form, double click on the OnProgress event for the query to create the skeleton in your code.

In the OnProgress event one of the parameters is PercentDone: Integer. Assuming your progress bar is set for a range from 0 to 100 then the event should look like

procedure TCompaniesForm.TransferSitesProgress(Sender: TObject;
 PercentDone: Integer; var Continue: Boolean);
begin
ProgressBar1.Position := PercentDone;
ProgressBar1.Update;
end;

That all that's needed.

However, there is a small problem as I discovered from discussing the matter with Tim. Unless I'm misremembering the PercentDone parameter is only updated for the build of the resultant dataset for the query, its not updated as part of the WHERE clause evaluation. Depending on what's taking the majority of the time the progress display is of greater or lesser use. What I've started doing is using a "distractor" (sort of like a clock ticking) just to let the user know the computer hasn't died on them.


Roy Lambert
Image