RowsCopy – PB Docs 150

RowsCopy method (DataWindows)

Description

Copies a range of rows from one DataWindow control (or DataStore object)
to another, or from one buffer to another within a single DataWindow
control (or DataStore).

Controls

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore
object

Web ActiveX

DataWindow control, DataWindowChild object

Syntax

[PowerBuilder]

[Web ActiveX]

Argument

Description

dwcontrol

The name of the DataWindow control, DataStore,
or child DataWindow from which you want to copy rows.

startrow

The number of the first row you want
to copy.

endrow

The number of the last row you want to
copy.

copybuffer

A value of the dwBuffer enumerated datatype
(PowerBuilder) or an integer (Web ActiveX) identifying the DataWindow buffer
from which you want to copy rows.

For a list of valid values, see DWBuffer.

targetdw

A reference to the DataWindow control
or DataStore object to which you want to copy the rows. Targetdw can
be the same DataWindow (or DataStore) or another DataWindow (or DataStore).

beforerow

The number of the row before which you
want to insert the copied rows. To insert after the last row, use
any value that is greater than the number of existing rows.

targetbuffer

A value of the dwBuffer enumerated datatype
(PowerBuilder) or an integer (Web ActiveX) identifying the target
DataWindow buffer for the copied rows.

For a list of valid values, see DWBuffer.

Return Values

Returns 1 if it succeeds and –1 if an error occurs.

If any argument’s value is null, in PowerBuilder
and JavaScript the method returns null.

Usage

When you use the RowsCopy method, the status
of the rows that are copied to the primary buffer is NewModified!.
If you issue an update request, PowerBuilder sends SQL INSERT statements
to the DBMS for the new rows.

When you use RowsCopy, data is not automatically
retrieved for drop-down DataWindows in the target DataWindow or
DataStore, as it is when you call InsertRow. You must explicitly
call Retrieve for child DataWindows in the target.

When you use RowsCopy or RowsMove to
populate another DataWindow, the copied data is not automatically
processed by filters or sort criteria in effect on the target DataWindow.
You might be required to call the Filter, GroupCalc,
or Sort methods to properly process the data.

Uses for RowsCopy include:

  • Making copies of one or more
    rows so that the users can create new rows based on existing data

  • Printing a range of rows by copying selected rows
    to another DataWindow and printing the second DataWindow

note.png Buffer manipulation and query mode

A DataWindow cannot be in query mode
when you call the RowsCopy method.

Examples

This statement copies all the rows starting with
the current row in dw_1 to the beginning of the primary
buffer in dw_2:

This example copies all the rows starting with the
current row in dw_1 to the beginning of the primary buffer
in the drop-down DataWindow state_id in dw_3:

This example copies all the rows starting with the
current row in dw_1 to the beginning of the primary buffer
in the nested report d_employee:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x