Documentation ¶
Overview ¶
Copyright 2017 Baliance. All rights reserved.
Use of this source code is governed by the terms of the Affero GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. A commercial license can be purchased by contacting sales@baliance.com.
Copyright 2017 Baliance. All rights reserved.
Use of this source code is governed by the terms of the Affero GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. A commercial license can be purchased by contacting sales@baliance.com.
Index ¶
- type Borders
- type Cell
- func (c Cell) GetValue() (string, error)
- func (c Cell) SetBool(v bool)
- func (c Cell) SetFormulaRaw(s string)
- func (c Cell) SetInlineString(s string)
- func (c Cell) SetNumber(v float64)
- func (c Cell) SetString(s string) int
- func (c Cell) SetStringByID(id int)
- func (c Cell) SetStyle(cs CellStyle)
- func (c Cell) X() *sml.CT_Cell
- type CellStyle
- func (cs CellStyle) ClearFont()
- func (cs CellStyle) Index() uint32
- func (cs CellStyle) SetFill(f Fill)
- func (cs CellStyle) SetFont(f Font)
- func (cs CellStyle) SetHorizontalAlignment(a sml.ST_HorizontalAlignment)
- func (cs CellStyle) SetShrinkToFit(b bool)
- func (cs CellStyle) SetVerticalAlignment(a sml.ST_VerticalAlignment)
- func (cs CellStyle) SetWrapped(b bool)
- func (cs CellStyle) Wrapped() bool
- type Fill
- type Fills
- type Font
- type PatternFill
- type Row
- type SharedStrings
- type Sheet
- type StyleSheet
- type Workbook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Borders ¶
type Borders struct {
// contains filtered or unexported fields
}
func NewBorders ¶
func NewBorders() Borders
func (Borders) X ¶
func (b Borders) X() *sml.CT_Borders
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Cell is a single cell within a sheet.
func (Cell) SetBool ¶
SetBool sets the cell type to boolean and the value to the given boolean value.
func (Cell) SetFormulaRaw ¶
SetFormulaRaw sets the cell type to formula, and the raw formula to the given string
func (Cell) SetInlineString ¶
SetInlineString adds a string inline instead of in the shared strings table.
func (Cell) SetString ¶
SetString sets the cell type to string, and the value to the given string, returning an ID from the shared strings table. To reuse a string, call SetStringByID with the ID returned.
func (Cell) SetStringByID ¶
SetStringByID sets the cell type to string, and the value a string in the shared strings table.
type CellStyle ¶
type CellStyle struct {
// contains filtered or unexported fields
}
CellStyle is a formatting style for a cell. CellStyles are spreadsheet global and can be applied to cells across sheets.
func (CellStyle) SetHorizontalAlignment ¶
func (cs CellStyle) SetHorizontalAlignment(a sml.ST_HorizontalAlignment)
SetHorizontalAlignment sets the horizontal alignment of a cell style.
func (CellStyle) SetShrinkToFit ¶
func (CellStyle) SetVerticalAlignment ¶
func (cs CellStyle) SetVerticalAlignment(a sml.ST_VerticalAlignment)
SetVerticalAlignment sets the vertical alignment of a cell style.
func (CellStyle) SetWrapped ¶
SetWrapped configures the cell to wrap text.
type Fills ¶
type Fills struct {
// contains filtered or unexported fields
}
func (Fills) AddPatternFill ¶
func (f Fills) AddPatternFill() PatternFill
type Font ¶
type Font struct {
// contains filtered or unexported fields
}
Font allows editing fonts within a spreadsheet stylesheet.
type PatternFill ¶
type PatternFill struct {
Fill
}
func NewPatternFill ¶
func NewPatternFill(fills *sml.CT_Fills) PatternFill
func (PatternFill) ClearBgColor ¶
func (f PatternFill) ClearBgColor()
func (PatternFill) ClearFgColor ¶
func (f PatternFill) ClearFgColor()
func (PatternFill) SetBgColor ¶
func (f PatternFill) SetBgColor(c color.Color)
func (PatternFill) SetFgColor ¶
func (f PatternFill) SetFgColor(c color.Color)
SetFgColor sets the *fill* foreground color. As an example, the solid pattern foreground color becomes the background color of the cell when applied.
func (PatternFill) SetPattern ¶
func (f PatternFill) SetPattern(p sml.ST_PatternType)
SetPattern sets the pattern of the fill.
func (PatternFill) X ¶
func (f PatternFill) X() *sml.CT_Fill
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row is a row within a spreadsheet.
func (Row) SetHeight ¶
func (r Row) SetHeight(d measurement.Distance)
SetHeight sets the row height in points.
func (Row) SetHeightAuto ¶
func (r Row) SetHeightAuto()
SetHeightAuto sets the row height to be automatically determined.
type SharedStrings ¶
type SharedStrings struct {
// contains filtered or unexported fields
}
SharedStrings is a shared strings table, where string data can be placed outside of the sheet contents and referenced from a sheet.
func NewSharedStrings ¶
func NewSharedStrings() SharedStrings
NewSharedStrings constructs a new Shared Strings table.
func (SharedStrings) AddString ¶
func (s SharedStrings) AddString(v string) int
AddString adds a string to the shared string cache.
type Sheet ¶
type Sheet struct {
// contains filtered or unexported fields
}
Sheet is a single sheet within a workbook.
func (Sheet) Validate ¶
Validate validates the sheet, returning an error if it is found to be invalid.
func (Sheet) ValidateWithPath ¶
ValidateWithPath validates the sheet passing path informaton for a better error message
type StyleSheet ¶
type StyleSheet struct {
// contains filtered or unexported fields
}
StyleSheet is a document style sheet.
func NewStyleSheet ¶
func NewStyleSheet() StyleSheet
NewStyleSheet constructs a new default stylesheet.
func (StyleSheet) AddCellStyle ¶
func (s StyleSheet) AddCellStyle() CellStyle
AddCellStyle adds a new empty cell style to the stylesheet.
func (StyleSheet) AddFont ¶
func (s StyleSheet) AddFont() Font
AddFont adds a new empty font to the stylesheet.
func (StyleSheet) Fills ¶
func (s StyleSheet) Fills() Fills
Fills returns a Fills object that can be used to add/create/edit fills.
func (StyleSheet) Fonts ¶
func (s StyleSheet) Fonts() []Font
Fonts returns the list of fonts defined in the stylesheet.
func (StyleSheet) RemoveFont ¶
func (s StyleSheet) RemoveFont(f Font) error
RemoveFont removes a font from the style sheet. It *does not* update styles that refer to this font.
func (StyleSheet) X ¶
func (s StyleSheet) X() *sml.StyleSheet
X returns the innter XML entity for a stylesheet.
type Workbook ¶
type Workbook struct { common.DocBase StyleSheet StyleSheet // contains filtered or unexported fields }
Workbook is the top level container item for a set of spreadsheets.
func (*Workbook) SaveToFile ¶
SaveToFile writes the workbook out to a file.
func (Workbook) SheetCount ¶
SheetCount returns the number of sheets in the workbook.