Datawindows and Computed Fields

I am using PB 8 and have several formatted datawindows providing reports for
the end user.  What has been requested of me and I am having trouble with is
as follows.  I have a datawindow with a nested datawindow.  The main
datawindow object contains the "parent" record and the nested one contains
"child" records.  Basically an Agency has subagencies.  This report is to be
used to create a manual.  Where I am having the problem is that the page
numbering is done using a computed field placed in the header (or footer or
detail for that matter).  I need to know the page number a particular row
falls on to generate a TOC for this document.  The users wish to sort the
TOC differently than the data is presented in the primary report structure.
I have been trying to figure how to write the page number for a particular
row into that row in the db.  There is a column for that in the database.
What I encounter is that I can only capture the page number that the
datawindow is displaying in the datawindow control at runtime.  For example
if I run the report, leave it at the first page, all rows show page 1.  If I
scoll to another page, that is the page number written for all rows.  Is
there a way to capture the page number associated with a particular row.
i.e.  Row # 4 is on page 2, Row # 350 is on page 185, etc.


0
Eric
3/30/2004 8:32:55 PM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

1 Replies
435 Views

Similar Articles

[PageSpeed] 56

You'll have to use the Evaluate function with a Describe. Something like
this:

ll_row = dw_1.getRow()
ls_page = dw_1.Describe("Evaluate('page()', " + string(ll_row) + ')')

This expression will return the page number the row is on. I haven't used
this in a while, so the quotes might need adjustment. It does eventually
work, though.

Larry

"Eric J. Bender" <ejbender@health.state.ak.us> wrote in message
news:4069d977$1@forums-1-dub...
> I am using PB 8 and have several formatted datawindows providing reports
for
> the end user.  What has been requested of me and I am having trouble with
is
> as follows.  I have a datawindow with a nested datawindow.  The main
> datawindow object contains the "parent" record and the nested one contains
> "child" records.  Basically an Agency has subagencies.  This report is to
be
> used to create a manual.  Where I am having the problem is that the page
> numbering is done using a computed field placed in the header (or footer
or
> detail for that matter).  I need to know the page number a particular row
> falls on to generate a TOC for this document.  The users wish to sort the
> TOC differently than the data is presented in the primary report
structure.
> I have been trying to figure how to write the page number for a particular
> row into that row in the db.  There is a column for that in the database.
> What I encounter is that I can only capture the page number that the
> datawindow is displaying in the datawindow control at runtime.  For
example
> if I run the report, leave it at the first page, all rows show page 1.  If
I
> scoll to another page, that is the page number written for all rows.  Is
> there a way to capture the page number associated with a particular row.
> i.e.  Row # 4 is on page 2, Row # 350 is on page 185, etc.
>
>


0
Larry
3/30/2004 8:55:39 PM
Reply: