Syntax 4
Description
Exports all data or the specified rows and/or columns from the
specified buffer to a simple-format or standard-format JSON
string.
Applies to
|
DataWindow type |
Method applies to |
|---|---|
|
PowerBuilder |
DataWindow control, DataWindowChild object, and |
Syntax
PowerBuilder
|
1 |
string dwcontrol.ExportJson( DWBuffer dwbuffer {, long startrow {, long endrow {, long startcolumn {, long endcolumn } } } } {, boolean format } ) |
|
Argument |
Description |
|---|---|
|
dwcontrol |
A reference to a DataWindow control, DataStore, or |
|
dwbuffer |
A value of the dwBuffer enumerated datatype If |
|
startrow (optional) |
The number of the first detail row in the buffer |
|
endrow (optional) |
The number of the last detail row in the buffer |
|
startcolumn (optional) |
The number of the first column in the buffer that |
|
endcolumn (optional) |
The number of the last column in the buffer that |
|
format (optional) |
A boolean specifying the JSON
See JSON |
Return value
String. Returns the JSON string if it succeeds. Returns the empty
string (“”) if an error occurs.
The method returns null if any of the following:
-
any argument’s value is null
-
the DataWindow object (dataobject) is invalid
-
the DataWindow presentation style is unsupported, such as
Composite, Crosstab, OLE 2.0, or RichText
Examples
This example exports data from the delete buffer of the DataWindow
to a simple-format JSON string:
|
1 2 |
string ls_SimpleJson ls_SimpleJson = dw_1.ExportJson(Delete!) |
This example exports data from the filter buffer of the DataWindow
to a standard-format JSON string:
|
1 2 |
string ls_StandardJson ls_StandardJson = dw_1.ExportJson(Filter!, true) |
This example exports data in rows 2 through the end from the
primary buffer of the DataWindow to a simple-format JSON string:
|
1 2 |
string ls_SimpleJson ls_SimpleJson = dw_1.ExportJson(Primary!, 2) |
This example exports data in rows 2 through the end from the
primary buffer of the DataWindow to a standard-format JSON
string:
|
1 2 |
string ls_StandardJson ls_StandardJson = dw_1.ExportJson(Primary!, 2, true) |
This example exports data in rows 1 through 10 from the primary
buffer of the DataWindow to a simple-format JSON string:
|
1 2 |
string ls_SimpleJson ls_SimpleJson = dw_1.ExportJson(Primary!, 1, 10) |
This example exports data in rows 1 through 10 from the primary
buffer of the DataWindow to a standard-format JSON string:
|
1 2 |
string ls_StandardJson ls_StandardJson = dw_1.ExportJson(Primary!, 1, 10, true) |
This example exports data in rows 1 through 10 and columns 2
through the end from the primary buffer of the DataWindow to a
simple-format JSON string:
|
1 2 |
string ls_SimpleJson ls_SimpleJson = dw_1.ExportJson(Primary!, 1, 10, 2) |
This example exports data in rows 1 through 10 and columns 2
through the end from the primary buffer of the DataWindow to a
standard-format JSON string:
|
1 2 |
string ls_StandardJson ls_StandardJson = dw_1.ExportJson(Primary!, 1, 10, 2, true) |
This example exports data in rows 1 through 10 and columns 2
through 5 from the primary buffer of the DataWindow to a simple-format
JSON string:
|
1 2 |
string ls_SimpleJson ls_SimpleJson = dw_1.ExportJson(Primary!, 1, 10, 2, 5) |
This example exports data in rows 1 through 10 and columns 2
through 5 from the primary buffer of the DataWindow to a standard-format
JSON string:
|
1 2 |
string ls_StandardJson ls_StandardJson = dw_1.ExportJson(Primary!, 1, 10, 2, 5, true) |
See also