Example:
//Instantiating a Workbook object var workbook = new aspose.cells.Workbook(); //Obtaining the reference of the first worksheet var worksheet = workbook.getWorksheets().get(0); //Add new Style to Workbook var style = workbook.createStyle(); //Setting the background color to Blue style.setForegroundColor(aspose.cells.Color.getBlue()); //setting Background Pattern style.setPattern(aspose.cells.BackgroundType.SOLID); //New Style Flag var styleFlag = new aspose.cells.StyleFlag(); //Set All Styles styleFlag.setAll(true); //Change the default width of first ten columns for (var i = 0; i < 10; i++) { worksheet.getCells().getColumns().get(i).setWidth(20); } //Get the Column with non default formatting var columns = worksheet.getCells().getColumns(); for (var o = columns.iterator(); o.hasNext();) { var column = o.next(); //Apply Style to first ten Columns column.applyStyle(style, styleFlag); } //Saving the Excel file workbook.save("Book1.xls");
Property Getters/Setters Summary | ||
---|---|---|
function | getCount() | |
function | get(columnIndex) | |
Gets a object by column index. The Column object of given column index will be instantiated if it does not exist before.
|
Method Summary | ||
---|---|---|
function | add(value) | |
Reserved for internal use. |
||
function | clear() | |
function | contains(value) | |
Reserved for internal use. |
||
function | get(index) | |
Reserved for internal use. |
||
function | getByIndex(index) | |
Gets the column object by the index.
|
||
function | getColumnByIndex(index) | |
Gets the |
||
function | indexOf(value) | |
Reserved for internal use. |
||
function | iterator() | |
function | removeAt(index) | |
function getCount()
function get(columnIndex)
function getByIndex(index)
index: Number
- function getColumnByIndex(index)
index: Number
- The position in the list.function clear()
function removeAt(index)
function iterator()
function get(index)
function contains(value)
function add(value)
function indexOf(value)