Home Index Book Sheet Format Font AutoFilter FilterColumn RichString FormControl
ConditionalFormatting ConditionalFormat Examples
ConditionalFormatting ConditionalFormat Examples
Format class reference
-
public Font font The current font.
-
public int numFormat() Returns the number format identifier.
-
public void setNumFormat(NumFormat numFormat) Sets the built-in number format identifier.
Constant Description Example NUMFORMAT_GENERAL general format NUMFORMAT_NUMBER general number 1000 NUMFORMAT_NUMBER_D2 number with decimal point 1000.00 NUMFORMAT_NUMBER_SEP number with thousands separator 100,000 NUMFORMAT_NUMBER_SEP_D2 number with decimal point and thousands separator 100,000.00 NUMFORMAT_CURRENCY_NEGBRA monetary value, negative in brackets (1000$) NUMFORMAT_CURRENCY_NEGBRARED monetary value, negative is red in brackets (1000$) NUMFORMAT_CURRENCY_D2_NEGBRA monetary value with decimal point, negative in brackets ($1000.00) NUMFORMAT_CURRENCY_D2_NEGBRARED monetary value with decimal point, negative is red in brackets ($1000.00) NUMFORMAT_PERCENT percent value, multiply the cell value by 100 75% NUMFORMAT_PERCENT_D2 percent value with decimal point, multiply the cell value by 100 75.00% NUMFORMAT_SCIENTIFIC_D2 scientific value with E character and decimal point 10.00E+1 NUMFORMAT_FRACTION_ONEDIG fraction value, one digit 10 1/2 NUMFORMAT_FRACTION_TWODIG fraction value, two digits 10 23/95 NUMFORMAT_DATE date value, depends on OS settings 3/11/2009 NUMFORMAT_CUSTOM_D_MON_YY custom date value 11-Mar-09 NUMFORMAT_CUSTOM_D_MON custom date value 11-Mar NUMFORMAT_CUSTOM_MON_YY custom date value Mar-09 NUMFORMAT_CUSTOM_HMM_AM custom date value 8:30 AM NUMFORMAT_CUSTOM_HMMSS_AM custom date value 8:30:00 AM NUMFORMAT_CUSTOM_HMM custom date value 8:30 NUMFORMAT_CUSTOM_HMMSS custom date value 8:30:00 NUMFORMAT_CUSTOM_MDYYYY_HMM custom datetime value 3/11/2009 8:30 NUMFORMAT_NUMBER_SEP_NEGBRA number with thousands separator, negative in brackets (4,000) NUMFORMAT_NUMBER_SEP_NEGBRARED number with thousands separator, negative is red in brackets (4,000) NUMFORMAT_NUMBER_D2_SEP_NEGBRA number with thousands separator and decimal point, negative in brackets (4,000.00) NUMFORMAT_NUMBER_D2_SEP_NEGBRARED number with thousands separator and decimal point, negative is red in brackets (4,000.00) NUMFORMAT_ACCOUNT account value 5,000 NUMFORMAT_ACCOUNTCUR account value with currency symbol $ 5,000 NUMFORMAT_ACCOUNT_D2 account value with decimal point 5,000.00 NUMFORMAT_ACCOUNT_D2_CUR account value with currency symbol and decimal point $ 5,000.00 NUMFORMAT_CUSTOM_MMSS custom time value 30:55 NUMFORMAT_CUSTOM_H0MMSS custom time value 20:30:55 NUMFORMAT_CUSTOM_MMSS0 custom time value 30:55.0 NUMFORMAT_CUSTOM_000P0E_PLUS0 custom value 15.2E+3 NUMFORMAT_TEXT text value any text -
public void setNumFormat(int numFormat)
Sets the custom number format identifier. To create a custom format use Book::addCustomNumFormat().
-
public AlignH alignH The horizontal alignment.
AlignH value View ALIGNH_GENERAL ALIGNH_LEFT ALIGNH_CENTER ALIGNH_RIGHT ALIGNH_FILL ALIGNH_JUSTIFY ALIGNH_MERGE ALIGNH_DISTRIBUTED -
public AlignV alignV The vertical alignment.
AlignV value View ALIGNV_TOP ALIGNV_CENTER ALIGNV_BOTTOM ALIGNV_JUSTIFY ALIGNV_DISTRIBUTED -
public bool wrap If true then the cell text is wrapped.
-
public int rotation The text rotation.
Value Meaning 0 - 90 Text rotated counterclockwise 0 to 90 degrees 91 - 180 Text rotated clockwise 1 to 90 degrees 255 Vertical text -
public int indent The text indentation level. Must be less than or equal to 15.
-
public bool shrinkToFit If true then the cell is shrink-to-fit.
-
public void setBorder(BorderStyle style) Sets the border style.
BorderStyle value View BORDERSTYLE_NONE BORDERSTYLE_THIN BORDERSTYLE_MEDIUM BORDERSTYLE_DASHED BORDERSTYLE_DOTTED BORDERSTYLE_THICK BORDERSTYLE_DOUBLE BORDERSTYLE_HAIR BORDERSTYLE_MEDIUMDASHED BORDERSTYLE_DASHDOT BORDERSTYLE_MEDIUMDASHDOT BORDERSTYLE_DASHDOTDOT BORDERSTYLE_MEDIUMDASHDOTDOT BORDERSTYLE_SLANTDASHDOT -
public void setBorderColor(Color color) Sets the border color.
-
public BorderStyle borderLeft The left border style.
-
public BorderStyle borderRight The right border style.
-
public BorderStyle borderTop The top border style.
-
public BorderStyle borderBottom The bottom border style.
-
public Color borderLeftColor The color of the left border.
-
public Color borderRightColor The color of the right border.
-
public Color borderTopColor The color of the top border.
-
public Color borderBottomColor The color of the bottom border.
- public BorderDiagonal borderDiagonal
-
public BorderStyle borderDiagonalStyle The style of the diagonal border.
-
public Color borderDiagonalColor The color of the diagonal border.
-
public FillPattern fillPattern The fill pattern.
FillPattern value View FILLPATTERN_NONE FILLPATTERN_SOLID FILLPATTERN_GRAY50 FILLPATTERN_GRAY75 FILLPATTERN_GRAY25 FILLPATTERN_HORSTRIPE FILLPATTERN_VERSTRIPE FILLPATTERN_REVDIAGSTRIPE FILLPATTERN_DIAGSTRIPE FILLPATTERN_DIAGCROSSHATCH FILLPATTERN_THICKDIAGCROSSHATCH FILLPATTERN_THINHORSTRIPE FILLPATTERN_THINVERSTRIPE FILLPATTERN_THINREVDIAGSTRIPE FILLPATTERN_THINDIAGSTRIPE FILLPATTERN_THINHORCROSSHATCH FILLPATTERN_THINDIAGCROSSHATCH FILLPATTERN_GRAY12P5 FILLPATTERN_GRAY6P25 -
public Color patternForegroundColor The foreground color of the fill pattern.
-
public Color patternBackgroundColor The background color of the fill pattern.
-
public bool locked The locked protection property. It is used when the sheet is protected with the Sheet::setProtect() method.
If "locked" is false a user can change a cell with such format even if the sheet is protected. -
public bool hidden The hidden protection property.