Documentation ¶
Index ¶
- Constants
- type Format
- func (f *Format) SetBackgroundColor(color int)
- func (f *Format) SetBold()
- func (f *Format) SetFontColor(color int)
- func (f *Format) SetFontName(fontName string)
- func (f *Format) SetFontSize(size int)
- func (f *Format) SetItalic()
- func (f *Format) SetNumericalFormat(numberFormat string)
- func (f *Format) SetPattern(pattern int)
- func (f *Format) SetUnderline(style int)
- type ImageOptions
- type Workbook
- type WorkbookOptions
- type Worksheet
- func (w *Worksheet) InsertImage(row int, col int, filename string, options *ImageOptions) error
- func (w *Worksheet) WriteBlank(row int, col int, format *Format) error
- func (w *Worksheet) WriteBool(row int, col int, value bool, format *Format) error
- func (w *Worksheet) WriteFloat(row int, col int, value float64, format *Format) error
- func (w *Worksheet) WriteFormula(row int, col int, formula string, format *Format) error
- func (w *Worksheet) WriteInt(row int, col int, value int, format *Format) error
- func (w *Worksheet) WriteString(row int, col int, value string, format *Format) error
- func (w *Worksheet) WriteUrl(row int, col int, url string, display string, format *Format) error
Constants ¶
const ( // Single underline. UNDERLINE_SINGLE int = C.LXW_UNDERLINE_SINGLE // Double underline. UNDERLINE_DOUBLE int = C.LXW_UNDERLINE_DOUBLE // Single accounting underline. UNDERLINE_SINGLE_ACCOUNTING int = C.LXW_UNDERLINE_SINGLE_ACCOUNTING // Double accounting line. UNDERLINE_DOUBLE_ACCOUNTING int = C.LXW_UNDERLINE_DOUBLE_ACCOUNTING )
UNDERLINE_* constants are to be used with SetUnderline().
const ( // Solid. PATTERN_SOLID int = C.LXW_PATTERN_SOLID // Medium gray. PATTERN_MEDIUM_GRAY int = C.LXW_PATTERN_MEDIUM_GRAY // Dark gray. PATTERN_DARK_GRAY int = C.LXW_PATTERN_DARK_GRAY // Light gray. PATTERN_LIGHT_GRAY int = C.LXW_PATTERN_LIGHT_GRAY // Dark horizontal line. PATTERN_DARK_HORIZONTAL int = C.LXW_PATTERN_DARK_HORIZONTAL // Dark vertical line. PATTERN_DARK_VERTICAL int = C.LXW_PATTERN_DARK_VERTICAL // Dark diagonal stripe. PATTERN_DARK_DOWN int = C.LXW_PATTERN_DARK_DOWN // Reverse dark diagonal stripe. PATTERN_DARK_UP int = C.LXW_PATTERN_DARK_UP // Dark grid. PATTERN_DARK_GRID int = C.LXW_PATTERN_DARK_GRID // Dark trellis. PATTERN_DARK_TRELLIS int = C.LXW_PATTERN_DARK_TRELLIS // Light horizontal line. PATTERN_LIGHT_HORIZONTAL int = C.LXW_PATTERN_LIGHT_HORIZONTAL // Light vertical line. PATTERN_LIGHT_VERTICAL int = C.LXW_PATTERN_LIGHT_VERTICAL // Light diagonal stripe. PATTERN_LIGHT_DOWN int = C.LXW_PATTERN_LIGHT_DOWN // Reverse light diagonal stripe. PATTERN_LIGHT_UP int = C.LXW_PATTERN_LIGHT_UP // Light grid. PATTERN_LIGHT_GRID int = C.LXW_PATTERN_LIGHT_GRID // Light trellis. PATTERN_LIGHT_TRELLIS int = C.LXW_PATTERN_LIGHT_TRELLIS // 12.5% gray. PATTERN_GRAY_125 int = C.LXW_PATTERN_GRAY_125 // 6.25% gray. PATTERN_GRAY_0625 int = C.LXW_PATTERN_GRAY_0625 )
PATTERN_* constants are to be used with SetPattern().
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Format ¶
type Format struct {
CFormat *C.struct_lxw_format
}
Format represents an Excel style used to apply formatting to cells.
func (*Format) SetBackgroundColor ¶
SetBackgroundColor sets the background color.
func (*Format) SetFontColor ¶
SetFontColor sets the font color.
func (*Format) SetFontName ¶
SetFontName sets the format's font face.
func (*Format) SetNumericalFormat ¶
SetNumericalFormat sets the numerical format. It controls whether a number is displayed as an integer, a floating point number, a date, a currency value or some other user defined format (e.g., "d mmm yyyy").
func (*Format) SetPattern ¶
SetPattern sets the pattern to the specific PATTERN_* pattern.
func (*Format) SetUnderline ¶
SetUnderline sets the font to be underline using the specified UNDERLINE_* style.
type ImageOptions ¶
ImageOptions contains options to be set when inserting an image into a worksheet.
type Workbook ¶
type Workbook struct {
CWorkbook *C.struct_lxw_workbook
}
Workbook represents an Excel workbook.
func NewWorkbook ¶
func NewWorkbook(filename string, options *WorkbookOptions) *Workbook
NewWorkbook create and returns a new instance of Workbook.
type WorkbookOptions ¶
WorkbookOptions contains options to be set when creating a new Workbook.
type Worksheet ¶
type Worksheet struct { CWorksheet *C.struct_lxw_worksheet Workbook *Workbook }
Worksheet represents an Excel worksheet.
func NewWorksheet ¶
NewWorksheet creates and returns a new instance of Worksheet.
func (*Worksheet) InsertImage ¶
InsertImage inserts an image at the specified row and column and applies options.
func (*Worksheet) WriteBlank ¶
WriteBlank writes a "blank" cell at the specified row and column and applies an optional format. Excel differentiates between an empty cell and a blank cell. An empty cell is a cell which doesn't contain data or formatting. A blank cell doesn't contain data but does contain formatting.
func (*Worksheet) WriteBool ¶
WriteBool writes a boolean value at the specified row and column and applies an optional format.
func (*Worksheet) WriteFloat ¶
WriteFloat writes a float64 value at the specified row and column and applies an optional format.
func (*Worksheet) WriteFormula ¶
WriteFormula writes a formula value at the specified row and column and applies an optional format.
func (*Worksheet) WriteInt ¶
WriteInt writes an integer value at the specified row and column and applies an optional format.
func (*Worksheet) WriteString ¶
WriteString writes a string value at the specified row and column and applies an optional format.