1
votes

I have a question and dont know how to do it i have in power builder a command button that does a retrieve of a very large table with accounts (around 300000 rows) and i want when the user clicks the retrieve button to show immediatly a message box with a horizontal progress bar,,till the retrieval argument of ALL is completed...

so far i have only a messagebox that shows the total rows.. and even that the hprogress bar is not working according to retrieve 1st makes the retrieve and after that is getting inside the for loop,,

what i m doing wrong guys?? please some help... as i said i need 2 things

  1. the horizontal progress bar to work as soon as the user click the command button ,, now as i have it works after the retrieve... :(
  2. to place the horizontal progress bar inside a messagebox..

    String  ls_all
    
    long NbrRows,ll
    
    ls_all = 'ALL'
    
    dw_account_list_kyr2.retrieve( ls_all )
    
    NbrRows = dw_account_list_kyr2.RowCount()
    
    if NbrRows>0 then MessageBox('Message','Total accounts - ' + string(Abs(NbrRows), '[general]'))
    
    hpb_1.maxposition = dw_account_list_kyr2.RowCount()
    
    hpb_1.minposition = 0
    
    hpb_1.Position = 0
    
    for ll= 1 to dw_account_list_kyr2.RowCount()
    
    hpb_1.Position = ll     
    
    next
    
    end if
    

please some help guys,

any help would be really appreciated,

thank you in advance

2

2 Answers

1
votes

You need to create a window that looks like a MessageBox with a progress bar on it.

In the DataWindow retrieverow event add code to update the progress bar. To be totally accurate you would need to now in advance how many rows there are.

That being said, why do you have to retrieve 300,000 rows in the first place? The user should enter criteria to bring back only a few rows (<100) at a time as needed.

0
votes
You need make this :
String  ls_all
long NbrRows,ll
ls_all = 'ALL'
NbrRows = dw_1.RowCount()
if NbrRows>0 then 
    MessageBox('Message','Total accounts - ' + string(Abs(NbrRows), '[general]')) 
hpb_1.maxposition = 300000/1000
hpb_1.minposition = 0
hpb_1.position =0
hpb_1.setstep =1000
for ll= 1 to 300000
    hpb_1.position = ll/1000
next
end if``