Servoy Methods Details |
---|
addRow
void addRow( Array<Object> )
Add a rowParameters
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 rowParameters
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 cellParameters
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 fontParameters
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 styleParameters
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 fontParameters
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 fontParameters
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 fontParameters
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 fontParameters
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 panesParameters
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 countReturns
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 nameParameters
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 namesReturns
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 indexReturns
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 indexReturns
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 valueParameters
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 cellsParameters
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 cellsParameters
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 cellsParameters
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 rowParameters
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 alignmentParameters
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 backgroundParameters
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 borderParameters
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 borderParameters
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 borderParameters
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 fontParameters
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 fontParameters
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 formatParameters
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 cellParameters
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 lockedParameters
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 valueParameters
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 alignmentParameters
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 formatParameters
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 lockedParameters
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 fitParameters
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 widthParameters
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 valuesParameters
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 heightParameters
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 valueParameters
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 orderParameters
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!
}
}
}