ImportClipboard method (DataWindows)
Description
Inserts data into a DataWindow control or DataStore object
from tab-separated, comma-separated, or XML data on the clipboard.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
1 |
long <span>dwcontrol</span>.<span>ImportClipboard</span> ( {saveastype <span>importtype</span>}, { long <span>startrow </span>{, long <span>endrow</span> {, long <span>startcolumn</span> {, long <span>endcolumn </span>{, long <span>dwstartcolumn</span> } } } } } ) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>ImportClipboard</span> ( number <span>importtype</span>, number <span>startrow</span>, number <span>endrow</span>, number <span>startcolumn, </span>number <span>endcolumn</span>, number <span>dwstartcolumn</span>) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, |
importtype |
An enumerated value of the SaveAsType
If you want to generate an XML trace file, the XML! argument |
startrow |
The number of the first detail row in For default XML import, if startrow is For template XML import, if startrow is |
endrow |
The number of the last detail row in For default XML import, if endrow is For template XML import, if endrow is |
startcolumn (optional |
The number of the first column in the For default XML import, if startcolumn is This argument has no effect on template XML import. |
endcolumn (optional |
The number of the last column in the For default XML import, if endcolumn is This argument has no effect on template XML import. |
dwstartcolumn (optional |
The number of the first column in the |
Return Values
Returns the number of rows that were imported if it succeeds
and one of the following negative integers if an error occurs:
-
-1
No rows or startrow value supplied is
greater than the number of rows in the string -
-3
Invalid argument
-
-4
Invalid input
-
-11
XML Parsing Error; XML parser libraries not found or XML not well
formed -
-12
XML Template does not exist or does not match the DataWindow
-
-13
Unsupported DataWindow style for import
-
-14
Error resolving DataWindow nesting
Usage
The clipboard data must be formatted in tab-separated or comma-separated
columns or in XML. The datatypes and order of the DataWindow object’s
columns must match the data on the clipboard.
If an XML or CSV column contains a leading double quote, it
is assumed to be part of the column value. A leading double quote
has to be closed to mark the end of an item.
All the arguments of this function are optional. You do not
need to specify the importtype argument. The startcolumn and endcolumn arguments control
the number of imported columns and the number of columns in the DataWindow
that are affected. The dwstartcolumn argument
specifies the first DataWindow column to be affected. The following
formula calculates the last column to be affected.
1 |
<span>dwstartcolumn</span> + (<span>endcolumn</span> - <span>startcolumn</span>) |
ImportClipboard does not support Crosstab
DataWindow objects.
Examples
This statement copies all data in the clipboard to
the DataWindow dw_employee starting at the first column:
1 |
dw_employee.<span>ImportClipboard</span>() |
This statement copies all data in the clipboard to
the DataWindow dw_employee starting at the first column
and specifies that the data is in XML format:
1 |
dw_employee.<span>ImportClipboard</span>(XML!) |
This statement imports rows 1 to 200 of the XML data
on the clipboard, ignoring any template mappings
before column 5:
1 |
dw_employee.<span>ImportClipboard</span>(XML!, 1, 200, 0, 0, 5) |
This statement inserts data from the clipboard into
the DataWindow dw_employee. It copies rows 2 through 30
and columns 3 through 8 on the clipboard to the DataWindow beginning
in column 5. It adds 29 rows to the DataWindow with data in columns
5 through 10:
1 |
dw_employee.<span>ImportClipboard</span>(2,30,3,8,5) |