1. John Vanleeuwe
  2. PowerBuilder
  3. Sunday, 22 December 2019 19:02 PM UTC

Hi all,

 

Just wondering how i programmatically can scroll to the last row ( so not the first 24) but the last row , as if i would keep the pagedown mouse pressed down , but then in one shortcut.

 

Not sure if i made any sense :)

I must stay in query mode / retrieve as needed , but i need a shortcut for our users to jump to the last record...

 

TIA

John

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Sunday, 22 December 2019 19:51 PM UTC
  2. PowerBuilder
  3. # 1

Hi John;

   Have you tried ....

DC.ScrollToRow ( DC.RowCount ( ) )

Regards... Chris

Comment
  1. John Vanleeuwe
  2. Sunday, 22 December 2019 20:07 PM UTC
Hi Chris,



tried it already , but dc.rowcount() is not giving me the last row because in query mode/ retrieve as needed only the first 24 or 40 records are loaded. i only can press the pagedown button which loads each time the next additional 24/40 records ... But i need a shortcut to jump to the last record...





tia

John







John
  1. Helpful
  1. John Fauss
  2. Monday, 23 December 2019 00:11 AM UTC
If you're needing the last n rows in the entire result set, can you not turn off Retrieve As Needed, perform the DWC.Retrieve(), then follow Chris' suggestion?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 23 December 2019 16:23 PM UTC
Hi John;

You're in a bit of a Catch-22 situation ...

1) You must get out of Query Mode in order to generate the appropriate Where clause.

2) Then you have to complete the Retrieve() command next

3) Then you need to set the DWO so that it retrieves the entire Result Set to get the last row.

DC.Modify ( "DataWindow.Retrieve.AsNeeded=No" )

Regards ... Chris
  1. Helpful
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Monday, 23 December 2019 11:08 AM UTC
  2. PowerBuilder
  3. # 2

possibly select a count of rows from the DB for the SQL in the DW, then scroll to row n as the "real" last row. No idea if that will work but might....

Realy though the retrieve as needed is in conflict with the remise of scrolling to the last row that has not yet been retrieved.

Comment
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Monday, 23 December 2019 13:56 PM UTC
  2. PowerBuilder
  3. # 3

"query mode / retrieve as needed "  - What are you talking about here?  Is you datawindow in querymode when you are trying to scroll? are you asking a question about being in query mode, or are you asking a question about retrieve as needed?

 

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 23 December 2019 14:14 PM UTC
  2. PowerBuilder
  3. # 4

If the datawindow is in Retrieve As Needed mode and they want to jump to the end, you need to turn off Retrieve As Needed and do a normal retrieve. Then you can do a ScrollToRow passing RowCount.

You can turn it on/off like this:

dw1.Modify("DataWindow.Retrieve.AsNeeded=No")

It would be really helpful if we could find out how many rows are queued up when the initial retrieve is executed. Then you could add a compute that showed 'Row x of y' and y would be the number of rows selected.

 

 

Comment
  1. Roland Smith
  2. Monday, 23 December 2019 14:18 PM UTC
I think you have to call DBCancel on the control first to release the pending query before retrieving it in normal mode.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.