Child pages
  • JSDataSet

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
{hidden} DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden} {sub-section:description|text=}{sub-section}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[Number]{td}{td}[#rowIndex] Get or set the record index of the dataset.{td}{tr}{tbody}{table}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#addColumn]\(name, index, type) adds a column with the specified name to the dataset.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addHTMLProperty]\(row, col, name, value) Add an HTML property to an HTML tag produced in getAsHTML().{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addRow]\(index, array) Add a row to the dataset.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#createDataSource]\(name, types) Create a data source from the data set with specified name and using specified types.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getAsHTML]\(escape_values, escape_spaces, multi_line_markup, pretty_indent, add_column_names) Get the dataset as an html table.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getAsText]\(column_separator, row_separator, value_delimiter, add_column_names) Get the dataset as formatted text.{td}{tr}{tbody}{tbody}{tr}{td}Object[]{td}{td}[#getColumnAsArray]\(index) Get the column data of a dataset as an Array.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getColumnName]\(index) Get a column name based on index.{td}{tr}{tbody}{tbody}{tr}{td}[ServoyException]{td}{td}[#getException]\() Get the database exception if an error occurred.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getMaxColumnIndex]\() Get the number of columns in the dataset.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getMaxRowIndex]\() Get the number of rows in the dataset.{td}{tr}{tbody}{tbody}{tr}{td}Object[]{td}{td}[#getRowAsArray]\(index) Get the row data of a dataset as an Array.{td}{tr}{tbody}{tbody}{tr}{td}Object{td}{td}[#getValue]\(row, col) Get the value specified by row and column position from the dataset.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#hadMoreData]\() Return true if there is more data in the resultset then specified by maxReturnedRows at query time.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#removeColumn]\(index) Remove a column by index from the dataset.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#removeRow]\(row) Remove a row from the dataset.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setValue]\(row, col, obj) Set the value specified by row and column position from the dataset.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#sort]\(col, sort_direction) Sort the dataset on the given column in ascending or descending.{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=2280DB03-EA69-48AA-AC67-BEB544D2F4BF}{tr:id=name}{td}h6.rowIndex{td}{tr}{tr:id=des}{td}{sub-section:2280DB03-EA69-48AA-AC67-BEB544D2F4BF_des|text=|trigger=button}{sub-section}{sub-section:2280DB03-EA69-48AA-AC67-BEB544D2F4BF_des|trigger=none|class=sIndent}Get or set the record index of the dataset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:2280DB03-EA69-48AA-AC67-BEB544D2F4BF_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:2280DB03-EA69-48AA-AC67-BEB544D2F4BF_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:2280DB03-EA69-48AA-AC67-BEB544D2F4BF_ret|text=|trigger=button}{sub-section}{sub-section:2280DB03-EA69-48AA-AC67-BEB544D2F4BF_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:2280DB03-EA69-48AA-AC67-BEB544D2F4BF_see|text=|trigger=button}{sub-section}{sub-section:2280DB03-EA69-48AA-AC67-BEB544D2F4BF_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:2280DB03-EA69-48AA-AC67-BEB544D2F4BF_see|text=|trigger=button}{sub-section}{sub-section:2280DB03-EA69-48AA-AC67-BEB544D2F4BF_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:2280DB03-EA69-48AA-AC67-BEB544D2F4BF_sam|text=|trigger=button}{sub-section}{sub-section:2280DB03-EA69-48AA-AC67-BEB544D2F4BF_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset //to set the rowIndex: dataset.rowIndex = 1 //sets the rowIndex to the first row (dataset is 1-based) //to retrieve the rowIndex of the currently selected row var currRow = dataset.rowIndex {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=64E0C217-D93A-485C-9F04-0065FA749F00}{tr:id=name}{td}h6.addColumn{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}addColumn{span}{span:id=iets|style=float: left;}\(name, index, type){span}{td}{tr}{tr:id=des}{td}{sub-section:64E0C217-D93A-485C-9F04-0065FA749F00_des|text=|trigger=button}{sub-section}{sub-section:64E0C217-D93A-485C-9F04-0065FA749F00_des|trigger=none|class=sIndent}adds a column with the specified name to the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:64E0C217-D93A-485C-9F04-0065FA749F00_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:64E0C217-D93A-485C-9F04-0065FA749F00_prs|trigger=none}name -- column name. \[index\] -- column index number between 1 and getMaxColumnIndex(). \[type\] -- the type of column, see JSColumn constants. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:64E0C217-D93A-485C-9F04-0065FA749F00_ret|text=|trigger=button}{sub-section}{sub-section:64E0C217-D93A-485C-9F04-0065FA749F00_ret|trigger=none|class=sIndent}[Boolean] -- true if succeeded, else false.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:64E0C217-D93A-485C-9F04-0065FA749F00_see|text=|trigger=button}{sub-section}{sub-section:64E0C217-D93A-485C-9F04-0065FA749F00_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:64E0C217-D93A-485C-9F04-0065FA749F00_see|text=|trigger=button}{sub-section}{sub-section:64E0C217-D93A-485C-9F04-0065FA749F00_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:64E0C217-D93A-485C-9F04-0065FA749F00_sam|text=|trigger=button}{sub-section}{sub-section:64E0C217-D93A-485C-9F04-0065FA749F00_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset var success = dataset.addColumn('columnName',1); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=764B5063-A59F-4E87-9F99-2A737076AE7E}{tr:id=name}{td}h6.addHTMLProperty{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addHTMLProperty{span}{span:id=iets|style=float: left;}\(row, col, name, value){span}{td}{tr}{tr:id=des}{td}{sub-section:764B5063-A59F-4E87-9F99-2A737076AE7E_des|text=|trigger=button}{sub-section}{sub-section:764B5063-A59F-4E87-9F99-2A737076AE7E_des|trigger=none|class=sIndent}Add an HTML property to an HTML tag produced in getAsHTML(). For row and col parameters use: 1 = applies to the container 0 = applies to all >0 = applies to specific cell{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:764B5063-A59F-4E87-9F99-2A737076AE7E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:764B5063-A59F-4E87-9F99-2A737076AE7E_prs|trigger=none}row -- row number col -- column number name -- String property name value -- String property value {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:764B5063-A59F-4E87-9F99-2A737076AE7E_ret|text=|trigger=button}{sub-section}{sub-section:764B5063-A59F-4E87-9F99-2A737076AE7E_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:764B5063-A59F-4E87-9F99-2A737076AE7E_see|text=|trigger=button}{sub-section}{sub-section:764B5063-A59F-4E87-9F99-2A737076AE7E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:764B5063-A59F-4E87-9F99-2A737076AE7E_see|text=|trigger=button}{sub-section}{sub-section:764B5063-A59F-4E87-9F99-2A737076AE7E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:764B5063-A59F-4E87-9F99-2A737076AE7E_sam|text=|trigger=button}{sub-section}{sub-section:764B5063-A59F-4E87-9F99-2A737076AE7E_sam|class=sIndent|trigger=none}{code:language=javascript} //adds a container property (to TABLE tag) dataset.addHTMLProperty(-1,-1,'cellspacing','3'); //adds a row property to all rows (to TR tag) dataset.addHTMLProperty(0,0,'class','text'); //adds a row property to second row (to TR tag) dataset.addHTMLProperty(2,0,'class','text'); //adds a column property to all 3rd columns (to TD tag) dataset.addHTMLProperty(0,3,'class','redcolumn') ; //adds a specific cell property (to TD tag) dataset.addHTMLProperty(2,4,'color','blue'); globals.html_field = '<html>'+dataset.getAsHTML()+'</html>'; {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=1C076557-2764-4A46-85C1-41EA45E840FF}{tr:id=name}{td}h6.addRow{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addRow{span}{span:id=iets|style=float: left;}\(index, array){span}{td}{tr}{tr:id=des}{td}{sub-section:1C076557-2764-4A46-85C1-41EA45E840FF_des|text=|trigger=button}{sub-section}{sub-section:1C076557-2764-4A46-85C1-41EA45E840FF_des|trigger=none|class=sIndent}Add a row to the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:1C076557-2764-4A46-85C1-41EA45E840FF_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1C076557-2764-4A46-85C1-41EA45E840FF_prs|trigger=none}\[index\] -- index to add row (1-based), add by default as last row array -- row data {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:1C076557-2764-4A46-85C1-41EA45E840FF_ret|text=|trigger=button}{sub-section}{sub-section:1C076557-2764-4A46-85C1-41EA45E840FF_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1C076557-2764-4A46-85C1-41EA45E840FF_see|text=|trigger=button}{sub-section}{sub-section:1C076557-2764-4A46-85C1-41EA45E840FF_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1C076557-2764-4A46-85C1-41EA45E840FF_see|text=|trigger=button}{sub-section}{sub-section:1C076557-2764-4A46-85C1-41EA45E840FF_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1C076557-2764-4A46-85C1-41EA45E840FF_sam|text=|trigger=button}{sub-section}{sub-section:1C076557-2764-4A46-85C1-41EA45E840FF_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset dataset.addRow(new Array(1,2,3,4,5,6,7,7)); //adds a row with 8 columns dataset.addRow(2, new Array(1,2,3,4,5,6,7,7)); //adds a row with 8 columns after row 2 {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=89E8D08A-C0A6-4855-9FE7-6A37F96822CD}{tr:id=name}{td}h6.createDataSource{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}createDataSource{span}{span:id=iets|style=float: left;}\(name, types){span}{td}{tr}{tr:id=des}{td}{sub-section:89E8D08A-C0A6-4855-9FE7-6A37F96822CD_des|text=|trigger=button}{sub-section}{sub-section:89E8D08A-C0A6-4855-9FE7-6A37F96822CD_des|trigger=none|class=sIndent}Create a data source from the data set with specified name and using specified types.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:89E8D08A-C0A6-4855-9FE7-6A37F96822CD_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:89E8D08A-C0A6-4855-9FE7-6A37F96822CD_prs|trigger=none}name -- data source name \[types\] -- array of types as defined in JSColumn, when null or not supplied types are inferred from the data if possible. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:89E8D08A-C0A6-4855-9FE7-6A37F96822CD_ret|text=|trigger=button}{sub-section}{sub-section:89E8D08A-C0A6-4855-9FE7-6A37F96822CD_ret|trigger=none|class=sIndent}[String] -- String uri reference to the created data source.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:89E8D08A-C0A6-4855-9FE7-6A37F96822CD_see|text=|trigger=button}{sub-section}{sub-section:89E8D08A-C0A6-4855-9FE7-6A37F96822CD_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:89E8D08A-C0A6-4855-9FE7-6A37F96822CD_see|text=|trigger=button}{sub-section}{sub-section:89E8D08A-C0A6-4855-9FE7-6A37F96822CD_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:89E8D08A-C0A6-4855-9FE7-6A37F96822CD_sam|text=|trigger=button}{sub-section}{sub-section:89E8D08A-C0A6-4855-9FE7-6A37F96822CD_sam|class=sIndent|trigger=none}{code:language=javascript} ds.addColumn('my_id'); ds.addColumn('my_label'); var uri = ds.createDataSource('mydata', [JSColumn.INTEGER, JSColumn.TEXT]); var jsform = solutionModel.newForm(fname, uri, null, true, 300, 300); var query = 'select customerid, address, city, country from customers'; var ds2 = databaseManager.getDataSetByQuery('example_data', query, null, 999); var uri2 = ds2.createDataSource('mydata2'); // types are inferred from query result {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=6C68E0AA-F0A8-449B-9E2E-09434DB24CD9}{tr:id=name}{td}h6.getAsHTML{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getAsHTML{span}{span:id=iets|style=float: left;}\(escape_values, escape_spaces, multi_line_markup, pretty_indent, add_column_names){span}{td}{tr}{tr:id=des}{td}{sub-section:6C68E0AA-F0A8-449B-9E2E-09434DB24CD9_des|text=|trigger=button}{sub-section}{sub-section:6C68E0AA-F0A8-449B-9E2E-09434DB24CD9_des|trigger=none|class=sIndent}Get the dataset as an html table.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:6C68E0AA-F0A8-449B-9E2E-09434DB24CD9_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6C68E0AA-F0A8-449B-9E2E-09434DB24CD9_prs|trigger=none}\[escape_values\] -- if true, replaces illegal HTML characters with corresponding valid escape sequences. \[escape_spaces\] -- if true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags. \[multi_line_markup\] -- if true, multiLineMarkup will enforce new lines that are in the text; single new lines will be replaced by <br>, multiple new lines will be replaced by <p> \[pretty_indent\] -- if true, adds indentation for more readable HTML code. \[add_column_names\] -- if false, column headers will not be added to the table. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:6C68E0AA-F0A8-449B-9E2E-09434DB24CD9_ret|text=|trigger=button}{sub-section}{sub-section:6C68E0AA-F0A8-449B-9E2E-09434DB24CD9_ret|trigger=none|class=sIndent}[String] -- String html.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6C68E0AA-F0A8-449B-9E2E-09434DB24CD9_see|text=|trigger=button}{sub-section}{sub-section:6C68E0AA-F0A8-449B-9E2E-09434DB24CD9_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6C68E0AA-F0A8-449B-9E2E-09434DB24CD9_see|text=|trigger=button}{sub-section}{sub-section:6C68E0AA-F0A8-449B-9E2E-09434DB24CD9_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6C68E0AA-F0A8-449B-9E2E-09434DB24CD9_sam|text=|trigger=button}{sub-section}{sub-section:6C68E0AA-F0A8-449B-9E2E-09434DB24CD9_sam|class=sIndent|trigger=none}{code:language=javascript} //gets a dataset based on a query //useful to limit the number of rows var maxReturnedRows = 10; var query = 'select c1,c2,c3 from test_table where start_date = ?'; //to access data by name, do not use '.' or special characters in names or aliases var args = new Array(); args[0] = order_date //or new Date(); var dataset = databaseManager.getDataSetByQuery(controller.getServerName(),query,args,maxReturnedRows); // gets a dataset with escape values; escape spaces (lines will not wrap); no multi-line markup; with pretty indentation; shows column names var htmlTable = dataset.getAsHTML(true, true, false, true, true); //assigns the dataset to a field and sets the display type to HTML_AREA //assuming the html_field is a global text variable globals.html_field = '<html>'+dataset.getAsHTML()+'</html>'; //Note: To display an HTML_AREA field as an HTML page, add HTML tags at the beginning '<html>' and at the end '</html>'. {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D61E57FF-FB30-4436-AB63-81DBC4ECF9C7}{tr:id=name}{td}h6.getAsText{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getAsText{span}{span:id=iets|style=float: left;}\(column_separator, row_separator, value_delimiter, add_column_names){span}{td}{tr}{tr:id=des}{td}{sub-section:D61E57FF-FB30-4436-AB63-81DBC4ECF9C7_des|text=|trigger=button}{sub-section}{sub-section:D61E57FF-FB30-4436-AB63-81DBC4ECF9C7_des|trigger=none|class=sIndent}Get the dataset as formatted text.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:D61E57FF-FB30-4436-AB63-81DBC4ECF9C7_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D61E57FF-FB30-4436-AB63-81DBC4ECF9C7_prs|trigger=none}column_separator -- any specified column separator; examples: tab '\t'; comma ','; semicolon ';'; space ' ' . row_separator -- the specified row separator; examples: new line '\n'. value_delimiter -- the specified value delimiter; example: double quote '"'. add_column_names -- boolean if true column names will be added as a first row. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:D61E57FF-FB30-4436-AB63-81DBC4ECF9C7_ret|text=|trigger=button}{sub-section}{sub-section:D61E57FF-FB30-4436-AB63-81DBC4ECF9C7_ret|trigger=none|class=sIndent}[String] -- String formatted text.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D61E57FF-FB30-4436-AB63-81DBC4ECF9C7_see|text=|trigger=button}{sub-section}{sub-section:D61E57FF-FB30-4436-AB63-81DBC4ECF9C7_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D61E57FF-FB30-4436-AB63-81DBC4ECF9C7_see|text=|trigger=button}{sub-section}{sub-section:D61E57FF-FB30-4436-AB63-81DBC4ECF9C7_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D61E57FF-FB30-4436-AB63-81DBC4ECF9C7_sam|text=|trigger=button}{sub-section}{sub-section:D61E57FF-FB30-4436-AB63-81DBC4ECF9C7_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset //you can create csv or tab delimited results var csv = dataset.getAsText(',','\n','"',true) var tab = dataset.getAsText('\t','\n','"',true) {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=A895C87B-F94A-4307-A7B8-79A79212CC18}{tr:id=name}{td}h6.getColumnAsArray{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object[]{span}{span:id=iets|style=float: left; font-weight: bold;}getColumnAsArray{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:A895C87B-F94A-4307-A7B8-79A79212CC18_des|text=|trigger=button}{sub-section}{sub-section:A895C87B-F94A-4307-A7B8-79A79212CC18_des|trigger=none|class=sIndent}Get the column data of a dataset as an Array.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:A895C87B-F94A-4307-A7B8-79A79212CC18_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A895C87B-F94A-4307-A7B8-79A79212CC18_prs|trigger=none}index -- index of column (1-based). {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:A895C87B-F94A-4307-A7B8-79A79212CC18_ret|text=|trigger=button}{sub-section}{sub-section:A895C87B-F94A-4307-A7B8-79A79212CC18_ret|trigger=none|class=sIndent}Object[] -- Object array of data.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A895C87B-F94A-4307-A7B8-79A79212CC18_see|text=|trigger=button}{sub-section}{sub-section:A895C87B-F94A-4307-A7B8-79A79212CC18_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A895C87B-F94A-4307-A7B8-79A79212CC18_see|text=|trigger=button}{sub-section}{sub-section:A895C87B-F94A-4307-A7B8-79A79212CC18_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A895C87B-F94A-4307-A7B8-79A79212CC18_sam|text=|trigger=button}{sub-section}{sub-section:A895C87B-F94A-4307-A7B8-79A79212CC18_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset var dataArray = dataset.getColumnAsArray(1); //puts the contents from the first column of the dataset into an array //once you have it as an array you can loop through it or feed it to a custom valuelist for example {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=45EE5637-AA1B-404A-A08B-0F03A6C12C0E}{tr:id=name}{td}h6.getColumnName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getColumnName{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:45EE5637-AA1B-404A-A08B-0F03A6C12C0E_des|text=|trigger=button}{sub-section}{sub-section:45EE5637-AA1B-404A-A08B-0F03A6C12C0E_des|trigger=none|class=sIndent}Get a column name based on index.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:45EE5637-AA1B-404A-A08B-0F03A6C12C0E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:45EE5637-AA1B-404A-A08B-0F03A6C12C0E_prs|trigger=none}index -- index of column (1-based). {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:45EE5637-AA1B-404A-A08B-0F03A6C12C0E_ret|text=|trigger=button}{sub-section}{sub-section:45EE5637-AA1B-404A-A08B-0F03A6C12C0E_ret|trigger=none|class=sIndent}[String] -- String column name.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:45EE5637-AA1B-404A-A08B-0F03A6C12C0E_see|text=|trigger=button}{sub-section}{sub-section:45EE5637-AA1B-404A-A08B-0F03A6C12C0E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:45EE5637-AA1B-404A-A08B-0F03A6C12C0E_see|text=|trigger=button}{sub-section}{sub-section:45EE5637-AA1B-404A-A08B-0F03A6C12C0E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:45EE5637-AA1B-404A-A08B-0F03A6C12C0E_sam|text=|trigger=button}{sub-section}{sub-section:45EE5637-AA1B-404A-A08B-0F03A6C12C0E_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset var firstColumName = dataset.getColumnName(1) //retrieves the first columnname into the variable firstColumName //using a loop you can get all columnames in an array: var query = 'select * from customers'; var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 100); var colArray = new Array() for (var i = 1; i <= dataset.getMaxColumnIndex(); i++) { colArray[i-1] = dataset.getColumnName(i) //note the -1, because an array is zero based and dataset is 1 based. } {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=17626CAC-DD15-4925-A164-2D00A7661579}{tr:id=name}{td}h6.getException{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[ServoyException]{span}{span:id=iets|style=float: left; font-weight: bold;}getException{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:17626CAC-DD15-4925-A164-2D00A7661579_des|text=|trigger=button}{sub-section}{sub-section:17626CAC-DD15-4925-A164-2D00A7661579_des|trigger=none|class=sIndent}Get the database exception if an error occurred.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:17626CAC-DD15-4925-A164-2D00A7661579_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:17626CAC-DD15-4925-A164-2D00A7661579_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:17626CAC-DD15-4925-A164-2D00A7661579_ret|text=|trigger=button}{sub-section}{sub-section:17626CAC-DD15-4925-A164-2D00A7661579_ret|trigger=none|class=sIndent}[ServoyException] -- ServoyException exception or null when not available.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:17626CAC-DD15-4925-A164-2D00A7661579_see|text=|trigger=button}{sub-section}{sub-section:17626CAC-DD15-4925-A164-2D00A7661579_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:17626CAC-DD15-4925-A164-2D00A7661579_see|text=|trigger=button}{sub-section}{sub-section:17626CAC-DD15-4925-A164-2D00A7661579_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:17626CAC-DD15-4925-A164-2D00A7661579_sam|text=|trigger=button}{sub-section}{sub-section:17626CAC-DD15-4925-A164-2D00A7661579_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset var dbException = dataset.getException(); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=102C6B8F-FBB5-4692-A222-E426C2A0ECF9}{tr:id=name}{td}h6.getMaxColumnIndex{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getMaxColumnIndex{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:102C6B8F-FBB5-4692-A222-E426C2A0ECF9_des|text=|trigger=button}{sub-section}{sub-section:102C6B8F-FBB5-4692-A222-E426C2A0ECF9_des|trigger=none|class=sIndent}Get the number of columns in the dataset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:102C6B8F-FBB5-4692-A222-E426C2A0ECF9_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:102C6B8F-FBB5-4692-A222-E426C2A0ECF9_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:102C6B8F-FBB5-4692-A222-E426C2A0ECF9_ret|text=|trigger=button}{sub-section}{sub-section:102C6B8F-FBB5-4692-A222-E426C2A0ECF9_ret|trigger=none|class=sIndent}[Number] -- int number of columns.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:102C6B8F-FBB5-4692-A222-E426C2A0ECF9_see|text=|trigger=button}{sub-section}{sub-section:102C6B8F-FBB5-4692-A222-E426C2A0ECF9_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:102C6B8F-FBB5-4692-A222-E426C2A0ECF9_see|text=|trigger=button}{sub-section}{sub-section:102C6B8F-FBB5-4692-A222-E426C2A0ECF9_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:102C6B8F-FBB5-4692-A222-E426C2A0ECF9_sam|text=|trigger=button}{sub-section}{sub-section:102C6B8F-FBB5-4692-A222-E426C2A0ECF9_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset for (var i = 1; i <= dataset.getMaxColumnIndex(); i++) { colArray[i-1] = dataset.getColumnName(i) //have to subtract 1, because an array is zero based and a dataset is 1 based. } {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0D2DDC0D-ABF3-4268-B2D3-D21D9A61380D}{tr:id=name}{td}h6.getMaxRowIndex{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getMaxRowIndex{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:0D2DDC0D-ABF3-4268-B2D3-D21D9A61380D_des|text=|trigger=button}{sub-section}{sub-section:0D2DDC0D-ABF3-4268-B2D3-D21D9A61380D_des|trigger=none|class=sIndent}Get the number of rows in the dataset.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:0D2DDC0D-ABF3-4268-B2D3-D21D9A61380D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0D2DDC0D-ABF3-4268-B2D3-D21D9A61380D_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:0D2DDC0D-ABF3-4268-B2D3-D21D9A61380D_ret|text=|trigger=button}{sub-section}{sub-section:0D2DDC0D-ABF3-4268-B2D3-D21D9A61380D_ret|trigger=none|class=sIndent}[Number] -- int number of rows.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0D2DDC0D-ABF3-4268-B2D3-D21D9A61380D_see|text=|trigger=button}{sub-section}{sub-section:0D2DDC0D-ABF3-4268-B2D3-D21D9A61380D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0D2DDC0D-ABF3-4268-B2D3-D21D9A61380D_see|text=|trigger=button}{sub-section}{sub-section:0D2DDC0D-ABF3-4268-B2D3-D21D9A61380D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0D2DDC0D-ABF3-4268-B2D3-D21D9A61380D_sam|text=|trigger=button}{sub-section}{sub-section:0D2DDC0D-ABF3-4268-B2D3-D21D9A61380D_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset var totalRows = dataset.getMaxRowIndex(); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=C64C73ED-FEA3-4F9E-88DD-3C7FBDB38D42}{tr:id=name}{td}h6.getRowAsArray{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object[]{span}{span:id=iets|style=float: left; font-weight: bold;}getRowAsArray{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:C64C73ED-FEA3-4F9E-88DD-3C7FBDB38D42_des|text=|trigger=button}{sub-section}{sub-section:C64C73ED-FEA3-4F9E-88DD-3C7FBDB38D42_des|trigger=none|class=sIndent}Get the row data of a dataset as an Array.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:C64C73ED-FEA3-4F9E-88DD-3C7FBDB38D42_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:C64C73ED-FEA3-4F9E-88DD-3C7FBDB38D42_prs|trigger=none}index -- index of row (1-based). {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:C64C73ED-FEA3-4F9E-88DD-3C7FBDB38D42_ret|text=|trigger=button}{sub-section}{sub-section:C64C73ED-FEA3-4F9E-88DD-3C7FBDB38D42_ret|trigger=none|class=sIndent}Object[] -- Object array of data.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:C64C73ED-FEA3-4F9E-88DD-3C7FBDB38D42_see|text=|trigger=button}{sub-section}{sub-section:C64C73ED-FEA3-4F9E-88DD-3C7FBDB38D42_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:C64C73ED-FEA3-4F9E-88DD-3C7FBDB38D42_see|text=|trigger=button}{sub-section}{sub-section:C64C73ED-FEA3-4F9E-88DD-3C7FBDB38D42_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:C64C73ED-FEA3-4F9E-88DD-3C7FBDB38D42_sam|text=|trigger=button}{sub-section}{sub-section:C64C73ED-FEA3-4F9E-88DD-3C7FBDB38D42_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset var dataArray = dataset.getRowAsArray(1); //puts the contents from the first row of the dataset into an array //once you have it as an array you can loop through it {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=A4DC930D-1ECA-4450-852E-CC60FEAE8DCD}{tr:id=name}{td}h6.getValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object{span}{span:id=iets|style=float: left; font-weight: bold;}getValue{span}{span:id=iets|style=float: left;}\(row, col){span}{td}{tr}{tr:id=des}{td}{sub-section:A4DC930D-1ECA-4450-852E-CC60FEAE8DCD_des|text=|trigger=button}{sub-section}{sub-section:A4DC930D-1ECA-4450-852E-CC60FEAE8DCD_des|trigger=none|class=sIndent}Get the value specified by row and column position from the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:A4DC930D-1ECA-4450-852E-CC60FEAE8DCD_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A4DC930D-1ECA-4450-852E-CC60FEAE8DCD_prs|trigger=none}row -- row number, 1-based col -- column number, 1-based {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:A4DC930D-1ECA-4450-852E-CC60FEAE8DCD_ret|text=|trigger=button}{sub-section}{sub-section:A4DC930D-1ECA-4450-852E-CC60FEAE8DCD_ret|trigger=none|class=sIndent}Object -- Object value{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A4DC930D-1ECA-4450-852E-CC60FEAE8DCD_see|text=|trigger=button}{sub-section}{sub-section:A4DC930D-1ECA-4450-852E-CC60FEAE8DCD_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A4DC930D-1ECA-4450-852E-CC60FEAE8DCD_see|text=|trigger=button}{sub-section}{sub-section:A4DC930D-1ECA-4450-852E-CC60FEAE8DCD_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A4DC930D-1ECA-4450-852E-CC60FEAE8DCD_sam|text=|trigger=button}{sub-section}{sub-section:A4DC930D-1ECA-4450-852E-CC60FEAE8DCD_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset var dataAtRow2Col1 = dataset.getValue(2, 1); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=373F9B77-7344-4A90-B820-A67AED415CE9}{tr:id=name}{td}h6.hadMoreData{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}hadMoreData{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:373F9B77-7344-4A90-B820-A67AED415CE9_des|text=|trigger=button}{sub-section}{sub-section:373F9B77-7344-4A90-B820-A67AED415CE9_des|trigger=none|class=sIndent}Return true if there is more data in the resultset then specified by maxReturnedRows at query time.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:373F9B77-7344-4A90-B820-A67AED415CE9_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:373F9B77-7344-4A90-B820-A67AED415CE9_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:373F9B77-7344-4A90-B820-A67AED415CE9_ret|text=|trigger=button}{sub-section}{sub-section:373F9B77-7344-4A90-B820-A67AED415CE9_ret|trigger=none|class=sIndent}[Boolean] -- boolean more data available{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:373F9B77-7344-4A90-B820-A67AED415CE9_see|text=|trigger=button}{sub-section}{sub-section:373F9B77-7344-4A90-B820-A67AED415CE9_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:373F9B77-7344-4A90-B820-A67AED415CE9_see|text=|trigger=button}{sub-section}{sub-section:373F9B77-7344-4A90-B820-A67AED415CE9_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:373F9B77-7344-4A90-B820-A67AED415CE9_sam|text=|trigger=button}{sub-section}{sub-section:373F9B77-7344-4A90-B820-A67AED415CE9_sam|class=sIndent|trigger=none}{code:language=javascript} var ds = databaseManager.getDataSetByQuery('example_data', 'select order_id from orders', null, 10000) if (ds.hadMoreData()) { // handle large result } {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=1EDA782D-D280-4DC5-96A3-BDC81133C875}{tr:id=name}{td}h6.removeColumn{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}removeColumn{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:1EDA782D-D280-4DC5-96A3-BDC81133C875_des|text=|trigger=button}{sub-section}{sub-section:1EDA782D-D280-4DC5-96A3-BDC81133C875_des|trigger=none|class=sIndent}Remove a column by index from the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:1EDA782D-D280-4DC5-96A3-BDC81133C875_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1EDA782D-D280-4DC5-96A3-BDC81133C875_prs|trigger=none}index -- index of column to remove (1-based) {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:1EDA782D-D280-4DC5-96A3-BDC81133C875_ret|text=|trigger=button}{sub-section}{sub-section:1EDA782D-D280-4DC5-96A3-BDC81133C875_ret|trigger=none|class=sIndent}[Boolean] -- true if succeeded, else false.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1EDA782D-D280-4DC5-96A3-BDC81133C875_see|text=|trigger=button}{sub-section}{sub-section:1EDA782D-D280-4DC5-96A3-BDC81133C875_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1EDA782D-D280-4DC5-96A3-BDC81133C875_see|text=|trigger=button}{sub-section}{sub-section:1EDA782D-D280-4DC5-96A3-BDC81133C875_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1EDA782D-D280-4DC5-96A3-BDC81133C875_sam|text=|trigger=button}{sub-section}{sub-section:1EDA782D-D280-4DC5-96A3-BDC81133C875_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset var success = dataset.removeColumn(1); // removes first column {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=7435BA85-F43C-4CC7-8FCC-AF7254060B12}{tr:id=name}{td}h6.removeRow{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}removeRow{span}{span:id=iets|style=float: left;}\(row){span}{td}{tr}{tr:id=des}{td}{sub-section:7435BA85-F43C-4CC7-8FCC-AF7254060B12_des|text=|trigger=button}{sub-section}{sub-section:7435BA85-F43C-4CC7-8FCC-AF7254060B12_des|trigger=none|class=sIndent}Remove a row from the dataset.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:7435BA85-F43C-4CC7-8FCC-AF7254060B12_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:7435BA85-F43C-4CC7-8FCC-AF7254060B12_prs|trigger=none}row -- row index to remove, -1 for all rows {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:7435BA85-F43C-4CC7-8FCC-AF7254060B12_ret|text=|trigger=button}{sub-section}{sub-section:7435BA85-F43C-4CC7-8FCC-AF7254060B12_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:7435BA85-F43C-4CC7-8FCC-AF7254060B12_see|text=|trigger=button}{sub-section}{sub-section:7435BA85-F43C-4CC7-8FCC-AF7254060B12_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:7435BA85-F43C-4CC7-8FCC-AF7254060B12_see|text=|trigger=button}{sub-section}{sub-section:7435BA85-F43C-4CC7-8FCC-AF7254060B12_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:7435BA85-F43C-4CC7-8FCC-AF7254060B12_sam|text=|trigger=button}{sub-section}{sub-section:7435BA85-F43C-4CC7-8FCC-AF7254060B12_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset dataset.removeRow(1); //removes the first row dataset.removeRow(-1); //removes all rows {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F1755E65-95B7-428B-86B7-74617C22E2E1}{tr:id=name}{td}h6.setValue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setValue{span}{span:id=iets|style=float: left;}\(row, col, obj){span}{td}{tr}{tr:id=des}{td}{sub-section:F1755E65-95B7-428B-86B7-74617C22E2E1_des|text=|trigger=button}{sub-section}{sub-section:F1755E65-95B7-428B-86B7-74617C22E2E1_des|trigger=none|class=sIndent}Set the value specified by row and column position from the dataset. Use row = -1, to set columnnames.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:F1755E65-95B7-428B-86B7-74617C22E2E1_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F1755E65-95B7-428B-86B7-74617C22E2E1_prs|trigger=none}row -- row number, 1-based col -- column number, 1-based obj -- the value to be stored at the given row and column. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:F1755E65-95B7-428B-86B7-74617C22E2E1_ret|text=|trigger=button}{sub-section}{sub-section:F1755E65-95B7-428B-86B7-74617C22E2E1_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F1755E65-95B7-428B-86B7-74617C22E2E1_see|text=|trigger=button}{sub-section}{sub-section:F1755E65-95B7-428B-86B7-74617C22E2E1_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F1755E65-95B7-428B-86B7-74617C22E2E1_see|text=|trigger=button}{sub-section}{sub-section:F1755E65-95B7-428B-86B7-74617C22E2E1_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F1755E65-95B7-428B-86B7-74617C22E2E1_sam|text=|trigger=button}{sub-section}{sub-section:F1755E65-95B7-428B-86B7-74617C22E2E1_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset dataset.getValue(2, 1,'data'); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=BF4F0478-7810-4629-9B3E-628CDBCAC491}{tr:id=name}{td}h6.sort{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}sort{span}{span:id=iets|style=float: left;}\(col, sort_direction){span}{td}{tr}{tr:id=des}{td}{sub-section:BF4F0478-7810-4629-9B3E-628CDBCAC491_des|text=|trigger=button}{sub-section}{sub-section:BF4F0478-7810-4629-9B3E-628CDBCAC491_des|trigger=none|class=sIndent}Sort the dataset on the given column in ascending or descending.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:BF4F0478-7810-4629-9B3E-628CDBCAC491_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:BF4F0478-7810-4629-9B3E-628CDBCAC491_prs|trigger=none}col -- column number, 1-based sort_direction -- boolean true for ascending, false for descending {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:BF4F0478-7810-4629-9B3E-628CDBCAC491_ret|text=|trigger=button}{sub-section}{sub-section:BF4F0478-7810-4629-9B3E-628CDBCAC491_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:BF4F0478-7810-4629-9B3E-628CDBCAC491_see|text=|trigger=button}{sub-section}{sub-section:BF4F0478-7810-4629-9B3E-628CDBCAC491_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:BF4F0478-7810-4629-9B3E-628CDBCAC491_see|text=|trigger=button}{sub-section}{sub-section:BF4F0478-7810-4629-9B3E-628CDBCAC491_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:BF4F0478-7810-4629-9B3E-628CDBCAC491_sam|text=|trigger=button}{sub-section}{sub-section:BF4F0478-7810-4629-9B3E-628CDBCAC491_sam|class=sIndent|trigger=none}{code:language=javascript} //assuming the variable dataset contains a dataset dataset.sort(1,false) {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Wiki Markup
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Property SummaryGet or set the record index of the dataset.

servoy sSummary12%30%58%height: 30px;3Methods Summaryadds a column with the specified name to the dataset.adds a column with the specified name to the dataset.adds a column with the specified name to the dataset.voidAdd an HTML property to an HTML tag produced in getAsHTML().voidAdd a row to the dataset.voidAdd a row to the dataset.Create a datasource from the data set with specified name and using specified types.Create a datasource from the data set with specified name and using specified types.Create a datasource from the data set with specified name and using specified types.Get the dataset as an html table, do not escape values or spaces, no multi_line_markup, do not add indentation, add column names.Get the dataset as an html table, do not escape spaces, no multi_line_markup, do not add indentation, add column names.Get the dataset as an html table, no multi_line_markup, do not add indentation, add column names.Get the dataset as an html table, do not add indentation, add column names.Get the dataset as an html table, add column names.Get the dataset as an html table.Get the dataset as formatted text.Get the column data of a dataset as an Array.Get a column name based on index.Get the column names of a dataset.Get a column type based on index.Get the database exception if an error occurred.Get the number of columns in the dataset.Get the number of rows in the dataset.Get the row data of a dataset as an Array.Get the value specified by row and column position from the dataset.Return true if there is more data in the resultset then specified by maxReturnedRows at query time.Remove a column by index from the dataset.voidRemove a row from the dataset.voidSet a column name based on index.voidSet the value specified by row and column position from the dataset.voidSort the dataset on the given column (1-based) in ascending or descending.voidSort the dataset using the function as comparator.

propertyservoy sDetail2100%height:30px2Property DetailsrowIndexname

rowIndex

dessIndent
Get or set the record index of the dataset.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

functionservoy sDetail2100%height:30px2Methods DetailsaddColumnname

addColumn(name)

dessIndent
adds a column with the specified name to the dataset.
prs

Parameters

sIndentnamecolumn name.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowaddColumnname

addColumn(name, index)

dessIndent
adds a column with the specified name to the dataset.
prs

Parameters

sIndentnamecolumn name.indexcolumn index number between 1 and getMaxColumnIndex().
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addColumnname

addColumn(name, index, type)

dessIndent
adds a column with the specified name to the dataset.
prs

Parameters

sIndentnamecolumn name.indexcolumn index number between 1 and getMaxColumnIndex().typethe type of column, see JSColumn constants.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addHTMLPropertyname

addHTMLProperty(row, col, name, value)

dessIndent
Add an HTML property to an HTML tag produced in getAsHTML().

For row and col parameters use:
1 = applies to the container
0 = applies to all
>0 = applies to specific cell
prs

Parameters

sIndentrowrow numbercolcolumn numbernameString property namevalueString property value
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addRowname

addRow(index, array)

dessIndent
Add a row to the dataset.
prs

Parameters

sIndentindexindex to add row (1-based)arrayrow data
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
addRowname

addRow(array)

dessIndent
Add a row to the dataset. The row will be added as the last row.
prs

Parameters

sIndentarrayrow data
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
createDataSourcename

createDataSource(name)

dessIndent
Create a datasource from the data set with specified name and using specified types.
The types are inferred from the data if possible.

A temporary datasource cannot be removed because once created there may always be forms or relations that refer to it.
When the client exits, all datasources used by that client are removed automatically.

Most resources used by the datasource can be released by deleting all records:
  dataset.removeRow(-1) or databaseManager.getFoundSet(datasource).deleteAllRecords()
prs

Parameters

sIndentnamedatasource name
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
createDataSourcename

createDataSource(name, types)

dessIndent
Create a datasource from the data set with specified name and using specified types.

A temporary datasource cannot be removed because once created there may always be forms or relations that refer to it.
When the client exits, all datasources used by that client are removed automatically.

Most resources used by the datasource can be released by deleting all records:
  dataset.removeRow(-1) or databaseManager.getFoundSet(datasource).deleteAllRecords()

A datasource can be reused if the data has the same signature (column names and types).
A new createDataSource() call will clear the datasource contents from a previous call and insert the current data.
prs

Parameters

sIndentnamedatasource nametypesarray of types as defined in JSColumn
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
createDataSourcename

createDataSource(name, types, pkNames)

dessIndent
Create a datasource from the data set with specified name and using specified types.

A temporary datasource cannot be removed because once created there may always be forms or relations that refer to it.
When the client exits, all datasources used by that client are removed automatically.

Most resources used by the datasource can be released by deleting all records:
  dataset.removeRow(-1) or databaseManager.getFoundSet(datasource).deleteAllRecords()
prs

Parameters

sIndentnamedatasource nametypesarray of types as defined in JSColumn, when null types are inferred from the query resultpkNamesarray of pk names, when null a hidden pk-column will be added
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAsHTMLname

getAsHTML()

dessIndent
Get the dataset as an html table, do not escape values or spaces, no multi_line_markup, do not add indentation, add column names.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAsHTMLname

getAsHTML(escape_values)

dessIndent
Get the dataset as an html table, do not escape spaces, no multi_line_markup, do not add indentation, add column names.
prs

Parameters

sIndentescape_valuesif true, replaces illegal HTML characters with corresponding valid escape sequences.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAsHTMLname

getAsHTML(escape_values, escape_spaces)

dessIndent
Get the dataset as an html table, no multi_line_markup, do not add indentation, add column names.
prs

Parameters

sIndentescape_valuesif true, replaces illegal HTML characters with corresponding valid escape sequences.escape_spacesif true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAsHTMLname

getAsHTML(escape_values, escape_spaces, multi_line_markup)

dessIndent
Get the dataset as an html table, do not add indentation, add column names.
prs

Parameters

sIndentescape_valuesif true, replaces illegal HTML characters with corresponding valid escape sequences.escape_spacesif true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags.multi_line_markupif true, multiLineMarkup will enforce new lines that are in the text; single new lines will be replaced by <br>, multiple new lines will be replaced by <p>
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAsHTMLname

getAsHTML(escape_values, escape_spaces, multi_line_markup, pretty_indent)

dessIndent
Get the dataset as an html table, add column names.
prs

Parameters

sIndentescape_valuesif true, replaces illegal HTML characters with corresponding valid escape sequences.escape_spacesif true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags.multi_line_markupif true, multiLineMarkup will enforce new lines that are in the text; single new lines will be replaced by <br>, multiple new lines will be replaced by <p>pretty_indentif true, adds indentation for more readable HTML code.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAsHTMLname

getAsHTML(escape_values, escape_spaces, multi_line_markup, pretty_indent, add_column_names)

dessIndent
Get the dataset as an html table.
prs

Parameters

sIndentescape_valuesif true, replaces illegal HTML characters with corresponding valid escape sequences.escape_spacesif true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags.multi_line_markupif true, multiLineMarkup will enforce new lines that are in the text; single new lines will be replaced by <br>, multiple new lines will be replaced by <p>pretty_indentif true, adds indentation for more readable HTML code.add_column_namesif false, column headers will not be added to the table.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getAsTextname

getAsText(column_separator, row_separator, value_delimiter, add_column_names)

dessIndent
Get the dataset as formatted text.
prs

Parameters

sIndentcolumn_separatorany specified column separator; examples: tab '\t'; comma ','; semicolon ';'; space ' ' .row_separatorthe specified row separator; examples: new line '\n'.value_delimiterthe specified value delimiter; null means empty string; example: double quote '"'.add_column_namesif true column names will be added as a first row.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getColumnAsArrayname

getColumnAsArray(index)

dessIndent
Get the column data of a dataset as an Array.
prs

Parameters

sIndentindexindex of column (1-based).
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getColumnNamename

getColumnName(index)

dessIndent
Get a column name based on index.
prs

Parameters

sIndentindexindex of column (1-based).
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getColumnNamesname

getColumnNames()

dessIndent
Get the column names of a dataset.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getColumnTypename

getColumnType(index)

dessIndent
Get a column type based on index.
prs

Parameters

sIndentindexindex of column (1-based).
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getExceptionname

getException()

dessIndent
Get the database exception if an error occurred.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getMaxColumnIndexname

getMaxColumnIndex()

dessIndent
Get the number of columns in the dataset.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getMaxRowIndexname

getMaxRowIndex()

dessIndent
Get the number of rows in the dataset.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getRowAsArrayname

getRowAsArray(index)

dessIndent
Get the row data of a dataset as an Array.
prs

Parameters

sIndentindexindex of row (1-based).
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getValuename

getValue(row, col)

dessIndent
Get the value specified by row and column position from the dataset.
prs

Parameters

sIndentrowrow number, 1-basedcolcolumn number, 1-based
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
hadMoreDataname

hadMoreData()

dessIndent
Return true if there is more data in the resultset then specified by maxReturnedRows at query time.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
removeColumnname

removeColumn(index)

dessIndent
Remove a column by index from the dataset.
prs

Parameters

sIndentindexindex of column to remove (1-based)
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
removeRowname

removeRow(row)

dessIndent
Remove a row from the dataset.
prs

Parameters

sIndentrowrow index to remove, -1 for all rows
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setColumnNamename

setColumnName(index, columnName)

dessIndent
Set a column name based on index.
prs

Parameters

sIndentindexindex of column (1-based).columnNamenew column name.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setValuename

setValue(row, col, obj)

dessIndent
Set the value specified by row and column position from the dataset.
Use row = -1, to set columnnames.
prs

Parameters

sIndentrowrow number, 1-basedcolcolumn number, 1-basedobjthe value to be stored at the given row and column.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
sortname

sort(col, sort_direction)

dessIndent
Sort the dataset on the given column (1-based) in ascending or descending.
prs

Parameters

sIndentcolcolumn number, 1-basedsort_directionascending (true) or descending (false)
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
sortname

sort(comparator)

dessIndent
Sort the dataset using the function as comparator.
The comparator function is called to compare two rows, that are passed as arguments, and
it will return -1/0/1 if the first row is less/equal/greater then the second row.

NOTE: starting with 7.2 release, when called on datasource(foundset) dataset, this function doesn't save the data anymore
prs

Parameters

sIndentcomparatorcomparator function
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow