Documentation
¶
Overview ¶
Copyright 2017 FoxyUtils ehf. All rights reserved.
Use of this software package and source code is governed by the terms of the UniDoc End User License Agreement (EULA) that is available at: https://unidoc.io/eula/ A trial license code for evaluation can be obtained at https://unidoc.io.
Index ¶
- Constants
- Variables
- func PasswordHash(s string) string
- type AbsoluteAnchor
- func (_cdf AbsoluteAnchor) BottomRight() CellMarker
- func (_ddd AbsoluteAnchor) MoveTo(x, y int32)
- func (_aa AbsoluteAnchor) SetColOffset(m _ac.Distance)
- func (_ae AbsoluteAnchor) SetHeight(h _ac.Distance)
- func (_cf AbsoluteAnchor) SetHeightCells(int32)
- func (_ed AbsoluteAnchor) SetRowOffset(m _ac.Distance)
- func (_fe AbsoluteAnchor) SetWidth(w _ac.Distance)
- func (_af AbsoluteAnchor) SetWidthCells(int32)
- func (_fg AbsoluteAnchor) TopLeft() CellMarker
- func (_eba AbsoluteAnchor) Type() AnchorType
- type Anchor
- type AnchorType
- type Border
- func (_be Border) Index() uint32
- func (_egbd Border) InitializeDefaults()
- func (_fb Border) SetBottom(style _agf.ST_BorderStyle, c _cb.Color)
- func (_cfd Border) SetDiagonal(style _agf.ST_BorderStyle, c _cb.Color, up, down bool)
- func (_df Border) SetLeft(style _agf.ST_BorderStyle, c _cb.Color)
- func (_ecc Border) SetRight(style _agf.ST_BorderStyle, c _cb.Color)
- func (_gg Border) SetTop(style _agf.ST_BorderStyle, c _cb.Color)
- func (_bbg Border) X() *_agf.CT_Border
- type Cell
- func (_dfcb Cell) AddHyperlink(url string)
- func (_efd Cell) Clear()
- func (_ebd Cell) Column() (string, error)
- func (_cceg Cell) GetCachedFormulaResult() string
- func (_ebac Cell) GetFormattedValue() string
- func (_cbec Cell) GetFormula() string
- func (_dbc Cell) GetRawValue() (string, error)
- func (_fcg Cell) GetString() string
- func (_ddb Cell) GetValueAsBool() (bool, error)
- func (_ebb Cell) GetValueAsNumber() (float64, error)
- func (_cgd Cell) GetValueAsTime() (_ea.Time, error)
- func (_dgaf Cell) HasFormula() bool
- func (_gge Cell) IsBool() bool
- func (_cfcc Cell) IsEmpty() bool
- func (_cafe Cell) IsError() bool
- func (_ged Cell) IsNumber() bool
- func (_aca Cell) Reference() string
- func (_afe Cell) SetBool(v bool)
- func (_gdge Cell) SetCachedFormulaResult(s string)
- func (_abd Cell) SetDate(d _ea.Time)
- func (_afd Cell) SetDateWithStyle(d _ea.Time)
- func (_bcbb Cell) SetError(msg string)
- func (_bg Cell) SetFormulaArray(s string)
- func (_fbd Cell) SetFormulaRaw(s string)
- func (_cad Cell) SetFormulaShared(formulaStr string, rows, cols uint32) error
- func (_fae Cell) SetHyperlink(hl _dag.Hyperlink)
- func (_dfd Cell) SetInlineString(s string)
- func (_ccd Cell) SetNumber(v float64)
- func (_bdg Cell) SetNumberWithStyle(v float64, f StandardFormat)
- func (_bcf Cell) SetRichTextString() RichText
- func (_ggd Cell) SetString(s string) int
- func (_fcf Cell) SetStringByID(id int)
- func (_gfg Cell) SetStyle(cs CellStyle)
- func (_dce Cell) SetStyleIndex(idx uint32)
- func (_bfd Cell) SetTime(d _ea.Time)
- func (_cde Cell) X() *_agf.CT_Cell
- type CellMarker
- func (_bfc CellMarker) Col() int32
- func (_dac CellMarker) ColOffset() _ac.Distance
- func (_caa CellMarker) Row() int32
- func (_fgd CellMarker) RowOffset() _ac.Distance
- func (_ffg CellMarker) SetCol(col int32)
- func (_dbfd CellMarker) SetColOffset(m _ac.Distance)
- func (_geee CellMarker) SetRow(row int32)
- func (_gga CellMarker) SetRowOffset(m _ac.Distance)
- func (_fef CellMarker) X() *_cgg.CT_Marker
- type CellStyle
- func (_cda CellStyle) ClearBorder()
- func (_acde CellStyle) ClearFill()
- func (_eca CellStyle) ClearFont()
- func (_affg CellStyle) ClearNumberFormat()
- func (_dff CellStyle) GetBorder() *_agf.CT_Border
- func (_cbbg CellStyle) GetFill() *_agf.CT_Fill
- func (_gdd CellStyle) GetFont() *_agf.CT_Font
- func (_eaad CellStyle) GetHorizontalAlignment() _agf.ST_HorizontalAlignment
- func (_gcgb CellStyle) GetVerticalAlignment() _agf.ST_VerticalAlignment
- func (_bgf CellStyle) HasNumberFormat() bool
- func (_dfb CellStyle) Index() uint32
- func (_aec CellStyle) IsEmpty() bool
- func (_fbc CellStyle) NumberFormat() uint32
- func (_ece CellStyle) SetBorder(b Border)
- func (_dae CellStyle) SetFill(f Fill)
- func (_bdef CellStyle) SetFont(f Font)
- func (_cge CellStyle) SetHorizontalAlignment(a _agf.ST_HorizontalAlignment)
- func (_gaa CellStyle) SetNumberFormat(s string)
- func (_cff CellStyle) SetNumberFormatStandard(s StandardFormat)
- func (_cfdg CellStyle) SetProtection(protected bool, hidden bool)
- func (_fee CellStyle) SetRotation(deg uint8)
- func (_gbga CellStyle) SetShrinkToFit(b bool)
- func (_bee CellStyle) SetVerticalAlignment(a _agf.ST_VerticalAlignment)
- func (_faa CellStyle) SetWrapped(b bool)
- func (_aag CellStyle) Wrapped() bool
- type CellText
- type ColorScale
- type Column
- type Comment
- type Comments
- type Comparer
- type ConditionalFormatting
- type ConditionalFormattingRule
- func (_edcf ConditionalFormattingRule) InitializeDefaults()
- func (_gca ConditionalFormattingRule) Operator() _agf.ST_ConditionalFormattingOperator
- func (_fag ConditionalFormattingRule) Priority() int32
- func (_ced ConditionalFormattingRule) SetColorScale() ColorScale
- func (_ggfd ConditionalFormattingRule) SetConditionValue(v string)
- func (_cfdga ConditionalFormattingRule) SetDataBar() DataBarScale
- func (_bfcc ConditionalFormattingRule) SetIcons() IconScale
- func (_daee ConditionalFormattingRule) SetOperator(t _agf.ST_ConditionalFormattingOperator)
- func (_aebc ConditionalFormattingRule) SetPriority(p int32)
- func (_fde ConditionalFormattingRule) SetStyle(d DifferentialStyle)
- func (_cag ConditionalFormattingRule) SetType(t _agf.ST_CfType)
- func (_gfd ConditionalFormattingRule) Type() _agf.ST_CfType
- func (_fgeb ConditionalFormattingRule) X() *_agf.CT_CfRule
- type DVCompareOp
- type DVCompareType
- type DataBarScale
- func (_eceac DataBarScale) AddFormatValue(t _agf.ST_CfvoType, val string)
- func (_eaba DataBarScale) SetColor(c _cb.Color)
- func (_cfe DataBarScale) SetMaxLength(l uint32)
- func (_gead DataBarScale) SetMinLength(l uint32)
- func (_acb DataBarScale) SetShowValue(b bool)
- func (_fea DataBarScale) X() *_agf.CT_DataBar
- type DataValidation
- func (_aba DataValidation) SetAllowBlank(b bool)
- func (_dgb DataValidation) SetComparison(t DVCompareType, op DVCompareOp) DataValidationCompare
- func (_eae DataValidation) SetList() DataValidationList
- func (_egd DataValidation) SetRange(cellRange string)
- func (_bfdc DataValidation) X() *_agf.CT_DataValidation
- type DataValidationCompare
- type DataValidationList
- type DefinedName
- type DifferentialStyle
- type Drawing
- type Fill
- type Fills
- type Font
- type IconScale
- type MergedCell
- type NumberFormat
- type OneCellAnchor
- func (_ffgd OneCellAnchor) BottomRight() CellMarker
- func (_ggfb OneCellAnchor) MoveTo(col, row int32)
- func (_gggd OneCellAnchor) SetColOffset(m _ac.Distance)
- func (_acag OneCellAnchor) SetHeight(h _ac.Distance)
- func (_daabf OneCellAnchor) SetHeightCells(int32)
- func (_agb OneCellAnchor) SetRowOffset(m _ac.Distance)
- func (_gbbf OneCellAnchor) SetWidth(w _ac.Distance)
- func (_aeac OneCellAnchor) SetWidthCells(int32)
- func (_ccgd OneCellAnchor) TopLeft() CellMarker
- func (_abdb OneCellAnchor) Type() AnchorType
- type PatternFill
- type RichText
- type RichTextRun
- func (_bdec RichTextRun) SetBold(b bool)
- func (_ebe RichTextRun) SetColor(c _cb.Color)
- func (_bfa RichTextRun) SetFont(s string)
- func (_gedc RichTextRun) SetItalic(b bool)
- func (_gbd RichTextRun) SetSize(m _ac.Distance)
- func (_cggbe RichTextRun) SetText(s string)
- func (_aed RichTextRun) SetUnderline(u _agf.ST_UnderlineValues)
- func (_afef RichTextRun) X() *_agf.CT_RElt
- type Row
- func (_bae Row) AddCell() Cell
- func (_fecf Row) AddNamedCell(col string) Cell
- func (_bfeg Row) Cell(col string) Cell
- func (_eadgb Row) Cells() []Cell
- func (_baba Row) CellsWithEmpty(lastColIdx uint32) []Cell
- func (_fggd Row) IsHidden() bool
- func (_cfbb Row) RowNumber() uint32
- func (_fgfa Row) SetHeight(d _ac.Distance)
- func (_baad Row) SetHeightAuto()
- func (_eeeb Row) SetHidden(hidden bool)
- func (_fbfb Row) X() *_agf.CT_Row
- type SharedStrings
- type Sheet
- func (_fbff *Sheet) AddConditionalFormatting(cellRanges []string) ConditionalFormatting
- func (_beaca *Sheet) AddDataValidation() DataValidation
- func (_cbfa *Sheet) AddHyperlink(url string) _dag.Hyperlink
- func (_eff *Sheet) AddMergedCells(fromRef, toRef string) MergedCell
- func (_fbgd *Sheet) AddNumberedRow(rowNum uint32) Row
- func (_geade *Sheet) AddRow() Row
- func (_fbag *Sheet) AddView() SheetView
- func (_dbab *Sheet) Cell(cellRef string) Cell
- func (_cabb *Sheet) ClearAutoFilter()
- func (_cbge *Sheet) ClearCachedFormulaResults()
- func (_gfff *Sheet) ClearProtection()
- func (_agad *Sheet) ClearSheetViews()
- func (_dgee *Sheet) Column(idx uint32) Column
- func (_eddf *Sheet) Comments() Comments
- func (_aacg Sheet) Extents() string
- func (_fcgg Sheet) ExtentsIndex() (string, uint32, string, uint32)
- func (_bebab *Sheet) ExtractText() *SheetText
- func (_cbfeb *Sheet) FormulaContext() _ef.Context
- func (_cacd *Sheet) GetDrawing() (*_cgg.WsDr, _dag.Relationships)
- func (_cfegd *Sheet) InitialView() SheetView
- func (_cadd *Sheet) InsertRow(rowNum int) Row
- func (_bgff Sheet) IsValid() bool
- func (_ada Sheet) MaxColumnIdx() uint32
- func (_daae *Sheet) MergedCells() []MergedCell
- func (_dddb Sheet) Name() string
- func (_bfae *Sheet) Protection() SheetProtection
- func (_fcaa Sheet) RangeReference(n string) string
- func (_abae *Sheet) RecalculateFormulas()
- func (_cgaa *Sheet) RemoveColumn(column string) error
- func (_affb *Sheet) RemoveMergedCell(mc MergedCell)
- func (_aeaa *Sheet) Row(rowNum uint32) Row
- func (_dcfb *Sheet) Rows() []Row
- func (_gbgag *Sheet) SetAutoFilter(rangeRef string)
- func (_fefg *Sheet) SetBorder(cellRange string, border Border) error
- func (_efgcc *Sheet) SetDrawing(d Drawing)
- func (_facbd *Sheet) SetFrozen(firstRow, firstCol bool)
- func (_cdcda *Sheet) SetName(name string)
- func (_bgec *Sheet) SheetViews() []SheetView
- func (_cccae *Sheet) Sort(column string, firstRow uint32, order SortOrder)
- func (_ebbb Sheet) Validate() error
- func (_aeba Sheet) ValidateWithPath(path string) error
- func (_afbe *Sheet) Workbook() *Workbook
- func (_dagd Sheet) X() *_agf.Worksheet
- type SheetProtection
- func (_cgcf SheetProtection) IsObjectLocked() bool
- func (_gbcc SheetProtection) IsSheetLocked() bool
- func (_cgda SheetProtection) LockObject(b bool)
- func (_gbaaa SheetProtection) LockSheet(b bool)
- func (_gdcdc SheetProtection) PasswordHash() string
- func (_edff SheetProtection) SetPassword(pw string)
- func (_gce SheetProtection) SetPasswordHash(pwHash string)
- func (_ggadb SheetProtection) X() *_agf.CT_SheetProtection
- type SheetText
- type SheetView
- func (_gccfb SheetView) SetShowRuler(b bool)
- func (_ccaf SheetView) SetState(st _agf.ST_PaneState)
- func (_cagbb SheetView) SetTopLeft(cellRef string)
- func (_baab SheetView) SetXSplit(v float64)
- func (_dgfc SheetView) SetYSplit(v float64)
- func (_bgbg SheetView) SetZoom(pct uint32)
- func (_faf SheetView) X() *_agf.CT_SheetView
- type SortOrder
- type StandardFormat
- type StyleSheet
- func (_eeac StyleSheet) AddBorder() Border
- func (_afab StyleSheet) AddCellStyle() CellStyle
- func (_dcef StyleSheet) AddDifferentialStyle() DifferentialStyle
- func (_cbbcg StyleSheet) AddFont() Font
- func (_cbce StyleSheet) AddNumberFormat() NumberFormat
- func (_cebc StyleSheet) Borders() []Border
- func (_bfad StyleSheet) CellStyles() []CellStyle
- func (_ecaf StyleSheet) Fills() Fills
- func (_fcaad StyleSheet) Fonts() []Font
- func (_egcb StyleSheet) GetCellStyle(id uint32) CellStyle
- func (_fcda StyleSheet) GetNumberFormat(id uint32) NumberFormat
- func (_fefca StyleSheet) GetOrCreateStandardNumberFormat(f StandardFormat) CellStyle
- func (_aaca StyleSheet) RemoveFont(f Font) error
- func (_aaedg StyleSheet) X() *_agf.StyleSheet
- type Table
- type TwoCellAnchor
- func (_cebe TwoCellAnchor) BottomRight() CellMarker
- func (_ebed TwoCellAnchor) MoveTo(col, row int32)
- func (_dbee TwoCellAnchor) SetColOffset(m _ac.Distance)
- func (_fed TwoCellAnchor) SetHeight(h _ac.Distance)
- func (_ggabg TwoCellAnchor) SetHeightCells(h int32)
- func (_bcgd TwoCellAnchor) SetRowOffset(m _ac.Distance)
- func (_abga TwoCellAnchor) SetWidth(w _ac.Distance)
- func (_fgee TwoCellAnchor) SetWidthCells(w int32)
- func (_daece TwoCellAnchor) TopLeft() CellMarker
- func (_dgddc TwoCellAnchor) Type() AnchorType
- type Workbook
- func (_fecec *Workbook) AddDefinedName(name, ref string) DefinedName
- func (_bada *Workbook) AddDrawing() Drawing
- func (_ddgg *Workbook) AddImage(i _dag.Image) (_dag.ImageRef, error)
- func (_gacg *Workbook) AddSheet() Sheet
- func (_cbab *Workbook) ClearCachedFormulaResults()
- func (_gabb *Workbook) ClearProtection()
- func (_bfegd *Workbook) Close() error
- func (_bbadg *Workbook) CopySheet(ind int, copiedSheetName string) (Sheet, error)
- func (_caaa *Workbook) CopySheetByName(name, copiedSheetName string) (Sheet, error)
- func (_dgfcf *Workbook) DeepCopySheet(ind int, copiedSheetName string) (Sheet, error)
- func (_fegc *Workbook) DeepCopySheetByName(name, copiedSheetName string) (Sheet, error)
- func (_afec *Workbook) DefinedNames() []DefinedName
- func (_aebeb *Workbook) Epoch() _ea.Time
- func (_ffad *Workbook) ExtractText() *WorkbookText
- func (_aega *Workbook) GetChartByTargetId(targetAttr string) *_efe.ChartSpace
- func (_decfa *Workbook) GetFilename() string
- func (_ggbcd *Workbook) GetSheet(name string) (Sheet, error)
- func (_agga *Workbook) Protection() WorkbookProtection
- func (_adea *Workbook) RecalculateFormulas()
- func (_cfccd *Workbook) RemoveCalcChain()
- func (_gdce *Workbook) RemoveDefinedName(dn DefinedName) error
- func (_fega *Workbook) RemoveSheet(ind int) error
- func (_cae *Workbook) RemoveSheetByName(name string) error
- func (_aefe *Workbook) Save(w _bd.Writer) error
- func (_dgef *Workbook) SaveToFile(path string) error
- func (_ecfca *Workbook) SetActiveSheet(s Sheet)
- func (_feeb *Workbook) SetActiveSheetIndex(idx uint32)
- func (_ebcd Workbook) SheetCount() int
- func (_acfb *Workbook) Sheets() []Sheet
- func (_facbg *Workbook) Tables() []Table
- func (_fdfb *Workbook) Themes() []*_efb.Theme
- func (_bfadf *Workbook) Uses1904Dates() bool
- func (_beceg *Workbook) Validate() error
- func (_gcbg *Workbook) X() *_agf.Workbook
- type WorkbookProtection
- func (_ggbg WorkbookProtection) IsStructureLocked() bool
- func (_acfe WorkbookProtection) IsWindowLocked() bool
- func (_ccef WorkbookProtection) LockStructure(b bool)
- func (_fbggg WorkbookProtection) LockWindow(b bool)
- func (_ddcbe WorkbookProtection) PasswordHash() string
- func (_aggb WorkbookProtection) SetPassword(pw string)
- func (_dcefd WorkbookProtection) SetPasswordHash(pwHash string)
- func (_eagdd WorkbookProtection) X() *_agf.CT_WorkbookProtection
- type WorkbookText
Constants ¶
const ( DVCompareTypeWholeNumber = DVCompareType(_agf.ST_DataValidationTypeWhole) DVCompareTypeDecimal = DVCompareType(_agf.ST_DataValidationTypeDecimal) DVCompareTypeDate = DVCompareType(_agf.ST_DataValidationTypeDate) DVCompareTypeTime = DVCompareType(_agf.ST_DataValidationTypeTime) DVompareTypeTextLength = DVCompareType(_agf.ST_DataValidationTypeTextLength) )
const ( DVCompareOpEqual = DVCompareOp(_agf.ST_DataValidationOperatorEqual) DVCompareOpBetween = DVCompareOp(_agf.ST_DataValidationOperatorBetween) DVCompareOpNotBetween = DVCompareOp(_agf.ST_DataValidationOperatorNotBetween) DVCompareOpNotEqual = DVCompareOp(_agf.ST_DataValidationOperatorNotEqual) DVCompareOpGreater = DVCompareOp(_agf.ST_DataValidationOperatorGreaterThan) DVCompareOpGreaterEqual = DVCompareOp(_agf.ST_DataValidationOperatorGreaterThanOrEqual) DVCompareOpLess = DVCompareOp(_agf.ST_DataValidationOperatorLessThan) DVCompareOpLessEqual = DVCompareOp(_agf.ST_DataValidationOperatorLessThanOrEqual) )
const (
DVOpGreater = _agf.ST_DataValidationOperatorGreaterThanOrEqual
)
Variables ¶
var ErrorNotFound = _dg.New("\u006eo\u0074\u0020\u0066\u006f\u0075\u006ed")
Functions ¶
func PasswordHash ¶
PasswordHash returns the password hash for a workbook using the modified spreadsheetML password hash that is compatible with Excel.
Types ¶
type AbsoluteAnchor ¶
type AbsoluteAnchor struct {
// contains filtered or unexported fields
}
AbsoluteAnchor has a fixed top-left corner in distance units as well as a fixed height/width.
func (AbsoluteAnchor) BottomRight ¶
func (_cdf AbsoluteAnchor) BottomRight() CellMarker
BottomRight is a no-op.
func (AbsoluteAnchor) SetColOffset ¶
func (_aa AbsoluteAnchor) SetColOffset(m _ac.Distance)
SetColOffset sets the column offset of the top-left of the image in fixed units.
func (AbsoluteAnchor) SetHeight ¶
func (_ae AbsoluteAnchor) SetHeight(h _ac.Distance)
SetHeight sets the height of the anchored object.
func (AbsoluteAnchor) SetHeightCells ¶
func (_cf AbsoluteAnchor) SetHeightCells(int32)
SetHeightCells is a no-op.
func (AbsoluteAnchor) SetRowOffset ¶
func (_ed AbsoluteAnchor) SetRowOffset(m _ac.Distance)
SetRowOffset sets the row offset of the top-left of the image in fixed units.
func (AbsoluteAnchor) SetWidth ¶
func (_fe AbsoluteAnchor) SetWidth(w _ac.Distance)
SetWidth sets the width of the anchored object.
func (AbsoluteAnchor) SetWidthCells ¶
func (_af AbsoluteAnchor) SetWidthCells(int32)
SetWidthCells is a no-op.
func (AbsoluteAnchor) Type ¶
func (_eba AbsoluteAnchor) Type() AnchorType
Type returns the type of anchor
type Anchor ¶
type Anchor interface {
// BottomRight returns the CellMaker for the bottom right corner of the
// anchor.
BottomRight() CellMarker
// TopLeft returns the CellMaker for the top left corner of the anchor.
TopLeft() CellMarker
// MoveTo repositions the anchor without changing the objects size.
MoveTo(_cce, _ddgd int32)
// SetWidth sets the width of the anchored object. It is not compatible with
// SetWidthCells.
SetWidth(_ad _ac.Distance)
// SetWidthCells sets the height the anchored object by moving the right
// hand side. It is not compatible with SetWidth.
SetWidthCells(_gd int32)
// SetHeight sets the height of the anchored object. It is not compatible
// with SetHeightCells.
SetHeight(_daa _ac.Distance)
// SetHeightCells sets the height the anchored object by moving the bottom.
// It is not compatible with SetHeight.
SetHeightCells(_fd int32)
// SetColOffset sets the column offset of the top-left anchor.
SetColOffset(_ccc _ac.Distance)
// SetRowOffset sets the row offset of the top-left anchor.
SetRowOffset(_egb _ac.Distance)
// Type returns the type of anchor
Type() AnchorType
}
Anchor is the interface implemented by anchors. It's modeled after the most common anchor (Two cell variant with a from/to position), but will also be used for one-cell anchors. In that case the only non-noop methods are TopLeft/MoveTo/SetColOffset/SetRowOffset.
type AnchorType ¶
type AnchorType byte
AnchorType is the type of anchor.
const ( AnchorTypeAbsolute AnchorType = iota AnchorTypeOneCell AnchorTypeTwoCell )
type Border ¶
type Border struct {
// contains filtered or unexported fields
}
Border is a cell border configuraton.
func (Border) InitializeDefaults ¶
func (_egbd Border) InitializeDefaults()
InitializeDefaults initializes a border to its defaulte empty values.
func (Border) SetDiagonal ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Cell is a single cell within a sheet.
func (Cell) AddHyperlink ¶
AddHyperlink creates and sets a hyperlink on a cell.
func (Cell) GetCachedFormulaResult ¶
GetCachedFormulaResult returns the cached formula result if it exists. If the cell type is not a formula cell, the result will be the cell value if it's a string/number/bool cell.
func (Cell) GetFormattedValue ¶
GetFormattedValue returns the formatted cell value as it would appear in Excel. This involves determining the format string to apply, parsing it, and then formatting the value according to the format string. This should only be used if you care about replicating what Excel would show, otherwise GetValueAsNumber()/GetValueAsTime
func (Cell) GetFormula ¶
GetFormula returns the formula for a cell.
func (Cell) GetRawValue ¶
func (Cell) GetString ¶
GetString returns the string in a cell if it's an inline or string table string. Otherwise it returns an empty string.
func (Cell) GetValueAsBool ¶
GetValueAsBool retrieves the cell's value as a boolean
func (Cell) GetValueAsNumber ¶
GetValueAsNumber retrieves the cell's value as a number
func (Cell) GetValueAsTime ¶
GetValueAsTime retrieves the cell's value as a time. There is no difference in SpreadsheetML between a time/date cell other than formatting, and that typically a date cell won't have a fractional component. GetValueAsTime will work for date cells as well.
func (Cell) HasFormula ¶
HasFormula returns true if the cell has an asoociated formula.
func (Cell) Reference ¶
Reference returns the cell reference (e.g. "A4"). This is not required, however both gooffice and Excel will always set it.
func (Cell) SetBool ¶
SetBool sets the cell type to boolean and the value to the given boolean value.
func (Cell) SetCachedFormulaResult ¶
SetCachedFormulaResult sets the cached result of a formula. This is normally not needed but is used internally when expanding an array formula.
func (Cell) SetDate ¶
SetDate sets the cell value to a date. It's stored as the number of days past th sheet epoch. When we support v5 strict, we can store an ISO 8601 date string directly, however that's not allowed with v5 transitional (even though it works in Excel). The cell is not styled via this method, so it will display as a number. SetDateWithStyle should normally be used instead.
func (Cell) SetDateWithStyle ¶
SetDateWithStyle sets a date with the default date style applied.
func (Cell) SetError ¶
SetError sets the cell type to error and the value to the given error message.
func (Cell) SetFormulaArray ¶
SetFormulaArray sets the cell type to formula array, and the raw formula to the given string. This is equivlent to entering a formula and pressing Ctrl+Shift+Enter in Excel.
func (Cell) SetFormulaRaw ¶
SetFormulaRaw sets the cell type to formula, and the raw formula to the given string
func (Cell) SetFormulaShared ¶
SetFormulaShared sets the cell type to formula shared, and the raw formula to the given string. The range is the range of cells that the formula applies to, and is used to conserve disk space.
func (Cell) SetHyperlink ¶
SetHyperlink sets a hyperlink on a cell.
func (Cell) SetInlineString ¶
SetInlineString adds a string inline instead of in the shared strings table.
func (Cell) SetNumberWithStyle ¶
func (_bdg Cell) SetNumberWithStyle(v float64, f StandardFormat)
SetNumberWithStyle sets a number and applies a standard format to the cell.
func (Cell) SetRichTextString ¶
SetRichTextString sets the cell to rich string mode and returns a struct that can be used to add formatted text to the cell.
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.
func (Cell) SetStyle ¶
SetStyle applies a style to a cell avoiding redundancy. The function checks if the given style already exists in the saved styles. If found, the existing style is reused; otherwise, the new style is added to the saved styles collection. The style is then applied to the cell. This style is referenced in the generated XML via CellStyle.Index().
func (Cell) SetStyleIndex ¶
SetStyleIndex directly sets a style index to the cell. This should only be called with an index retrieved from CellStyle.Index()
type CellMarker ¶
type CellMarker struct {
// contains filtered or unexported fields
}
CellMarker represents a cell position
func (CellMarker) Col ¶
func (_bfc CellMarker) Col() int32
Col returns the column of the cell marker.
func (CellMarker) ColOffset ¶
func (_dac CellMarker) ColOffset() _ac.Distance
ColOffset returns the offset from the row cell.
func (CellMarker) RowOffset ¶
func (_fgd CellMarker) RowOffset() _ac.Distance
RowOffset returns the offset from the row cell.
func (CellMarker) SetCol ¶
func (_ffg CellMarker) SetCol(col int32)
SetCol set the column of the cell marker.
func (CellMarker) SetColOffset ¶
func (_dbfd CellMarker) SetColOffset(m _ac.Distance)
SetColOffset sets a column offset in absolute distance.
func (CellMarker) SetRow ¶
func (_geee CellMarker) SetRow(row int32)
SetRow set the row of the cell marker.
func (CellMarker) SetRowOffset ¶
func (_gga CellMarker) SetRowOffset(m _ac.Distance)
SetRowOffset sets a column offset in absolute distance.
func (CellMarker) X ¶
func (_fef CellMarker) X() *_cgg.CT_Marker
X returns the inner wrapped XML type.
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) ClearBorder ¶
func (_cda CellStyle) ClearBorder()
ClearBorder clears any border configuration from the cell style.
func (CellStyle) ClearFill ¶
func (_acde CellStyle) ClearFill()
ClearFill clears any fill configuration from the cell style.
func (CellStyle) ClearFont ¶
func (_eca CellStyle) ClearFont()
ClearFont clears any font configuration from the cell style.
func (CellStyle) ClearNumberFormat ¶
func (_affg CellStyle) ClearNumberFormat()
ClearNumberFormat removes any number formatting from the style.
func (CellStyle) GetHorizontalAlignment ¶
func (_eaad CellStyle) GetHorizontalAlignment() _agf.ST_HorizontalAlignment
GetHorizontalAlignment sets the horizontal alignment of a cell style.
func (CellStyle) GetVerticalAlignment ¶
func (_gcgb CellStyle) GetVerticalAlignment() _agf.ST_VerticalAlignment
GetVerticalAlignment sets the vertical alignment of a cell style.
func (CellStyle) HasNumberFormat ¶
HasNumberFormat returns true if the cell style has a number format applied.
func (CellStyle) NumberFormat ¶
NumberFormat returns the number format that the cell style uses, or zero if it is not set.
func (CellStyle) SetBorder ¶
SetBorder applies a border to a cell style avoiding redundancy. The function checks if the given border already exists in the saved borders. If found, the existing border is reused; otherwise, the new border is added to the saved borders collection. The border is then applied to the cell style, affecting all styles that reference it by index.
func (CellStyle) SetFill ¶
SetFill applies a fill to a cell style avoiding redundancy. The function checks if the given fill already exists in the saved fills. If found, the existing fill is reused; otherwise, the new fill is added to the saved fills collection. The fill is then applied to the cell style, affecting all styles that reference it by index.
func (CellStyle) SetFont ¶
SetFont applies a font to a cell style avoiding redundancy. The function checks if the given font already exists in the saved fonts. If found, the existing font is reused; otherwise, the new font is added to the saved fonts collection. The font is then applied to the cell style, affecting all styles that reference it by index.
func (CellStyle) SetHorizontalAlignment ¶
func (_cge CellStyle) SetHorizontalAlignment(a _agf.ST_HorizontalAlignment)
SetHorizontalAlignment sets the horizontal alignment of a cell style.
func (CellStyle) SetNumberFormat ¶
SetNumberFormat applies a number format to a cell style avoiding redundancy. The function checks if the given string already exists in the saved number formats. If found, the existing number format is reused; otherwise, the new number format is added to the saved number formats collection. The number format is then applied to the cell style, affecting all styles that reference it by index.
func (CellStyle) SetNumberFormatStandard ¶
func (_cff CellStyle) SetNumberFormatStandard(s StandardFormat)
SetNumberFormatStandard sets the format based off of the ECMA 376 standard formats. These formats are standardized and don't need to be defined in the styles.
func (CellStyle) SetProtection ¶
SetProtectedAndHidden sets protected and hidden for given cellStyle
func (CellStyle) SetRotation ¶
SetRotation configures the cell to be rotated.
func (CellStyle) SetShrinkToFit ¶
func (CellStyle) SetVerticalAlignment ¶
func (_bee CellStyle) SetVerticalAlignment(a _agf.ST_VerticalAlignment)
SetVerticalAlignment sets the vertical alignment of a cell style.
func (CellStyle) SetWrapped ¶
SetWrapped configures the cell to wrap text.
type ColorScale ¶
type ColorScale struct {
// contains filtered or unexported fields
}
ColorScale colors a cell background based off of the cell value.
func (ColorScale) AddFormatValue ¶
func (_bab ColorScale) AddFormatValue(t _agf.ST_CfvoType, val string)
AddFormatValue adds a format value to be used to determine the cell background.
func (ColorScale) AddGradientStop ¶
func (_gfe ColorScale) AddGradientStop(color _cb.Color)
AddGradientStop adds a color gradient stop.
func (ColorScale) X ¶
func (_aeb ColorScale) X() *_agf.CT_ColorScale
X returns the inner wrapped XML type.
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
Column represents a column within a sheet. It's only used for formatting purposes, so it's possible to construct a sheet without configuring columns.
type Comment ¶
type Comment struct {
// contains filtered or unexported fields
}
Comment is a single comment within a sheet.
func (Comment) CellReference ¶
CellReference returns the cell reference within a sheet that a comment refers to (e.g. "A1")
func (Comment) SetAuthor ¶
SetAuthor sets the author of the comment. If the comment body contains the author's name (as is the case with Excel and Comments.AddCommentWithStyle, it will not be changed). This method only changes the metadata author of the comment.
func (Comment) SetCellReference ¶
SetCellReference sets the cell reference within a sheet that a comment refers to (e.g. "A1")
type Comments ¶
type Comments struct {
// contains filtered or unexported fields
}
Comments is the container for comments for a single sheet.
func MakeComments ¶
MakeComments constructs a new Comments wrapper.
func (Comments) AddComment ¶
AddComment adds a new comment and returns a RichText which will contain the styled comment text.
func (Comments) AddCommentWithStyle ¶
AddCommentWithStyle adds a new comment styled in a default way
type Comparer ¶
type Comparer struct{ Order SortOrder }
Comparer is used to compare rows based off a column and cells based off of their value.
type ConditionalFormatting ¶
type ConditionalFormatting struct {
// contains filtered or unexported fields
}
ConditionalFormatting controls the formatting styles and rules for a range of cells with the same conditional formatting.
func (ConditionalFormatting) AddRule ¶
func (_accb ConditionalFormatting) AddRule() ConditionalFormattingRule
AddRule adds and returns a new rule that can be configured.
func (ConditionalFormatting) X ¶
func (_bdd ConditionalFormatting) X() *_agf.CT_ConditionalFormatting
X returns the inner wrapped XML type.
type ConditionalFormattingRule ¶
type ConditionalFormattingRule struct {
// contains filtered or unexported fields
}
func (ConditionalFormattingRule) InitializeDefaults ¶
func (_edcf ConditionalFormattingRule) InitializeDefaults()
func (ConditionalFormattingRule) Operator ¶
func (_gca ConditionalFormattingRule) Operator() _agf.ST_ConditionalFormattingOperator
Operator returns the operator for the rule
func (ConditionalFormattingRule) Priority ¶
func (_fag ConditionalFormattingRule) Priority() int32
Priority returns the rule priority
func (ConditionalFormattingRule) SetColorScale ¶
func (_ced ConditionalFormattingRule) SetColorScale() ColorScale
SetColorScale configures the rule as a color scale, removing existing configuration.
func (ConditionalFormattingRule) SetConditionValue ¶
func (_ggfd ConditionalFormattingRule) SetConditionValue(v string)
SetConditionValue sets the condition value to be used for style applicaton.
func (ConditionalFormattingRule) SetDataBar ¶
func (_cfdga ConditionalFormattingRule) SetDataBar() DataBarScale
SetDataBar configures the rule as a data bar, removing existing configuration.
func (ConditionalFormattingRule) SetIcons ¶
func (_bfcc ConditionalFormattingRule) SetIcons() IconScale
SetIcons configures the rule as an icon scale, removing existing configuration.
func (ConditionalFormattingRule) SetOperator ¶
func (_daee ConditionalFormattingRule) SetOperator(t _agf.ST_ConditionalFormattingOperator)
SetOperator sets the operator for the rule.
func (ConditionalFormattingRule) SetPriority ¶
func (_aebc ConditionalFormattingRule) SetPriority(p int32)
SetPriority sets the rule priority
func (ConditionalFormattingRule) SetStyle ¶
func (_fde ConditionalFormattingRule) SetStyle(d DifferentialStyle)
SetStyle sets the style to be used for conditional rules
func (ConditionalFormattingRule) SetType ¶
func (_cag ConditionalFormattingRule) SetType(t _agf.ST_CfType)
SetType sets the type of the rule.
func (ConditionalFormattingRule) Type ¶
func (_gfd ConditionalFormattingRule) Type() _agf.ST_CfType
Type returns the type of the rule
func (ConditionalFormattingRule) X ¶
func (_fgeb ConditionalFormattingRule) X() *_agf.CT_CfRule
X returns the inner wrapped XML type.
type DVCompareOp ¶
type DVCompareOp byte
DVCompareOp is a comparison operator for a data validation rule.
type DVCompareType ¶
type DVCompareType byte
DVCompareType is a comparison type for a data validation rule. This restricts the input format of the cell.
type DataBarScale ¶
type DataBarScale struct {
// contains filtered or unexported fields
}
DataBarScale is a colored scale that fills the cell with a background gradeint depending on the value.
func (DataBarScale) AddFormatValue ¶
func (_eceac DataBarScale) AddFormatValue(t _agf.ST_CfvoType, val string)
AddFormatValue adds a format value (databars require two).
func (DataBarScale) SetColor ¶
func (_eaba DataBarScale) SetColor(c _cb.Color)
SetColor sets teh color of the databar.
func (DataBarScale) SetMaxLength ¶
func (_cfe DataBarScale) SetMaxLength(l uint32)
SetMaxLength sets the maximum bar length in percent.
func (DataBarScale) SetMinLength ¶
func (_gead DataBarScale) SetMinLength(l uint32)
SetMinLength sets the minimum bar length in percent.
func (DataBarScale) SetShowValue ¶
func (_acb DataBarScale) SetShowValue(b bool)
SetShowValue controls if the cell value is displayed.
func (DataBarScale) X ¶
func (_fea DataBarScale) X() *_agf.CT_DataBar
X returns the inner wrapped XML type.
type DataValidation ¶
type DataValidation struct {
// contains filtered or unexported fields
}
DataValidation controls cell validation
func (DataValidation) SetAllowBlank ¶
func (_aba DataValidation) SetAllowBlank(b bool)
SetAllowBlank controls if blank values are accepted.
func (DataValidation) SetComparison ¶
func (_dgb DataValidation) SetComparison(t DVCompareType, op DVCompareOp) DataValidationCompare
func (DataValidation) SetList ¶
func (_eae DataValidation) SetList() DataValidationList
func (DataValidation) SetRange ¶
func (_egd DataValidation) SetRange(cellRange string)
SetRange sets the cell or range of cells that the validation should apply to. It can be a single cell (e.g. "A1") or a range of cells (e.g. "A1:B5")
func (DataValidation) X ¶
func (_bfdc DataValidation) X() *_agf.CT_DataValidation
X returns the inner wrapped XML type.
type DataValidationCompare ¶
type DataValidationCompare struct {
// contains filtered or unexported fields
}
DataValidationCompare is a view on a data validation rule that is oriented towards value comparisons.
func (DataValidationCompare) SetValue ¶
func (_age DataValidationCompare) SetValue(v string)
SetValue sets the first value to be used in the comparison. For comparisons that need only one value, this is the only value used. For comparisons like 'between' that require two values, SetValue2 must also be used.
func (DataValidationCompare) SetValue2 ¶
func (_efgc DataValidationCompare) SetValue2(v string)
type DataValidationList ¶
type DataValidationList struct {
// contains filtered or unexported fields
}
DataValidationList is just a view on a DataValidation configured as a list. It presents a drop-down combo box for spreadsheet users to select values. The contents of the dropdown can either pull from a rang eof cells (SetRange) or specified directly (SetValues).
func (DataValidationList) SetRange ¶
func (_adg DataValidationList) SetRange(cellRange string)
SetRange sets the range that contains the possible values. This is incompatible with SetValues.
func (DataValidationList) SetValues ¶
func (_fgfd DataValidationList) SetValues(values []string)
SetValues sets the possible values. This is incompatible with SetRange.
type DefinedName ¶
type DefinedName struct {
// contains filtered or unexported fields
}
DefinedName is a named range, formula, etc.
func (DefinedName) Content ¶
func (_fgcg DefinedName) Content() string
Content returns the content of the defined range (the range in most cases)/
func (DefinedName) Name ¶
func (_ggdga DefinedName) Name() string
Name returns the name of the defined name.
func (DefinedName) SetContent ¶
func (_beac DefinedName) SetContent(s string)
SetContent sets the defined name content.
func (DefinedName) SetHidden ¶
func (_ffce DefinedName) SetHidden(b bool)
SetHidden marks the defined name as hidden.
func (DefinedName) SetLocalSheetID ¶
func (_gfed DefinedName) SetLocalSheetID(id uint32)
SetHidden marks the defined name as hidden.
func (DefinedName) X ¶
func (_bad DefinedName) X() *_agf.CT_DefinedName
X returns the inner wrapped XML type.
type DifferentialStyle ¶
type DifferentialStyle struct {
// contains filtered or unexported fields
}
func (DifferentialStyle) Fill ¶
func (_abaa DifferentialStyle) Fill() Fill
func (DifferentialStyle) Index ¶
func (_cee DifferentialStyle) Index() uint32
Index returns the index of the differential style.
func (DifferentialStyle) X ¶
func (_gaef DifferentialStyle) X() *_agf.CT_Dxf
X returns the inner wrapped XML type.
type Drawing ¶
type Drawing struct {
// contains filtered or unexported fields
}
Drawing is a drawing overlay on a sheet. Only a single drawing is allowed per sheet, so to display multiple charts and images on a single sheet, they must be added to the same drawing.
func (Drawing) AddChart ¶
func (_efc Drawing) AddChart(at AnchorType) (_gb.Chart, Anchor)
AddChart adds an chart to a drawing, returning the chart and an anchor that can be used to position the chart within the sheet.
type Fill ¶
type Fill struct {
// contains filtered or unexported fields
}
func (Fill) SetPatternFill ¶
func (_fbfd Fill) SetPatternFill() PatternFill
type Font ¶
type Font struct {
// contains filtered or unexported fields
}
Font allows editing fonts within a spreadsheet stylesheet.
type IconScale ¶
type IconScale struct {
// contains filtered or unexported fields
}
IconScale maps values to icons.
func (IconScale) AddFormatValue ¶
func (_fda IconScale) AddFormatValue(t _agf.ST_CfvoType, val string)
AddFormatValue adds a format value to be used in determining which icons to display.
func (IconScale) SetIcons ¶
func (_afc IconScale) SetIcons(t _agf.ST_IconSetType)
SetIcons sets the icon set to use for display.
func (IconScale) X ¶
func (_cagb IconScale) X() *_agf.CT_IconSet
X returns the inner wrapped XML type.
type MergedCell ¶
type MergedCell struct {
// contains filtered or unexported fields
}
func (MergedCell) Cell ¶
func (_geab MergedCell) Cell() Cell
Cell returns the actual cell behind the merged region
func (MergedCell) Reference ¶
func (_afcg MergedCell) Reference() string
Reference returns the region of cells that are merged.
func (MergedCell) SetReference ¶
func (_gbe MergedCell) SetReference(ref string)
SetReference sets the regin of cells that the merged cell applies to.
func (MergedCell) X ¶
func (_bdda MergedCell) X() *_agf.CT_MergeCell
X returns the inner wrapped XML type.
type NumberFormat ¶
type NumberFormat struct {
// contains filtered or unexported fields
}
NumberFormat is a number formatting string that can be applied to a cell style.
func CreateDefaultNumberFormat ¶
func CreateDefaultNumberFormat(id StandardFormat) NumberFormat
func (NumberFormat) GetFormat ¶
func (_bcbc NumberFormat) GetFormat() string
GetFormat sets the number format code.
func (NumberFormat) ID ¶
func (_cbbc NumberFormat) ID() uint32
ID returns the number format ID. This is not an index as there are some predefined number formats which can be used in cell styles and don't need a corresponding NumberFormat.
func (NumberFormat) SetFormat ¶
func (_dbgd NumberFormat) SetFormat(f string)
SetFormat sets the number format code.
func (NumberFormat) X ¶
func (_acf NumberFormat) X() *_agf.CT_NumFmt
X returns the inner wrapped XML type.
type OneCellAnchor ¶
type OneCellAnchor struct {
// contains filtered or unexported fields
}
OneCellAnchor is anchored to a top-left cell with a fixed with/height in distance.
func (OneCellAnchor) BottomRight ¶
func (_ffgd OneCellAnchor) BottomRight() CellMarker
BottomRight is a no-op.
func (OneCellAnchor) MoveTo ¶
func (_ggfb OneCellAnchor) MoveTo(col, row int32)
MoveTo moves the top-left of the anchored object.
func (OneCellAnchor) SetColOffset ¶
func (_gggd OneCellAnchor) SetColOffset(m _ac.Distance)
SetColOffset sets the column offset of the top-left anchor.
func (OneCellAnchor) SetHeight ¶
func (_acag OneCellAnchor) SetHeight(h _ac.Distance)
SetHeight sets the height of the anchored object.
func (OneCellAnchor) SetHeightCells ¶
func (_daabf OneCellAnchor) SetHeightCells(int32)
SetHeightCells is a no-op.
func (OneCellAnchor) SetRowOffset ¶
func (_agb OneCellAnchor) SetRowOffset(m _ac.Distance)
SetRowOffset sets the row offset of the top-left anchor.
func (OneCellAnchor) SetWidth ¶
func (_gbbf OneCellAnchor) SetWidth(w _ac.Distance)
SetWidth sets the width of the anchored object.
func (OneCellAnchor) SetWidthCells ¶
func (_aeac OneCellAnchor) SetWidthCells(int32)
SetWidthCells is a no-op.
func (OneCellAnchor) TopLeft ¶
func (_ccgd OneCellAnchor) TopLeft() CellMarker
TopLeft returns the top-left corner of the anchored object.
func (OneCellAnchor) Type ¶
func (_abdb OneCellAnchor) Type() AnchorType
Type returns the type of anchor
type PatternFill ¶
type PatternFill struct {
// contains filtered or unexported fields
}
func NewPatternFill ¶
func NewPatternFill(fills *_agf.CT_Fills) PatternFill
func (PatternFill) ClearBgColor ¶
func (_cfbaa PatternFill) ClearBgColor()
func (PatternFill) ClearFgColor ¶
func (_ggfc PatternFill) ClearFgColor()
func (PatternFill) SetBgColor ¶
func (_gagde PatternFill) SetBgColor(c _cb.Color)
func (PatternFill) SetFgColor ¶
func (_cdcb PatternFill) SetFgColor(c _cb.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 (_ddbd PatternFill) SetPattern(p _agf.ST_PatternType)
SetPattern sets the pattern of the fill.
func (PatternFill) X ¶
func (_cdff PatternFill) X() *_agf.CT_PatternFill
type RichText ¶
type RichText struct {
// contains filtered or unexported fields
}
RichText is a container for the rich text within a cell. It's similar to a paragaraph for a document, except a cell can only contain one rich text item.
func (RichText) AddRun ¶
func (_aabae RichText) AddRun() RichTextRun
AddRun adds a new run of text to the cell.
type RichTextRun ¶
type RichTextRun struct {
// contains filtered or unexported fields
}
RichTextRun is a segment of text within a cell that is directly formatted.
func (RichTextRun) SetBold ¶
func (_bdec RichTextRun) SetBold(b bool)
SetBold causes the text to be displayed in bold.
func (RichTextRun) SetColor ¶
func (_ebe RichTextRun) SetColor(c _cb.Color)
SetColor sets the text color.
func (RichTextRun) SetFont ¶
func (_bfa RichTextRun) SetFont(s string)
SetFont sets the font name for a rich text run.
func (RichTextRun) SetItalic ¶
func (_gedc RichTextRun) SetItalic(b bool)
SetItalic causes the text to be displayed in italic.
func (RichTextRun) SetSize ¶
func (_gbd RichTextRun) SetSize(m _ac.Distance)
SetSize sets the text size for a rich text run.
func (RichTextRun) SetText ¶
func (_cggbe RichTextRun) SetText(s string)
SetText sets the text to be displayed.
func (RichTextRun) SetUnderline ¶
func (_aed RichTextRun) SetUnderline(u _agf.ST_UnderlineValues)
SetUnderline controls if the run is underlined.
func (RichTextRun) X ¶
func (_afef RichTextRun) X() *_agf.CT_RElt
X returns the inner wrapped XML type.
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row is a row within a spreadsheet.
func (Row) AddNamedCell ¶
AddNamedCell adds a new named cell to a row and returns it. You should normally prefer Cell() as it will return the existing cell if the cell already exists, while AddNamedCell will duplicate the cell creating an invaild spreadsheet.
func (Row) Cells ¶
Cells returns a slice of cells. The cells can be manipulated, but appending to the slice will have no effect.
func (Row) CellsWithEmpty ¶
CellsWithEmpty returns a slice of cells including empty ones from the first column to the last one used in the sheet. The cells can be manipulated, but appending to the slice will have no effect.
func (Row) SetHeightAuto ¶
func (_baad 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 (_gccf SharedStrings) AddString(v string) int
AddString adds a string to the shared string cache.
func (SharedStrings) GetString ¶
func (_gbgd SharedStrings) GetString(id int) (string, error)
GetString retrieves a string from the shared strings table by index.
func (SharedStrings) X ¶
func (_cdeg SharedStrings) X() *_agf.Sst
X returns the inner wrapped XML type.
type Sheet ¶
type Sheet struct {
// contains filtered or unexported fields
}
Sheet is a single sheet within a workbook.
func (*Sheet) AddConditionalFormatting ¶
func (_fbff *Sheet) AddConditionalFormatting(cellRanges []string) ConditionalFormatting
AddConditionalFormatting adds conditional formatting to the sheet.
func (*Sheet) AddDataValidation ¶
func (_beaca *Sheet) AddDataValidation() DataValidation
AddDataValidation adds a data validation rule to a sheet.
func (*Sheet) AddHyperlink ¶
AddHyperlink adds a hyperlink to a sheet. Adding the hyperlink to the sheet and setting it on a cell is more efficient than setting hyperlinks directly on a cell.
func (*Sheet) AddMergedCells ¶
func (_eff *Sheet) AddMergedCells(fromRef, toRef string) MergedCell
AddMergedCells merges cells within a sheet.
func (*Sheet) AddNumberedRow ¶
AddNumberedRow adds a row with a given row number. If you reuse a row number the resulting file will fail validation and fail to open in Office programs. Use Row instead which creates a new row or returns an existing row.
func (*Sheet) AddRow ¶
AddRow adds a new row to a sheet. You can mix this with numbered rows, however it will get confusing. You should prefer to use either automatically numbered rows with AddRow or manually numbered rows with Row/AddNumberedRow
func (*Sheet) ClearAutoFilter ¶
func (_cabb *Sheet) ClearAutoFilter()
ClearAutoFilter removes the autofilters from the sheet.
func (*Sheet) ClearCachedFormulaResults ¶
func (_cbge *Sheet) ClearCachedFormulaResults()
ClearCachedFormulaResults clears any computed formula values that are stored in the sheet. This may be required if you modify cells that are used as a formula input to force the formulas to be recomputed the next time the sheet is opened in Excel.
func (*Sheet) ClearProtection ¶
func (_gfff *Sheet) ClearProtection()
ClearProtection removes any protections applied to teh sheet.
func (*Sheet) ClearSheetViews ¶
func (_agad *Sheet) ClearSheetViews()
ClearSheetViews clears the list of sheet views. This will clear the results of AddView() or SetFrozen.
func (*Sheet) Column ¶
Column returns or creates a column that with a given index (1-N). Columns can span multiple column indices, this method will return the column that applies to a column index if it exists or create a new column that only applies to the index passed in otherwise.
func (Sheet) Extents ¶
Extents returns the sheet extents in the form "A1:B15". This requires scanning the entire sheet.
func (*Sheet) ExtractText ¶
ExtractText returns text from the sheet as a SheetText object.
func (*Sheet) FormulaContext ¶
FormulaContext returns a formula evaluation context that can be used to evaluate formaulas.
func (*Sheet) GetDrawing ¶
func (_cacd *Sheet) GetDrawing() (*_cgg.WsDr, _dag.Relationships)
GetDrawing return the worksheet drawing and its relationships if exists.
func (*Sheet) InitialView ¶
InitialView returns the first defined sheet view. If there are no views, one is created and returned.
func (*Sheet) InsertRow ¶
InsertRow inserts a new row into a spreadsheet at a particular row number. This row will now be the row number specified, and any rows after it will be renumbed.
func (Sheet) MaxColumnIdx ¶
MaxColumnIdx returns the max used column of the sheet.
func (*Sheet) MergedCells ¶
func (_daae *Sheet) MergedCells() []MergedCell
MergedCells returns the merged cell regions within the sheet.
func (*Sheet) Protection ¶
func (_bfae *Sheet) Protection() SheetProtection
Protection controls the protection on an individual sheet.
func (Sheet) RangeReference ¶
RangeReference converts a range reference of the form 'A1:A5' to 'Sheet 1'!$A$1:$A$5 . Renaming a sheet after calculating a range reference will invalidate the reference.
func (*Sheet) RecalculateFormulas ¶
func (_abae *Sheet) RecalculateFormulas()
RecalculateFormulas re-computes any computed formula values that are stored in the sheet. As gooffice formula support is still new and not all functins are supported, if formula execution fails either due to a parse error or missing function, or erorr in the result (even if expected) the cached value will be left empty allowing Excel to recompute it on load.
func (*Sheet) RemoveColumn ¶
RemoveColumn removes column from the sheet and moves all columns to the right of the removed column one step left.
func (*Sheet) RemoveMergedCell ¶
func (_affb *Sheet) RemoveMergedCell(mc MergedCell)
RemoveMergedCell removes merging from a cell range within a sheet. The cells that made up the merged cell remain, but are no lon merged.
func (*Sheet) SetAutoFilter ¶
SetAutoFilter creates autofilters on the sheet. These are the automatic filters that are common for a header row. The RangeRef should be of the form "A1:C5" and cover the entire range of cells to be filtered, not just the header. SetAutoFilter replaces any existing auto filter on the sheet.
func (*Sheet) SetBorder ¶
SetBorder is a helper function for creating borders across multiple cells. In the OOXML spreadsheet format, a border applies to a single cell. To draw a 'boxed' border around multiple cells, you need to apply different styles to the cells on the top,left,right,bottom and four corners. This function breaks apart a single border into its components and applies it to cells as needed to give the effect of a border applying to multiple cells.
func (*Sheet) SetDrawing ¶
SetDrawing sets the worksheet drawing. A worksheet can have a reference to a single drawing, but the drawing can have many charts.
func (*Sheet) SetFrozen ¶
SetFrozen removes any existing sheet views and creates a new single view with either the first row, first column or both frozen.
func (*Sheet) SheetViews ¶
SheetViews returns the sheet views defined. This is where splits and frozen rows/cols are configured. Multiple sheet views are allowed, but I'm not aware of there being a use for more than a single sheet view.
func (*Sheet) Sort ¶
Sort sorts all of the rows within a sheet by the contents of a column. As the file format doesn't suppot indicating that a column should be sorted by the viewing/editing program, we actually need to reorder rows and change cell references during a sort. If the sheet contains formulas, you should call RecalculateFormulas() prior to sorting. The column is in the form "C" and specifies the column to sort by. The firstRow is a 1-based index and specifies the firstRow to include in the sort, allowing skipping over a header row.
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 SheetProtection ¶
type SheetProtection struct {
// contains filtered or unexported fields
}
func (SheetProtection) IsObjectLocked ¶
func (_cgcf SheetProtection) IsObjectLocked() bool
IsSheetLocked returns whether the sheet objects are locked.
func (SheetProtection) IsSheetLocked ¶
func (_gbcc SheetProtection) IsSheetLocked() bool
IsSheetLocked returns whether the sheet is locked.
func (SheetProtection) LockObject ¶
func (_cgda SheetProtection) LockObject(b bool)
LockObject controls the locking of the sheet objects.
func (SheetProtection) LockSheet ¶
func (_gbaaa SheetProtection) LockSheet(b bool)
LockSheet controls the locking of the sheet.
func (SheetProtection) PasswordHash ¶
func (_gdcdc SheetProtection) PasswordHash() string
PasswordHash returns the hash of the workbook password.
func (SheetProtection) SetPassword ¶
func (_edff SheetProtection) SetPassword(pw string)
SetPassword sets the password hash to a hash of the input password.
func (SheetProtection) SetPasswordHash ¶
func (_gce SheetProtection) SetPasswordHash(pwHash string)
SetPasswordHash sets the password hash to the input.
func (SheetProtection) X ¶
func (_ggadb SheetProtection) X() *_agf.CT_SheetProtection
X returns the inner wrapped XML type.
type SheetText ¶
type SheetText struct{ Cells []CellText }
SheetText is an array of extracted text items which has some methods for representing extracted text from a sheet.
type SheetView ¶
type SheetView struct {
// contains filtered or unexported fields
}
SheetView is a view of a sheet. There is typically one per sheet, though more are supported.
func (SheetView) SetShowRuler ¶
SetShowRuler controls the visibility of the ruler
func (SheetView) SetState ¶
func (_ccaf SheetView) SetState(st _agf.ST_PaneState)
SetState sets the sheet view state (frozen/split/frozen-split)
func (SheetView) SetTopLeft ¶
SetTopLeft sets the top left visible cell after the split.
func (SheetView) SetZoom ¶
SetZoom controls the zoom level of the sheet and is measured in percent. The default value is 100.
func (SheetView) X ¶
func (_faf SheetView) X() *_agf.CT_SheetView
X returns the inner wrapped XML type.
type StandardFormat ¶
type StandardFormat uint32
StandardFormat is a standard ECMA 376 number format.
const ( StandardFormatGeneral StandardFormat = 0 StandardFormat0 StandardFormat = 0 StandardFormatWholeNumber StandardFormat = 1 StandardFormat1 StandardFormat = 1 StandardFormat2 StandardFormat = 2 StandardFormat3 StandardFormat = 3 StandardFormat4 StandardFormat = 4 StandardFormatPercent StandardFormat = 9 StandardFormat9 StandardFormat = 9 StandardFormat10 StandardFormat = 10 StandardFormat11 StandardFormat = 11 StandardFormat12 StandardFormat = 12 StandardFormat13 StandardFormat = 13 StandardFormatDate StandardFormat = 14 StandardFormat14 StandardFormat = 14 StandardFormat15 StandardFormat = 15 StandardFormat16 StandardFormat = 16 StandardFormat17 StandardFormat = 17 StandardFormat18 StandardFormat = 18 StandardFormatTime StandardFormat = 19 StandardFormat19 StandardFormat = 19 StandardFormat20 StandardFormat = 20 StandardFormat21 StandardFormat = 21 StandardFormatDateTime StandardFormat = 22 StandardFormat22 StandardFormat = 22 StandardFormat37 StandardFormat = 37 StandardFormat38 StandardFormat = 38 StandardFormat39 StandardFormat = 39 StandardFormat40 StandardFormat = 40 StandardFormat45 StandardFormat = 45 StandardFormat46 StandardFormat = 46 StandardFormat47 StandardFormat = 47 StandardFormat48 StandardFormat = 48 StandardFormat49 StandardFormat = 49 )
func (StandardFormat) String ¶
func (_gffg StandardFormat) String() string
type StyleSheet ¶
type StyleSheet struct {
// contains filtered or unexported fields
}
StyleSheet is a document style sheet.
func NewStyleSheet ¶
func NewStyleSheet(wb *Workbook) StyleSheet
NewStyleSheet constructs a new default stylesheet.
func (StyleSheet) AddBorder ¶
func (_eeac StyleSheet) AddBorder() Border
AddBorder creates a new empty Border style.
func (StyleSheet) AddCellStyle ¶
func (_afab StyleSheet) AddCellStyle() CellStyle
AddCellStyle creates a new empty cell style.
func (StyleSheet) AddDifferentialStyle ¶
func (_dcef StyleSheet) AddDifferentialStyle() DifferentialStyle
AddDifferentialStyle adds a new empty differential cell style to the stylesheet.
func (StyleSheet) AddFont ¶
func (_cbbcg StyleSheet) AddFont() Font
AddFont creates a new empty Font style.
func (StyleSheet) AddNumberFormat ¶
func (_cbce StyleSheet) AddNumberFormat() NumberFormat
AddNumberFormat adds a new blank number format to the stylesheet.
func (StyleSheet) Borders ¶
func (_cebc StyleSheet) Borders() []Border
Borders returns the list of borders defined in the stylesheet.
func (StyleSheet) CellStyles ¶
func (_bfad StyleSheet) CellStyles() []CellStyle
CellStyles returns the list of defined cell styles
func (StyleSheet) Fills ¶
func (_ecaf StyleSheet) Fills() Fills
Fills returns a Fills object that can be used to add/create/edit fills.
func (StyleSheet) Fonts ¶
func (_fcaad StyleSheet) Fonts() []Font
Fonts returns the list of fonts defined in the stylesheet.
func (StyleSheet) GetCellStyle ¶
func (_egcb StyleSheet) GetCellStyle(id uint32) CellStyle
func (StyleSheet) GetNumberFormat ¶
func (_fcda StyleSheet) GetNumberFormat(id uint32) NumberFormat
func (StyleSheet) GetOrCreateStandardNumberFormat ¶
func (_fefca StyleSheet) GetOrCreateStandardNumberFormat(f StandardFormat) CellStyle
GetOrCreateStandardNumberFormat gets or creates a cell style with a given standard format. This should only be used when you want to perform number/date/time formatting only. Manipulating the style returned will cause all cells using style returned from this for a given format to be formatted.
func (StyleSheet) RemoveFont ¶
func (_aaca 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 (_aaedg StyleSheet) X() *_agf.StyleSheet
X returns the inner XML entity for a stylesheet.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
type TwoCellAnchor ¶
type TwoCellAnchor struct {
// contains filtered or unexported fields
}
TwoCellAnchor is an anchor that is attached to a top-left cell with a fixed width/height in cells.
func (TwoCellAnchor) BottomRight ¶
func (_cebe TwoCellAnchor) BottomRight() CellMarker
BottomRight returns the CellMaker for the bottom right corner of the anchor.
func (TwoCellAnchor) MoveTo ¶
func (_ebed TwoCellAnchor) MoveTo(col, row int32)
MoveTo repositions the anchor without changing the objects size.
func (TwoCellAnchor) SetColOffset ¶
func (_dbee TwoCellAnchor) SetColOffset(m _ac.Distance)
SetColOffset sets the column offset of the two cell anchor.
func (TwoCellAnchor) SetHeight ¶
func (_fed TwoCellAnchor) SetHeight(h _ac.Distance)
SetHeight is a nop-op.
func (TwoCellAnchor) SetHeightCells ¶
func (_ggabg TwoCellAnchor) SetHeightCells(h int32)
SetHeightCells sets the height the anchored object by moving the bottom. It is not compatible with SetHeight.
func (TwoCellAnchor) SetRowOffset ¶
func (_bcgd TwoCellAnchor) SetRowOffset(m _ac.Distance)
SetRowOffset sets the row offset of the two cell anchor
func (TwoCellAnchor) SetWidth ¶
func (_abga TwoCellAnchor) SetWidth(w _ac.Distance)
SetWidth is a no-op.
func (TwoCellAnchor) SetWidthCells ¶
func (_fgee TwoCellAnchor) SetWidthCells(w int32)
SetWidthCells sets the height the anchored object by moving the right hand side. It is not compatible with SetWidth.
func (TwoCellAnchor) TopLeft ¶
func (_daece TwoCellAnchor) TopLeft() CellMarker
TopLeft returns the CellMaker for the top left corner of the anchor.
func (TwoCellAnchor) Type ¶
func (_dgddc TwoCellAnchor) Type() AnchorType
Type returns the type of anchor
type Workbook ¶
type Workbook struct {
_dag.DocBase
StyleSheet StyleSheet
// contains filtered or unexported fields
}
Workbook is the top level container item for a set of spreadsheets.
func (*Workbook) AddDefinedName ¶
func (_fecec *Workbook) AddDefinedName(name, ref string) DefinedName
AddDefinedName adds a name for a cell or range reference that can be used in formulas and charts.
func (*Workbook) AddDrawing ¶
AddDrawing adds a drawing to a workbook. However the drawing is not actually displayed or used until it's set on a sheet.
func (*Workbook) AddImage ¶
AddImage adds an image to the workbook package, returning a reference that can be used to add the image to a drawing.
func (*Workbook) ClearCachedFormulaResults ¶
func (_cbab *Workbook) ClearCachedFormulaResults()
ClearCachedFormulaResults clears any computed formula values that are stored in the sheet. This may be required if you modify cells that are used as a formula input to force the formulas to be recomputed the next time the sheet is opened in Excel.
func (*Workbook) ClearProtection ¶
func (_gabb *Workbook) ClearProtection()
ClearProtection clears all workbook protections.
func (*Workbook) Close ¶
Close closes the workbook, removing any temporary files that might have been created when opening a document.
func (*Workbook) CopySheet ¶
CopySheet copies the existing sheet at index `ind` and puts its copy with the name `copiedSheetName`.
func (*Workbook) CopySheetByName ¶
CopySheetByName copies the existing sheet with the name `name` and puts its copy with the name `copiedSheetName`.
func (*Workbook) DeepCopySheet ¶
DeepCopySheet copies the existing sheet at index `ind` and puts its deep copy with the name `copiedSheetName`. Unlike CopySheet, this creates a fully independent copy of all sheet data including cells, so modifying the copy will not affect the original sheet.
func (*Workbook) DeepCopySheetByName ¶
DeepCopySheetByName copies the existing sheet with the name `name` and puts its deep copy with the name `copiedSheetName`. Unlike CopySheetByName, this creates a fully independent copy of all sheet data including cells.
func (*Workbook) DefinedNames ¶
func (_afec *Workbook) DefinedNames() []DefinedName
DefinedNames returns a slice of all defined names in the workbook.
func (*Workbook) Epoch ¶
Epoch returns the point at which the dates/times in the workbook are relative to.
func (*Workbook) ExtractText ¶
func (_ffad *Workbook) ExtractText() *WorkbookText
ExtractText returns text from the workbook as a WorkbookText object.
func (*Workbook) GetChartByTargetId ¶
func (_aega *Workbook) GetChartByTargetId(targetAttr string) *_efe.ChartSpace
GetChartByTargetId returns the array of workbook crt.ChartSpace.
func (*Workbook) GetFilename ¶
GetFilename returns the name of file from which workbook was opened with full path to it
func (*Workbook) GetSheet ¶
GetSheet returns a sheet by name, or an error if a sheet by the given name was not found.
func (*Workbook) Protection ¶
func (_agga *Workbook) Protection() WorkbookProtection
Protection allows control over the workbook protections.
func (*Workbook) RecalculateFormulas ¶
func (_adea *Workbook) RecalculateFormulas()
RecalculateFormulas re-computes any computed formula values that are stored in the sheet. As gooffice formula support is still new and not all functins are supported, if formula execution fails either due to a parse error or missing function, or erorr in the result (even if expected) the cached value will be left empty allowing Excel to recompute it on load.
func (*Workbook) RemoveCalcChain ¶
func (_cfccd *Workbook) RemoveCalcChain()
RemoveCalcChain removes the cached caculation chain. This is sometimes needed as we don't update it when rows are added/removed.
func (*Workbook) RemoveDefinedName ¶
func (_gdce *Workbook) RemoveDefinedName(dn DefinedName) error
RemoveDefinedName removes an existing defined name.
func (*Workbook) RemoveSheet ¶
RemoveSheet removes the sheet with the given index from the workbook.
func (*Workbook) RemoveSheetByName ¶
RemoveSheetByName removes the sheet with the given name from the workbook.
func (*Workbook) SaveToFile ¶
SaveToFile writes the workbook out to a file.
func (*Workbook) SetActiveSheet ¶
SetActiveSheet sets the active sheet which will be the tab displayed when the spreadsheet is initially opened.
func (*Workbook) SetActiveSheetIndex ¶
SetActiveSheetIndex sets the index of the active sheet (0-n) which will be the tab displayed when the spreadsheet is initially opened.
func (Workbook) SheetCount ¶
SheetCount returns the number of sheets in the workbook.
func (*Workbook) Uses1904Dates ¶
Uses1904Dates returns true if the the workbook uses dates relative to 1 Jan 1904. This is uncommon.
type WorkbookProtection ¶
type WorkbookProtection struct {
// contains filtered or unexported fields
}
func (WorkbookProtection) IsStructureLocked ¶
func (_ggbg WorkbookProtection) IsStructureLocked() bool
IsStructureLocked returns whether the workbook structure is locked.
func (WorkbookProtection) IsWindowLocked ¶
func (_acfe WorkbookProtection) IsWindowLocked() bool
IsWindowLocked returns whether the workbook windows are locked.
func (WorkbookProtection) LockStructure ¶
func (_ccef WorkbookProtection) LockStructure(b bool)
LockStructure controls the locking of the workbook structure.
func (WorkbookProtection) LockWindow ¶
func (_fbggg WorkbookProtection) LockWindow(b bool)
LockWindow controls the locking of the workbook windows.
func (WorkbookProtection) PasswordHash ¶
func (_ddcbe WorkbookProtection) PasswordHash() string
PasswordHash returns the hash of the workbook password.
func (WorkbookProtection) SetPassword ¶
func (_aggb WorkbookProtection) SetPassword(pw string)
SetPassword sets the password hash to a hash of the input password.
func (WorkbookProtection) SetPasswordHash ¶
func (_dcefd WorkbookProtection) SetPasswordHash(pwHash string)
SetPasswordHash sets the password hash to the input.
func (WorkbookProtection) X ¶
func (_eagdd WorkbookProtection) X() *_agf.CT_WorkbookProtection
X returns the inner wrapped XML type.
type WorkbookText ¶
type WorkbookText struct{ Sheets []*SheetText }
WorkbookText is an array of extracted text items which has some methods for representing extracted text from a workbook.
func (*WorkbookText) Text ¶
func (_bbcf *WorkbookText) Text() string
Text returns text from the workbook as one string separated with line breaks.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package format provides support for parsing and evaluating spreadsheetml/Excel number formats.
|
Package format provides support for parsing and evaluating spreadsheetml/Excel number formats. |
|
Package formula provides formula parsing and evaluation.
|
Package formula provides formula parsing and evaluation. |
|
Package update contains definitions needed for updating references after removing rows/columns.
|
Package update contains definitions needed for updating references after removing rows/columns. |