Example:
# Instantiating a Workbook object workbook = Workbook() # Obtaining the reference of the newly added worksheet by passing its sheet index worksheet = workbook.getWorksheets().get(0) # Accessing the "A1" cell from the worksheet cell = worksheet.getCells().get("A1") # Adding some value to the "A1" cell cell.putValue("Hello Aspose!") style = cell.getStyle() font = style.getFont() # Setting the font name to "Times New Roman" font.setName("Times New Roman") # Setting font size to 14 font.setSize(14) # setting font color as Red font.setColor(Color.getRed()) cell.setStyle(style) # Saving the Excel file workbook.save("Book1.xls")
Property Getters/Setters Summary | ||
---|---|---|
method | getArgbColor() | |
method | setArgbColor(value) | |
Gets and sets the color with a 32-bit ARGB value. | ||
method | getCapsType() | |
method | setCapsType(value) | |
Gets and sets the text caps type. The value of the property is TextCapsType integer constant. | ||
method | getCharset() | |
method | setCharset(value) | |
Represent the character set. | ||
method | getColor() | |
method | setColor(value) | |
Gets or sets the |
||
method | getDoubleSize() | |
method | setDoubleSize(value) | |
Gets and sets the double size of the font. | ||
method | isBold() | |
method | setBold(value) | |
Gets or sets a value indicating whether the font is bold. | ||
method | isItalic() | |
method | setItalic(value) | |
Gets or sets a value indicating whether the font is italic. | ||
method | isNormalizeHeights() | |
method | setNormalizeHeights(value) | |
Indicates whether the normalization of height that is to be applied to the text run. | ||
method | isStrikeout() | |
method | setStrikeout(value) | |
Gets or sets a value indicating whether the font is single strikeout. | ||
method | isSubscript() | |
method | setSubscript(value) | |
Gets or sets a value indicating whether the font is subscript. | ||
method | isSuperscript() | |
method | setSuperscript(value) | |
Gets or sets a value indicating whether the font is super script. | ||
method | getName() | |
method | setName(value) | |
Gets or sets the name of the |
||
method | getSchemeType() | |
method | setSchemeType(value) | |
Gets and sets the scheme type of the font. The value of the property is FontSchemeType integer constant. | ||
method | getScriptOffset() | |
method | setScriptOffset(value) | |
Gets and sets the script offset,in unit of percentage | ||
method | getSize() | |
method | setSize(value) | |
Gets or sets the size of the font. | ||
method | getStrikeType() | |
method | setStrikeType(value) | |
Gets the strike type of the text. The value of the property is TextStrikeType integer constant. | ||
method | getThemeColor() | |
method | setThemeColor(value) | |
Gets and sets the theme color. | ||
method | getUnderline() | |
method | setUnderline(value) | |
Gets or sets the font underline type. The value of the property is FontUnderlineType integer constant. |
Method Summary | ||
---|---|---|
method | equals(font) | |
Checks if two fonts are equals.
|
||
method | toString() | |
Returns a string represents the current Cell object.
|
int getCharset() / setCharset(value)
boolean isItalic() / setItalic(value)
boolean isBold() / setBold(value)
int getCapsType() / setCapsType(value)
int getStrikeType() / setStrikeType(value)
boolean isStrikeout() / setStrikeout(value)
float getScriptOffset() / setScriptOffset(value)
boolean isSuperscript() / setSuperscript(value)
boolean isSubscript() / setSubscript(value)
int getUnderline() / setUnderline(value)
String getName() / setName(value)
Example:
workbook = Workbook() # Obtaining the reference of the newly added worksheet by passing its sheet index worksheet = workbook.getWorksheets().get(0) # Accessing the "A1" cell from the worksheet cell = worksheet.getCells().get("A1") # Adding some value to the "A1" cell cell.putValue("Hello Aspose!") style = cell.getStyle() font = style.getFont() font.setName("Times New Roman") cell.setStyle(style)
float getDoubleSize() / setDoubleSize(value)
int getSize() / setSize(value)
ThemeColor getThemeColor() / setThemeColor(value)
Color getColor() / setColor(value)
int getArgbColor() / setArgbColor(value)
boolean isNormalizeHeights() / setNormalizeHeights(value)
int getSchemeType() / setSchemeType(value)