ExcelWriter Xojo Plugin

ExcelWriterFormat Class (console safe)

Object that object represents an Excel format.

A format can represent fonts, patterns, alignment and number formatting or combination of any or all of them.

This class has only private constructor so instances cannot be created directly. To create instance of this class you call the AddFormat function on the ExcelWriterWorkbook class.

Object
   ExcelWriterFormat

class ExcelWriterFormat

Constructors

ExcelWriterFormatA private constructor that cannot be called.

Properties

Bold (console safe) Sets or gets the Bold font style on the format object
FontName (console safe) Sets or gets the font name for the format
FontScript (console safe) Sets or gets the font script to be used (None, Subscript, Superscript)
FontSize (console safe) Sets or gets the font size.
FormulaHidden (console safe) If set to true then the formula behind the cell is hidden while result is still displayed.
HorizontalAlignment (console safe) Sets or gets the horizontal alignment
Indent (console safe) Sets or gets the number of levels of indentations that the cell should have
Italic (console safe) Sets or gets the Italic font style on the format object
Locked (console safe) This property can be used to allow modification of a cell in a protected worksheet. Set this property to false to unlock a cell.
Pattern (console safe) Sets fill pattern for the format.
ShrinkToFit (console safe) This property can be used to shrink text so that it fits in a cell. If set to true then shrinking is done, else not.
Strikeout (console safe) Sets or gets font styles Strikeout attribute on the format object.
TextWrap (console safe) True if the text should wrap, else false.
Underline (console safe) Sets or gets the underline font style on the format object.
VerticalAlignment (console safe) Sets or gets the vertical alignment

Methods

SetBackgroundColor (console safe) Sets pattern background color.
SetBorder (console safe) Sets border attributes for the format.
SetBorderColor (console safe) Sets the color for cell borders in the format.
SetFontColor (console safe) Sets the font color for the format
SetForegroundColor (console safe) Sets pattern foreground color.
SetPresentationFormat (console safe) Sets custom presentation format of the data to one of the Excel's preset formats.
SetPresentationFormat (console safe) Sets custom presentation format of the data. (for example on Numeric or date data)
SetRotation (console safe) Sets the rotation in degrees for a text in a cell.

Enumerations

HorizontalAlignmentValuesEnum that represent excel document cell horizontal alignment.
VerticalAlignmentValuesEnum that represent excel document cell vertical alignment.
BorderStyleValuesA enum that represents Excel border styles.
SideValuesA enum that represents sides of cells to use for borders. You can call the border functions more than once if wanting for example to set LEFT_AND_RIGHT and also BOTTOM.
FontUnderlineValuesA enum that represents font underline types.
FontScriptValuesA enum that represents font script like Subscript and Superscript.
PatternValuesEnum values that represent pattern selection for the Pattern property on the ExcelWriterFormat class.

Examples

Dim f as FolderItem

f = GetSaveFolderItem("*.*","Test.xlsx")

if f <> nil then
    Dim writer as ExcelWriterWorkbook = ExcelWriterWorkbook.Create(f, ZStream.GetZipEngineHandle())
    Dim sheet as ExcelWriterWorksheet = writer.AddWorksheet()
    Dim format as ExcelWriterFormat = writer.AddFormat()
   
    format.Italic = true
   
    sheet.CellText(2,2,format) = "Hello world"
   
    call writer.Close()
end if

Supported Platforms:

  • MacOS X Carbon
  • MacOS X Cocoa 32 bit
  • MacOS X Cocoa 64 bit
  • Windows 32 bit
  • Windows 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM