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 |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
1 |
integer <span>dwcontrol</span>.<span>RowsCopy</span> ( long <span>startrow</span>, long <span>endrow</span>, <br> DWBuffer <span>copybuffer</span>, datawindow <span>targetdw</span>, long <span>beforerow</span>,<br> DWBuffer <span>targetbuffer</span>)<br>integer <span>dwcontrol</span>.<span>RowsCopy</span> ( long <span>startrow</span>, long <span>endrow</span>, <br> DWBuffer <span>copybuffer</span>, datastore <span>targetdw</span>, long <span>beforerow</span>, <br> DWBuffer <span>targetbuffer</span> )<br>integer <span>dwcontrol</span>.<span>RowsCopy</span> ( long <span>startrow</span>, long <span>endrow</span>, <br> DWBuffer <span>copybuffer</span>, datawindowchild <span>targetdw</span>, long <span>beforerow</span>,<br> DWBuffer <span>targetbuffer</span> ) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>RowsCopy</span> (number <span>startrow</span>, number <span>endrow</span>,<br> DWBuffer <span>copybuffer</span>, datawindow <span>targetdw</span>, number <span>beforerow</span>,<br> number <span>targetbuffer</span> )<br>number <span>dwcontrol</span>.<span>RowsCopy</span> (number <span>startrow</span>, number <span>endrow</span>,<br> DWBuffer <span>copybuffer</span>, datawindowchild <span>targetdw</span>, number <span>beforerow</span>,<br> number <span>targetbuffer</span> ) |
Argument |
Description |
---|---|
dwcontrol |
The name of the DataWindow control, DataStore, |
startrow |
The number of the first row you want |
endrow |
The number of the last row you want to |
copybuffer |
A value of the dwBuffer enumerated datatype For a list of valid values, see DWBuffer. |
targetdw |
A reference to the DataWindow control |
beforerow |
The number of the row before which you |
targetbuffer |
A value of the dwBuffer enumerated datatype 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
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:
1 |
dw_1.<span>RowsCopy</span>(dw_1.GetRow(), &<br> dw_1.RowCount(), Primary!, dw_2, 1, Primary!) |
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:
1 |
datawindowchild dwc |
1 |
dw_3.GetChild("state_id", dwc) |
1 |
dw_1.<span>RowsCopy</span>(dw_1.GetRow(), &<br> dw_1.RowCount(), Primary!, dwc, 1, Primary!) |
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:
1 |
datawindowchild dwc |
1 |
dw_composite.GetChild("d_employee", dwc) |
1 |
dw_1.<span>RowsCopy</span>(dw_1.GetRow(), &<br> dw_1.RowCount(), Primary!, dwc, 1, Primary!) |