- You are here:
- Home
- Q&A
- Q&A
- PowerBuilder
- Number of rows in a report
- marco gaspar
- PowerBuilder
- Monday, 6 February 2023 11:57 AM UTC
- Monday, 6 February 2023 12:06 PM UTC
- PowerBuilder
- # 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
- Monday, 6 February 2023 12:13 PM UTC
- PowerBuilder
- # 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)
- Miguel Leeuwe
- Monday, 6 February 2023 18:16 PM UTC
ldatastore.Object.DataWindow.Print.Preview='yes'
At least it works for me with a simple report. I haven't tried with nested reports.
-
Helpful Loading... Helpful 0
- Monday, 6 February 2023 12:13 PM UTC
- PowerBuilder
- # 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.
- Monday, 6 February 2023 12:18 PM UTC
- PowerBuilder
- # 4
Thank you very much!
I'll test it and give you feedback.
- Monday, 6 February 2023 13:42 PM UTC
- PowerBuilder
- # 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.
- Chris Pollach @Appeon
- Monday, 6 February 2023 16:45 PM UTC
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
-
Helpful Loading... Helpful 0
- Monday, 6 February 2023 17:31 PM UTC
- PowerBuilder
- # 6
- Monday, 6 February 2023 18:19 PM UTC
- PowerBuilder
- # 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
- Monday, 6 February 2023 19:08 PM UTC
- PowerBuilder
- # 8
Good afternoon!
Now it always sets fixed (1.25), even if the report has more rows.
Grateful!
- marco gaspar
- Monday, 6 February 2023 19:46 PM UTC
-
Helpful Loading... Helpful 0
- Miguel Leeuwe
- Monday, 6 February 2023 20:20 PM UTC
"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.
-
Helpful Loading... Helpful 0
- Miguel Leeuwe
- Monday, 6 February 2023 20:21 PM UTC
-
Helpful Loading... Helpful 0
- Page :
- 1
However, you are not allowed to reply to this question.