publish
plugins.it2be_data.IDFormattedDataSet info


Servoy Methods Summary
void addRow( Array<Object> )
void addRow( Number, Array<Object> )
void clear( Number, Number )
FormattedFont createFont( Number, Number, Object )
FormattedFont createFont( Number )
FormattedFont createFont( String )
FormattedFont createFont( String, Number )
FormattedFont createFont( String, Number, Number )
FormattedFont createFont( String, Number, Number, Object )
void freezePanes( Number, Number, Number, Number )
Number getColumnCount( )
String getColumnName( Number )
Array<String> getColumnNames( )
Number getMaxColumnIndex( )
Number getMaxRowIndex( )
Object getValue( Number, Number )
void mergeCells( Number, Number, Number, Number )
void mergeCells( Number, Number, Number, Number, Boolean )
void mergeCells( Number, Number, Number, Number, Boolean, Boolean )
void removeRow( Number )
void setCellAlignment( Number, Number, Number )
void setCellBackground( Number, Number, Object )
void setCellBorder( Number, Number, Number, Number, Object )
void setCellBorder( Number, Number, Number, Object )
void setCellBorders( Number, Number, Number, Object )
void setCellFont( Number, Number, FormattedFont )
void setCellFont( Number, Number, String, Object )
void setCellFormat( Number, Number, Object )
void setCellFormula( Number, Number, String )
void setCellLocked( Number, Number, Boolean )
void setCellValue( Number, Number, Object )
void setCellVerticalAlignment( Number, Number, Number )
void setColumnFormat( Number, Object )
void setColumnLocked( Number, Boolean )
void setColumnShrinkToFit( Number, Boolean )
void setColumnWidth( Number, Number )
void setRow( Number, Array<Object> )
void setRowHeight( Number, Number )
void setValue( Number, Number, Object )
void sort( Number, Boolean )


Servoy Methods Details


addRow
void  addRow( Array<Object> )
Add a row
Parameters
Array<Object>  values  the array

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


addRow
void  addRow( Number, Array<Object> )
Add a row
Parameters
Number  row  the index
Array<Object>  values  the array

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


clear
void  clear( Number, Number )
clear the cell
Parameters
Number  row  the row
Number  column  the column

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


createFont
FormattedFont  createFont( Number, Number, Object )
Create a formatted font
Parameters
Number  style  the style
Number  size  the size
Object  color  the color

Returns
FormattedFont  font FormattedFont

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


createFont
FormattedFont  createFont( Number )
Create a formatted font based on the style
Parameters
Number  style  the style

Returns
FormattedFont  font FormattedFont

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


createFont
FormattedFont  createFont( String )
Create a formatted font
Parameters
String  name  the name

Returns
FormattedFont  font FormattedFont

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


createFont
FormattedFont  createFont( String, Number )
Create a formatted font
Parameters
String  name  the name
Number  style  the style

Returns
FormattedFont  font FormattedFont

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


createFont
FormattedFont  createFont( String, Number, Number )
Create a formatted font
Parameters
String  name  the name
Number  style  the style
Number  size  the size

Returns
FormattedFont  font FormattedFont

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


createFont
FormattedFont  createFont( String, Number, Number, Object )
Create a formatted font
Parameters
String  name  the name
Number  style  the style
Number  size  the size
Object  color  the color

Returns
FormattedFont  font FormattedFont

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


freezePanes
void  freezePanes( Number, Number, Number, Number )
Freeze panes
Parameters
Number  row  the row
Number  column  the column
Number  freezedRows  the freezed rows
Number  freezedColumns  the freezed columns

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


getColumnCount
Number  getColumnCount( )
Get the column count
Returns
Number  count int

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


getColumnName
String  getColumnName( Number )
Get the column name
Parameters
Number  column  the column

Returns
String  name String

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


getColumnNames
Array<String>  getColumnNames( )
Get the column names
Returns
Array<String>  names String[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


getMaxColumnIndex
Number  getMaxColumnIndex( )
Get the maximum column index
Returns
Number  index int

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


getMaxRowIndex
Number  getMaxRowIndex( )
Get the maximum row index
Returns
Number  index int

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


getValue
Object  getValue( Number, Number )
Get a cell value
Parameters
Number  row  the row
Number  column  the column

Returns
Object  value Object

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


mergeCells
void  mergeCells( Number, Number, Number, Number )
Merge cells
Parameters
Number  row  the row
Number  column  the column
Number  totalRows  the total rows
Number  totalColumns  the total columns

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


mergeCells
void  mergeCells( Number, Number, Number, Number, Boolean )
Merge cells
Parameters
Number  row  the row
Number  column  the column
Number  totalRows  the total rows
Number  totalColumns  the total columns
Boolean  mergeConflict  the merge conflict

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


mergeCells
void  mergeCells( Number, Number, Number, Number, Boolean, Boolean )
Merge cells
Parameters
Number  row  the row
Number  column  the column
Number  totalRows  the total rows
Number  totalColumns  the total columns
Boolean  mergeConflict  the merge conflict
Boolean  checkConflict  the check conflict

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


removeRow
void  removeRow( Number )
Remove a row
Parameters
Number  row  the row

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setCellAlignment
void  setCellAlignment( Number, Number, Number )
Set a cell alignment
Parameters
Number  row  the row
Number  column  the column
Number  alignment  the alignment

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setCellBackground
void  setCellBackground( Number, Number, Object )
Set a cell background
Parameters
Number  row  the row
Number  column  the column
Object  color  the backgroundcolor

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setCellBorder
void  setCellBorder( Number, Number, Number, Number, Object )
Set a cell border
Parameters
Number  row  the row
Number  column  the column
Number  type  the border type
Number  lineType  the border line type
Object  color  the color

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setCellBorder
void  setCellBorder( Number, Number, Number, Object )
Set a cell border
Parameters
Number  row  the row
Number  column  the column
Number  lineType  the border line type
Object  color  the color

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setCellBorders
void  setCellBorders( Number, Number, Number, Object )
Set a cell border
Parameters
Number  row  the row
Number  column  the column
Number  lineType  the border line type
Object  color  the color

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setCellFont
void  setCellFont( Number, Number, FormattedFont )
Set a cell font
Parameters
Number  row  the row
Number  column  the column
FormattedFont  font  the font

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setCellFont
void  setCellFont( Number, Number, String, Object )
Set a cell font
Parameters
Number  row  the row
Number  column  the column
String  font  the font string
Object  color  the color

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setCellFormat
void  setCellFormat( Number, Number, Object )
Set a cell format
Parameters
Number  row  the row
Number  column  the column
Object  format  the custom format

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setCellFormula
void  setCellFormula( Number, Number, String )
Set the formula for a cell
Parameters
Number  row  the row
Number  column  the column
String  formula  the formula

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Currently supported (Workbook built-in) functions are listed below:
// [A]
// ABS, ACOS, ACOSH ADDRESS, AND, AREAS, ASC, ASIN, ASINH
// ATAN, ATAN2, ATANH, AVEDEV, AVERAGE, AVERAGEA
// [B]
// BINOMDIST
// [C]
// CEILING, CHAR, CHOOSE, CODE, COLUMN, COLUMNS, COMBIN, CONCATENATE, CORREL
// COS, COSH, COUNT, COUNTA, COUNTBLANK, COUNTIF, COVAR, CUMIPMT, CUMPRINC
// [D]
// DATE, DATEDIF, DATEVALUE, DAVERAGE, DAY, DAYS360, DCOUNT, DCOUNTA
// DEVSQ, DEGREES, DGET, DMAX, DMIN, DOLLAR, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DVAR, DVARP
// [E]
// EVEN, EXACT, EXP, EXPONDIST
// [F]
// FACT, FALSE, FIND, FISHER, FISHERINV, FIXED, FLOOR, FV
// [G]
// GEOMEAN, GROWTH
// [H]
// HARMEAN, HLOOKUP, HOUR, HYPGEOMDIST
// [I]
// IF,INDIRECT, INT, INTERCEPT, INDEX, ISBLANK, ISERR, ISERROR, ISEVEN
// ISLOGICAL,ISNA, ISNONTEXT, ISNUMBER, ISODD, ISREF, ISTEXT
// [L]
// LARGE, LEFT, LEN, LINEST, LN, LOOKUP, LOG, LOG10, LOGEST, LOWER
// [M]
// MATCH, MAX, MAXA, MEDIAN, MID, MIN, MINA, MINUTE, MOD, MONTH
// [N]
// NA, NORMDIST, NORMSDIST, NOT, NOW, NPV
// [O]
// ODD, OFFSET,OR
// [P]
// PEARSON, PERMUT, PI, PMT, POISSON, POWER, PPMT, PRODUCT, PROPER, PV
// [R]
// RADIANS, RAND, RANK, REPLACE, REPT, RIGHT, RSQ, ROUND, ROUNDDOWN, ROUNDUP, ROW, ROWS
// [S]
// SEARCH, SECOND, SIGN, SIN, SINH, SKEW, SLN, SLOPE, SMALL, SQRT
// STDEV, STDEVA, STDEVP, STDEVPA, SUBSTITUTE, SUBTOTAL, SUM, SUMIF, SUMPRODUCT
// SUMSQ, SUMX2MY2, SUMX2PY2, SUMXMY2, SYD
// [T]
// T, TAN, TANH,TEXT, TIME, TIMEVALUE, TODAY, TRIM, TRIMMEAN, TRUE, TRUNC, TYPE
// [U]
// UPPER
// [V]
// VALUE, VAR, VARA, VARP, VARPA, VLOOKUP
// [W]
// WEEKDAY, WEEKNUM
// [Y]
// YEAR


setCellLocked
void  setCellLocked( Number, Number, Boolean )
Set cell locked
Parameters
Number  row  the row
Number  column  the column
Boolean  locked  the locked

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setCellValue
void  setCellValue( Number, Number, Object )
Set cell value
Parameters
Number  row  the row
Number  column  the column
Object  value  the value

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setCellVerticalAlignment
void  setCellVerticalAlignment( Number, Number, Number )
Set a cell vertical alignment
Parameters
Number  row  the row
Number  column  the column
Number  alignment  the alignment

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setColumnFormat
void  setColumnFormat( Number, Object )
Set column format
Parameters
Number  column  the column
Object  format  the format

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setColumnLocked
void  setColumnLocked( Number, Boolean )
Set column locked
Parameters
Number  column  the column
Boolean  locked  the locked

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setColumnShrinkToFit
void  setColumnShrinkToFit( Number, Boolean )
Set column shrink to fit
Parameters
Number  column  the column
Boolean  shrinkToFit  the shrink to fit

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setColumnWidth
void  setColumnWidth( Number, Number )
Set column width
Parameters
Number  column  the column
Number  width  the width

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setRow
void  setRow( Number, Array<Object> )
Set row values
Parameters
Number  row  the row
Array<Object>  values  the values

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setRowHeight
void  setRowHeight( Number, Number )
Set row height
Parameters
Number  row  the row
Number  height  the height

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


setValue
void  setValue( Number, Number, Object )
Set cell value
Parameters
Number  row  the row
Number  column  the column
Object  value  the value

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}


sort
void  sort( Number, Boolean )
Set sort order
Parameters
Number  column  the column
Boolean  order  the order asc/desc

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a dataset based on a query on the example (crm) database
// and it2be_companies/contacts tables
var query = "SELECT c.firstname, c.lastname, o.company_name, o.description FROM it2be_contacts AS c, it2be_companies AS o WHERE c.it2be_companiesid=o.it2be_companiesid";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, 1000);
// stop executing this method when the dataset is empty
// and show an error dialog
if (!dataset.getMaxRowIndex()) {
plugins.it2be_data.showErrorDialog("Error.", "There are no records!", "OK");
Return;
// set the name of the file
}
var file = plugins.it2be_data.showFileSaveDialog();
// get the name of the operating system to know how to execute the,
// to the filetype attached,application
var osname = application.getOSName();
// check that we really selected a file
// if not ignore the rest of the code
if (file) {
var filename = file.getAbsoluteFile();
// create the IDExcel object
var object = plugins.it2be_data.excel();
// convert the BEDataSet to a IDFormattedDataSet
var set = object.convertDataSet(dataset);
// add formatting properties to the IDFormattedDataSet
set.setCellBorder(1, 1, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().GREEN);
set.setRowHeight(1, 30);
set.setColumnWidth(1, 50);
set.setColumnWidth(2, 50);
set.setCellAlignment(1, 1, set.ALIGN_RIGHT);
set.setCellAlignment(1, 2, set.ALIGN_CENTER);
set.setCellBackground(1, 3, plugins.it2be_data.excelColor().OLIVE);
set.setCellFont(1, 2, "Times,1,14", plugins.it2be_data.excelColor().BLUE);
set.setCellBorder(2, 3, set.BORDER_MEDIUM, plugins.it2be_data.excelColor().SILVER);
set.setCellBackground(2, 2, plugins.it2be_data.excelColor().BLUE);
set.setCellFont(2, 1, "Times,1,14", plugins.it2be_data.excelColor().YELLOW);
set.setCellFont(2, 2, set.createFont(set.FONT_ITALIC));
// A formula should be added equally formatted as in IDExcel
// but with a comma as value separator
// don't forget to start with the '=' character'
set.setCellFormula(18, 1, "=CONCATENATE(A7,\" \",B7)");
set.setValue(2, 2, new Date());
set.setValue(2, 3, 2.24);
set.setCellBackground(2, 4, plugins.it2be_data.excelColor().GREEN);
set.setCellBackground(3, 4, plugins.it2be_data.excelColor().PURPLE);
set.setCellBackground(4, 4, plugins.it2be_data.excelColor().LIME);
// write the file
filename = object.write(filename.getAbsolutePath(), set, true);
// open the data in the (to the filetype attached) application
// checking the os needs to be done via evaluation of a string
// you can also use the tools plugin that will give you an integer
if (osname.indexOf("Mac") > -1) {
// mac os x
application.executeProgram("open", filename);
}	else {
if (osname.indexOf("Windows") > -1) {
// windows
application.executeProgram("rundll32", "url.dll,FileProtocolHandler", filename);
}	else {
// linux etc. would love to know how to do this!
}
}
}