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', null, ['customerid']); // types are inferred from query result, use customerid as pk |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as an html table, do not escape values or spaces, no multi_line_markup, do not add indentation, add column names. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //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(databaseManager.getDataSourceServerName(controller.getDataSource()),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
scopes.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>'. |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as an html table, do not escape spaces, no multi_line_markup, do not add indentation, add column names. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {Boolean} escape_values - if true, replaces illegal HTML characters with corresponding valid escape sequences. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //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(databaseManager.getDataSourceServerName(controller.getDataSource()),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
scopes.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>'. |
|
|
|
|
Table Body (tbody) |
---|
id | getAsHTML-Boolean_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(escape_values, escape_spaces) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as an html table, no multi_line_markup, do not add indentation, add column names. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {Boolean} escape_values - if true, replaces illegal HTML characters with corresponding valid escape sequences. {Boolean} escape_spaces - if true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //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(databaseManager.getDataSourceServerName(controller.getDataSource()),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
scopes.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>'. |
|
|
|
|
Table Body (tbody) |
---|
id | getAsHTML-Boolean_Boolean_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(escape_values, escape_spaces, multi_line_markup) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as an html table, do not add indentation, add column names. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {Boolean} escape_values - if true, replaces illegal HTML characters with corresponding valid escape sequences. {Boolean} escape_spaces - if true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags. {Boolean} 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> |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //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(databaseManager.getDataSourceServerName(controller.getDataSource()),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
scopes.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>'. |
|
|
|
|
Table Body (tbody) |
---|
id | getAsHTML-Boolean_Boolean_Boolean_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(escape_values, escape_spaces, multi_line_markup, pretty_indent) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as an html table, add column names. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {Boolean} escape_values - if true, replaces illegal HTML characters with corresponding valid escape sequences. {Boolean} escape_spaces - if true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags. {Boolean} 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> {Boolean} pretty_indent - if true, adds indentation for more readable HTML code. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //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(databaseManager.getDataSourceServerName(controller.getDataSource()),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
scopes.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>'. |
|
|
|
|
Table Body (tbody) |
---|
id | getAsHTML-Boolean_Boolean_Boolean_Boolean_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(escape_values, escape_spaces, multi_line_markup, pretty_indent, add_column_names) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as an html table. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {Boolean} escape_values - if true, replaces illegal HTML characters with corresponding valid escape sequences. {Boolean} escape_spaces - if true, replaces text spaces with non-breaking space tags ( ) and tabs by four non-breaking space tags. {Boolean} 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> {Boolean} pretty_indent - if true, adds indentation for more readable HTML code. {Boolean} add_column_names - if false, column headers will not be added to the table. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //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(databaseManager.getDataSourceServerName(controller.getDataSource()),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
scopes.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>'. |
|
|
|
|
Table Body (tbody) |
---|
id | getAsText-String_String_String_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(column_separator, row_separator, value_delimiter, add_column_names) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the dataset as formatted text. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {String} column_separator - any specified column separator; examples: tab '\t'; comma ','; semicolon ';'; space ' ' . {String} row_separator - the specified row separator; examples: new line '\n'. {String} value_delimiter - the specified value delimiter; example: double quote '"'. {Boolean} add_column_names - if true column names will be added as a first row. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns
Div |
---|
| String - String formatted text. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //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) |
|
|
|
|
Table Body (tbody) |
---|
id | getColumnAsArray-Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getColumnAsArray |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Get the column data of a dataset as an Array. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters
Div |
---|
| {Number} index - index of column (1-based). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns
Div |
---|
| Object[] - Object array of data. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //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 |
|
|
|
|
|