1. marco gaspar
  2. PowerBuilder
  3. Monday, 6 February 2023 11:57 AM UTC
115 / 5.000
 

Resultados de tradução

Resultado da tradução

 
Good morning, is there any way to find out the maximum number of lines on a report page, Thank you very much!
Sivaprakash BKR Accepted Answer Pending Moderation
  1. Monday, 6 February 2023 12:06 PM UTC
  2. PowerBuilder
  3. # 1

Question not clear.

Would you like to know the number of (code) rows or no. of lines in the report output (data).   If you want to know the number of output lines (data), then dw_1.RowCount() could do that.

Happiness Always
BKR Sivaprakash

 

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 6 February 2023 12:13 PM UTC
  2. PowerBuilder
  3. # 2

Hi,

The amount of rows on a page might vary, depending on possible group headers etc.

If you want to know the amount of rows on a "specific" page, scroll to that page and substract the results of 

// something like this?

long ll_rowsOnPage

ll_rowsOnPage = Long(dw_1.Object.DataWindow.LastRowOnPage) - Long(dw_1.Object.DataWindow.FirstRowOnPage)
Comment
  1. Miguel Leeuwe
  2. Monday, 6 February 2023 18:16 PM UTC
If you use a dataWINDOW control, it should work, but if you use a dataSTORE, you FIRST have to activate print.preview before getting the lastrowonpage and firstrowonpage.

ldatastore.Object.DataWindow.Print.Preview='yes'

At least it works for me with a simple report. I haven't tried with nested reports.

  1. Helpful
There are no comments made yet.
marco gaspar Accepted Answer Pending Moderation
  1. Monday, 6 February 2023 12:13 PM UTC
  2. PowerBuilder
  3. # 3

I'll give you an example:
I have to generate contracts, which the cooperative member needs to sign. I don't know how many members will sign, because there could be many. Depending on the number of signatures, the line to sign is on one page and the member's name on another. I would need to know how many lines I still have left in the report to validate if I put everything on another page or not.
Did you understand?

Grateful.

Comment
There are no comments made yet.
marco gaspar Accepted Answer Pending Moderation
  1. Monday, 6 February 2023 12:18 PM UTC
  2. PowerBuilder
  3. # 4

Thank you very much!

I'll test it and give you feedback.

Comment
There are no comments made yet.
marco gaspar Accepted Answer Pending Moderation
  1. Monday, 6 February 2023 13:42 PM UTC
  2. PowerBuilder
  3. # 5

Unfortunately it didn't work!

I receive a datastore that already comes with the terms of the contract and, soon after, the signatures. The value that is returning from LastRowOnPage or FirstRowOnPage, in this case, are always returning 1.

Is there any other way?

Grateful.

Comment
  1. Chris Pollach @Appeon
  2. Monday, 6 February 2023 16:45 PM UTC
Hi Marco;

Unfortunately at this time, there is no exact way to extract the number of lines in a given report. Especially with reports that have group breaks or within a Composite or Nested parent DWO.

This would have to be in handled as an enhancement request.

Regards ... Chris
  1. Helpful
There are no comments made yet.
marco gaspar Accepted Answer Pending Moderation
  1. Monday, 6 February 2023 17:31 PM UTC
  2. PowerBuilder
  3. # 6
 
Likewise, thank you!
Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 6 February 2023 18:19 PM UTC
  2. PowerBuilder
  3. # 7

To follow up on a comment I just made:

 

If you use a dataWINDOW control, it should work, but if you use a dataSTORE, you FIRST have to activate print.preview before getting the lastrowonpage and firstrowonpage.
ldatastore.Object.DataWindow.Print.Preview='yes'
At least it works for me with a simple report. I haven't tried with nested reports.

 

long ll_start, ll_end
string ls_ret
datastore lds

dw_1.dataobject = 'myreport.psr'

ll_start = long(dw_1.object.datawindow.FirstRowOnPage)
ll_end = Long(dw_1.Object.DataWindow.LastRowOnPage)

lds = create datastore
lds.dataobject = 'myreport.psr'

// both return a value of 1:
ll_start = long(lds.object.datawindow.FirstRowOnPage)
ll_end = Long(lds.Object.DataWindow.LastRowOnPage)

//ls_ret = lds.Object.DataWindow.Print.Preview

// this should work:
lds.Object.DataWindow.Print.Preview='yes'

ll_start = long(lds.object.datawindow.FirstRowOnPage)
ll_end = Long(lds.Object.DataWindow.LastRowOnPage)

regards

Comment
There are no comments made yet.
marco gaspar Accepted Answer Pending Moderation
  1. Monday, 6 February 2023 19:08 PM UTC
  2. PowerBuilder
  3. # 8

Good afternoon!
Now it always sets fixed (1.25), even if the report has more rows.
Grateful!

Comment
  1. marco gaspar
  2. Monday, 6 February 2023 19:46 PM UTC
I don't know if I did it correctly, but it didn't work!
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 6 February 2023 20:20 PM UTC
Explain "it didn't work". Before your said "Now it always sets fixed (1.25), even if the report has more rows." What does that mean. what is 1.25? first visible row 1 and las visible row 25?

"Even if the report has more rows". ... yes but you said you only want to count the rows on a certain page not all of the rows?

I also said that first you have to "scroll to the row on the page for which you want to count the rows of that page. (ldatastore.ScrollToRow() ).

Maybe I don't understand what you do.

regards.
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 6 February 2023 20:21 PM UTC
If your first page shows rows 1 - 25, then to know the rowcount of the second page you have to do a ScrollToRow(26), etc.
  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.