java.lang.Object
com.aspose.cells.Column
public abstract class Column
- extends java.lang.Object
Represents a single column in a worksheet.
Example:
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Obtaining the reference of the first worksheet
Worksheet worksheet = workbook.getWorksheets().get(0);
//Add new Style to Workbook
Style style = workbook.getStyles().get(workbook.getStyles().add());
//Setting the background color to Blue
style.setBackgroundColor(Color.getBlue());
//Setting the foreground color to Red
style.setForegroundColor(Color.getRed());
//setting Background Pattern
style.setPattern(BackgroundType.DIAGONAL_STRIPE);
//New Style Flag
StyleFlag styleFlag = new StyleFlag();
//Set All Styles
styleFlag.setAll(true);
//Get first Column
Column column = worksheet.getCells().getColumns().get(0);
//Apply Style to first Column
column.applyStyle(style, styleFlag);
//Saving the Excel file
workbook.save("D:\\book1.xls");
|
Property Getters/Setters Summary |
abstract byte | getGroupLevel() | |
|
Gets the group level of the column.
|
abstract int | getIndex() | |
|
Gets the index of this column.
|
abstract boolean | isHidden() | |
abstract void | setHidden(boolean value) | |
|
Indicates whether the column is hidden.
|
abstract Style | getStyle() | |
|
Gets the style of this column.
|
abstract double | getWidth() | |
abstract void | setWidth(double value) | |
|
Gets and sets the column width in unit of characters.
|
|
Property Getters/Setters Detail |
getIndex | |
public abstract int getIndex()
|
-
Gets the index of this column.
getWidth/setWidth | |
public abstract double getWidth() / public abstract void setWidth(double value)
|
-
Gets and sets the column width in unit of characters.
getGroupLevel | |
public abstract byte getGroupLevel()
|
-
Gets the group level of the column.
isHidden/setHidden | |
public abstract boolean isHidden() / public abstract void setHidden(boolean value)
|
-
Indicates whether the column is hidden.
getStyle | |
public abstract Style getStyle()
|
-
Gets the style of this column.
You have to call Column.ApplyStyle() method to save your changing with the row style,
otherwise it will not effect.
applyStyle | |
public abstract void applyStyle(Style style, StyleFlag flag) |
-
Applies formats for a whole column.
- Parameters:
style - The style object which will be applied.flag - Flags which indicates applied formatting properties.
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.