1. Eduardo Barbeito
  2. PowerBuilder
  3. Tuesday, 18 June 2024 00:09 AM UTC

Hi guys,

I need some help.

I am building a print preview window and I added buttons to navegate to first page (dw_1.scrollToRow(dw_1.Find("page() = 1", 1, dw_1.RowCount())) because dw_1.ScrollFirstPage() was marked as obsolete), next page (dw_1.scrollnextpage()), prior page (dw_1.scrollpriorpage()) but i can´t script to jump to last page (dw_1.ScrollLastPage() was marked as obsolete).

I cannot use the last row to get the last page because in some cases i have only 1 row with 6 or 7 repots.

Using Powerbuilder 2022, build 1900.

Any suggestion?

Sorry about my english.

Accepted Answer
Benjamin Gaesslein Accepted Answer Pending Moderation
  1. Tuesday, 18 June 2024 13:37 PM UTC
  2. PowerBuilder
  3. # Permalink
Yeah, that's how the pfc does it in the u_dw.pfc_lastpage() event: ScrollToRow (2147483647). When in doubt, scroll to a large number. :)
Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 18 June 2024 04:22 AM UTC
  2. PowerBuilder
  3. # 1

Hi, Eduardo -

I'd like to suggest that if the DataWindow control being used for the Print Preview functionality has a vertical scroll bar and live scrolling both enabled, the user can easily position to any page via the scroll bar's up/down arrow buttons or via the scroll bar thumb. PB dynamically displays a tool tip as you drag the scroll bar's thumb to let you know which page you are currently scrolling to.

If you're committed to implementing the four navigation buttons you've described, may I suggest you use dw_1.ScrollToRow(1) to scroll to the first page, and either dw_1.ScrollToRow(dw_1.RowCount()) or dw_1.ScrollToRow(99999999) [or another suitably large number] to scroll to the last page.

Best regards, John

 

Comment
  1. David Peace (Powersoft)
  2. Tuesday, 18 June 2024 08:28 AM UTC
I think the issue is that this is a DW with nested reports so scrolltorow will not work. A single row spans multiple pages, by the sound of it. I'm not sure there is a good way to to do what you want.
  1. Helpful
  1. Eduardo Barbeito
  2. Tuesday, 18 June 2024 13:36 PM UTC
Benjamin, bingo...

it worked fine. I had already tried with the number 999999, but it didn't work. I think my brain was no longer thinking at that time.

Tks for your help.
  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.