Documentation
¶
Overview ¶
Package spreadsheet provides functions to read, create and edit spreadsheets including excel files.
Index ¶
- type Alignment
- type Cell
- func (cell *Cell) GetBoolValue() (bool, bool)
- func (cell *Cell) GetFloatValue() (float64, bool)
- func (cell *Cell) GetIntValue() (int, bool)
- func (cell *Cell) GetTextValue() (string, bool)
- func (cell *Cell) NewRichText() *RichText
- func (cell *Cell) Ref() *CellRef
- func (cell *Cell) RichText() *RichText
- func (cell *Cell) SetBoolValue(value bool)
- func (cell *Cell) SetFloatValue(value float64)
- func (cell *Cell) SetIntValue(value int)
- func (cell *Cell) SetPlainText(str string)
- func (cell *Cell) String() string
- func (cell *Cell) Type() CellType
- type CellRange
- type CellRef
- type CellType
- type CharType
- type Color
- func (color *Color) Auto() (bool, bool)
- func (color *Color) Index() (uint, bool)
- func (color *Color) RGB() (uint16, bool)
- func (color *Color) SetAuto(auto, remove bool)
- func (color *Color) SetIndex(index uint, remove bool)
- func (color *Color) SetRGB(value uint16, remove bool)
- func (color *Color) SetTheme(value uint, remove bool)
- func (color *Color) SetTint(value float64)
- func (color *Color) Theme() (uint, bool)
- func (color *Color) Tint() float64
- type CoreProperties
- func (cp *CoreProperties) Category() string
- func (cp *CoreProperties) ContentStatus() string
- func (cp *CoreProperties) ContentType() string
- func (cp *CoreProperties) CreatedAt() (int64, bool)
- func (cp *CoreProperties) Creator() string
- func (cp *CoreProperties) Description() string
- func (cp *CoreProperties) Identifier() string
- func (cp *CoreProperties) Keywords() string
- func (cp *CoreProperties) Language() string
- func (cp *CoreProperties) LastModifiedBy() string
- func (cp *CoreProperties) LastPrintedAt() (int64, bool)
- func (cp *CoreProperties) ModifiedAt() (int64, bool)
- func (cp *CoreProperties) Revision() int
- func (cp *CoreProperties) SetCategory(str string)
- func (cp *CoreProperties) SetContentStatus(str string)
- func (cp *CoreProperties) SetContentType(str string)
- func (cp *CoreProperties) SetCreatedAt(sec int64, remove bool)
- func (cp *CoreProperties) SetCreator(str string)
- func (cp *CoreProperties) SetDescription(str string)
- func (cp *CoreProperties) SetIdentifier(str string)
- func (cp *CoreProperties) SetKeywords(str string)
- func (cp *CoreProperties) SetLanguage(str string)
- func (cp *CoreProperties) SetLastModifiedBy(str string)
- func (cp *CoreProperties) SetLastPrintedAt(sec int64, remove bool)
- func (cp *CoreProperties) SetModifiedAt(sec int64, remove bool)
- func (cp *CoreProperties) SetRevision(value int)
- func (cp *CoreProperties) SetSubject(str string)
- func (cp *CoreProperties) SetTitle(str string)
- func (cp *CoreProperties) SetVersion(value float64)
- func (cp *CoreProperties) Subject() string
- func (cp *CoreProperties) Title() string
- func (cp *CoreProperties) Version() float64
- type FontScheme
- type PhoneticPr
- type PhoneticRun
- type RichText
- func (rt *RichText) NewPhoneticPr() *PhoneticPr
- func (rt *RichText) NewPhoneticRun(start, end uint, str string) *PhoneticRun
- func (rt *RichText) NewRichTextRun() *RichTextRun
- func (rt *RichText) PhoneticPr() *PhoneticPr
- func (rt *RichText) PhoneticRuns() []*PhoneticRun
- func (rt *RichText) RemovePhoneticPr()
- func (rt *RichText) RemovePhoneticRuns()
- func (rt *RichText) RemoveRichTextRuns()
- func (rt *RichText) RichTextRuns() []*RichTextRun
- func (rt *RichText) SetPlainText(str string)
- func (rt *RichText) Text() string
- type RichTextRun
- func (rtr *RichTextRun) Bold() bool
- func (rtr *RichTextRun) Charset() (uint8, bool)
- func (rtr *RichTextRun) Color() *Color
- func (rtr *RichTextRun) Condense() bool
- func (rtr *RichTextRun) Extend() bool
- func (rtr *RichTextRun) FontFamily() (uint8, bool)
- func (rtr *RichTextRun) FontName() string
- func (rtr *RichTextRun) FontScheme() FontScheme
- func (rtr *RichTextRun) FontSize() float64
- func (rtr *RichTextRun) Italic() bool
- func (rtr *RichTextRun) NewColor() *Color
- func (rtr *RichTextRun) Outline() bool
- func (rtr *RichTextRun) RemoveColor()
- func (rtr *RichTextRun) SetBold(value bool)
- func (rtr *RichTextRun) SetCharset(value uint8, remove bool)
- func (rtr *RichTextRun) SetCondense(value bool)
- func (rtr *RichTextRun) SetExtend(value bool)
- func (rtr *RichTextRun) SetFontFamily(value uint8, remove bool)
- func (rtr *RichTextRun) SetFontName(fontName string)
- func (rtr *RichTextRun) SetFontScheme(value FontScheme)
- func (rtr *RichTextRun) SetFontSize(value float64)
- func (rtr *RichTextRun) SetItalic(value bool)
- func (rtr *RichTextRun) SetOutline(value bool)
- func (rtr *RichTextRun) SetShadow(value bool)
- func (rtr *RichTextRun) SetStrike(value bool)
- func (rtr *RichTextRun) SetText(str string)
- func (rtr *RichTextRun) SetUnderline(value Underline)
- func (rtr *RichTextRun) SetVerticalAlign(value VerticalAlign)
- func (rtr *RichTextRun) Shadow() bool
- func (rtr *RichTextRun) Strike() bool
- func (rtr *RichTextRun) Text() string
- func (rtr *RichTextRun) Underline() Underline
- func (rtr *RichTextRun) VerticalAlign() VerticalAlign
- type Row
- type RowReader
- type RowWriter
- type Spreadsheet
- func (spr *Spreadsheet) Close() error
- func (spr *Spreadsheet) CoreProperties() *CoreProperties
- func (spr *Spreadsheet) SaveAndClose() error
- func (spr *Spreadsheet) SavePath() string
- func (spr *Spreadsheet) SetSavePath(savePath string)
- func (spr *Spreadsheet) Workbook() *Workbook
- func (spr *Spreadsheet) WriteTo(w io.Writer) error
- type Underline
- type VerticalAlign
- type Workbook
- type Worksheet
- type WorksheetState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alignment ¶
type Alignment string
Alignment represents the text alignment properties of a text run.
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Cell represents a single cell in a worksheet.
func (*Cell) GetBoolValue ¶
GetBoolValue returns the cell value if it's a bool.
func (*Cell) GetFloatValue ¶
GetFloatValue returns the cell value if it's a float.
func (*Cell) GetIntValue ¶
GetIntValue returns the cell value if it's an integer.
func (*Cell) GetTextValue ¶
GetTextValue returns the cell value if it's a string.
func (*Cell) NewRichText ¶
NewRichText sets the cell contents to a new styled text and returns it.
func (*Cell) SetBoolValue ¶
SetBoolValue sets the cell to the given bool value.
func (*Cell) SetFloatValue ¶
SetFloatValue sets the cell to the given float64 value.
func (*Cell) SetIntValue ¶
SetIntValue sets the cell to the given int value.
func (*Cell) SetPlainText ¶
SetPlainText sets the cell to the given string value.
type CellRange ¶
type CellRange struct {
// contains filtered or unexported fields
}
CellRange represents a range of cells in a worksheet.
func NewCellRange ¶
NewCellRange builds a cell range marked by the given first and last cell references.
func NewCellRangeFromString ¶
NewCellRangeFromString parses the given string and returns the cell range.
type CellRef ¶
type CellRef struct {
// contains filtered or unexported fields
}
CellRef represents the reference or address of a cell.
func NewCellRef ¶
NewCellRef builds the cell reference for the given row and column values.
func NewCellRefFromString ¶
NewCellRefFromString parses the given string and returns the cell reference.
func (*CellRef) IsAbsCol ¶
IsAbsCol returns whether the column number of the cell reference is absolute.
func (*CellRef) IsAbsRow ¶
IsAbsRow returns whether the row number of the cell reference is absolute.
type Color ¶
type Color struct {
// contains filtered or unexported fields
}
Color represents the text color properties of a text run.
type CoreProperties ¶
type CoreProperties struct {
// contains filtered or unexported fields
}
CoreProperties represents the core properties of the spreadsheet.
func (*CoreProperties) Category ¶
func (cp *CoreProperties) Category() string
Category returns the spreadsheet category.
func (*CoreProperties) ContentStatus ¶
func (cp *CoreProperties) ContentStatus() string
ContentStatus returns the content status of the spreadsheet.
func (*CoreProperties) ContentType ¶
func (cp *CoreProperties) ContentType() string
ContentType returns the content type of the spreadsheet.
func (*CoreProperties) CreatedAt ¶
func (cp *CoreProperties) CreatedAt() (int64, bool)
CreatedAt returns the timestamp at which the spreadsheet was created, if set.
func (*CoreProperties) Creator ¶
func (cp *CoreProperties) Creator() string
Creator returns the creator of the spreadsheet.
func (*CoreProperties) Description ¶
func (cp *CoreProperties) Description() string
Description returns the spreadsheet description.
func (*CoreProperties) Identifier ¶
func (cp *CoreProperties) Identifier() string
Identifier returns the spreadsheet identifier.
func (*CoreProperties) Keywords ¶
func (cp *CoreProperties) Keywords() string
Keywords returns the spreadsheet keywords usually separated by comma.
func (*CoreProperties) Language ¶
func (cp *CoreProperties) Language() string
Language returns the spreadsheet language.
func (*CoreProperties) LastModifiedBy ¶
func (cp *CoreProperties) LastModifiedBy() string
LastModifiedBy returns the user who last modified the spreadsheet.
func (*CoreProperties) LastPrintedAt ¶
func (cp *CoreProperties) LastPrintedAt() (int64, bool)
LastPrintedAt returns the timestamp at which the spreadsheet was last printed, if set.
func (*CoreProperties) ModifiedAt ¶
func (cp *CoreProperties) ModifiedAt() (int64, bool)
ModifiedAt returns the timestamp at which the spreadsheet was last modified, if set.
func (*CoreProperties) Revision ¶
func (cp *CoreProperties) Revision() int
Revision returns the spreadsheet revision.
func (*CoreProperties) SetCategory ¶
func (cp *CoreProperties) SetCategory(str string)
SetCategory sets the spreadsheet category.
func (*CoreProperties) SetContentStatus ¶
func (cp *CoreProperties) SetContentStatus(str string)
SetContentStatus sets the content status of the spreadsheet.
func (*CoreProperties) SetContentType ¶
func (cp *CoreProperties) SetContentType(str string)
SetContentType sets the content type of the spreadsheet.
func (*CoreProperties) SetCreatedAt ¶
func (cp *CoreProperties) SetCreatedAt(sec int64, remove bool)
SetCreatedAt sets or removes the timestamp at which the spreadsheet was created.
func (*CoreProperties) SetCreator ¶
func (cp *CoreProperties) SetCreator(str string)
SetCreator sets the creator of the spreadsheet.
func (*CoreProperties) SetDescription ¶
func (cp *CoreProperties) SetDescription(str string)
SetDescription sets the spreadsheet description.
func (*CoreProperties) SetIdentifier ¶
func (cp *CoreProperties) SetIdentifier(str string)
SetIndentifier sets the spreadsheet identifier.
func (*CoreProperties) SetKeywords ¶
func (cp *CoreProperties) SetKeywords(str string)
SetKeywords sets the spreadsheet keywords usually separated by comma.
func (*CoreProperties) SetLanguage ¶
func (cp *CoreProperties) SetLanguage(str string)
SetLanguage sets the spreadsheet language.
func (*CoreProperties) SetLastModifiedBy ¶
func (cp *CoreProperties) SetLastModifiedBy(str string)
SetLastModifiedBy sets the user who last modified the spreadsheet.
func (*CoreProperties) SetLastPrintedAt ¶
func (cp *CoreProperties) SetLastPrintedAt(sec int64, remove bool)
SetLastPrintedAt sets or removes the timestamp at which the spreadsheet was last printed.
func (*CoreProperties) SetModifiedAt ¶
func (cp *CoreProperties) SetModifiedAt(sec int64, remove bool)
SetModifiedAt sets or removes the timestamp at which the spreadsheet was last modified.
func (*CoreProperties) SetRevision ¶
func (cp *CoreProperties) SetRevision(value int)
SetRevision sets the spreadsheet revision.
func (*CoreProperties) SetSubject ¶
func (cp *CoreProperties) SetSubject(str string)
SetSubject sets the spreadsheet subject.
func (*CoreProperties) SetTitle ¶
func (cp *CoreProperties) SetTitle(str string)
SetTitle sets the spreadsheet title.
func (*CoreProperties) SetVersion ¶
func (cp *CoreProperties) SetVersion(value float64)
SetVersion sets the spreadsheet version.
func (*CoreProperties) Subject ¶
func (cp *CoreProperties) Subject() string
Subject returns the spreadsheet subject.
func (*CoreProperties) Title ¶
func (cp *CoreProperties) Title() string
Title returns the spreadsheet title.
func (*CoreProperties) Version ¶
func (cp *CoreProperties) Version() float64
Version returns the spreadsheet version.
type FontScheme ¶
type FontScheme string
FontScheme represents the font schemes of a text run.
const ( FontSchemeNone FontScheme = "none" FontSchemeMajor FontScheme = "major" FontSchemeMinor FontScheme = "minor" )
FontScheme can be one of these values.
type PhoneticPr ¶
type PhoneticPr struct {
// contains filtered or unexported fields
}
PhoneticPr represents the shared properties of phonetic runs in a rich text.
func (*PhoneticPr) Alignment ¶
func (phpr *PhoneticPr) Alignment() Alignment
Alignment returns the alignment applied to the phonetic properties.
func (*PhoneticPr) CharType ¶
func (phpr *PhoneticPr) CharType() CharType
CharType returns the character type applied to the phonetic properties.
func (*PhoneticPr) FontId ¶
func (phpr *PhoneticPr) FontId() uint
FontId returns the font id applied to the phonetic properties.
func (*PhoneticPr) SetAlignment ¶
func (phpr *PhoneticPr) SetAlignment(value Alignment)
SetAlignment sets the given alignment property to phonetic properties.
func (*PhoneticPr) SetCharType ¶
func (phpr *PhoneticPr) SetCharType(value CharType)
SetCharType sets the given character type to the phonetic properties.
func (*PhoneticPr) SetFontId ¶
func (phpr *PhoneticPr) SetFontId(value uint)
SetFontId sets the font id to the phonetic properties.
type PhoneticRun ¶
type PhoneticRun struct {
// contains filtered or unexported fields
}
PhoneticRun represents the alphabetical hints displayed on top of complex symbols to aid reading especially in east asian languages.
func (*PhoneticRun) End ¶
func (phr *PhoneticRun) End() uint
End returns the index of the byte at which the phonetic run ends.
func (*PhoneticRun) Start ¶
func (phr *PhoneticRun) Start() uint
Start returns the index of the byte at which the phonetic run starts.
func (*PhoneticRun) Text ¶
func (phr *PhoneticRun) Text() string
Text returns the plain text value of the phonetic run.
type RichText ¶
type RichText struct {
// contains filtered or unexported fields
}
RichText represents the styled text in a cell.
func (*RichText) NewPhoneticPr ¶
func (rt *RichText) NewPhoneticPr() *PhoneticPr
NewPhoneticPr sets the phonetic properties to a new value and returns it.
func (*RichText) NewPhoneticRun ¶
func (rt *RichText) NewPhoneticRun(start, end uint, str string) *PhoneticRun
NewPhoneticRun appends a new phonetic run to the rich text and returns it.
func (*RichText) NewRichTextRun ¶
func (rt *RichText) NewRichTextRun() *RichTextRun
NewRichTextRun appends a new text run to the rich text and returns it.
func (*RichText) PhoneticPr ¶
func (rt *RichText) PhoneticPr() *PhoneticPr
PhoneticPr returns the phonetic properties of the rich text.
func (*RichText) PhoneticRuns ¶
func (rt *RichText) PhoneticRuns() []*PhoneticRun
PhoneticRuns returns the phonetic runs in the rich text.
func (*RichText) RemovePhoneticPr ¶
func (rt *RichText) RemovePhoneticPr()
RemovePhoneticPr removes the phonetic properties from the rich text.
func (*RichText) RemovePhoneticRuns ¶
func (rt *RichText) RemovePhoneticRuns()
RemovePhoneticRuns removes all phonetic runs from the rich text.
func (*RichText) RemoveRichTextRuns ¶
func (rt *RichText) RemoveRichTextRuns()
RemoveRichTextRuns removes all text runs and sets the rich text to blank.
func (*RichText) RichTextRuns ¶
func (rt *RichText) RichTextRuns() []*RichTextRun
RichTextRuns returns the text runs with unique styles for the rich text.
func (*RichText) SetPlainText ¶
SetPlainText sets the given string to the rich text and strips all styles.
type RichTextRun ¶
type RichTextRun struct {
// contains filtered or unexported fields
}
RichTextRun represents a portion of text sharing the same style in rich text.
func (*RichTextRun) Bold ¶
func (rtr *RichTextRun) Bold() bool
Bold returns whether bold is applied on the text run.
func (*RichTextRun) Charset ¶
func (rtr *RichTextRun) Charset() (uint8, bool)
Charset returns the character set index of the text run, if set.
func (*RichTextRun) Color ¶
func (rtr *RichTextRun) Color() *Color
Color returns the color applied to the text run.
func (*RichTextRun) Condense ¶
func (rtr *RichTextRun) Condense() bool
Condense returns whether condense is applied to the text run.
func (*RichTextRun) Extend ¶
func (rtr *RichTextRun) Extend() bool
Extend returns whether extend is applied to the text run.
func (*RichTextRun) FontFamily ¶
func (rtr *RichTextRun) FontFamily() (uint8, bool)
FontFamily returns the font family of the text run, if set.
func (*RichTextRun) FontName ¶
func (rtr *RichTextRun) FontName() string
FontName returns the name of the text run font.
func (*RichTextRun) FontScheme ¶
func (rtr *RichTextRun) FontScheme() FontScheme
FontScheme returns the font scheme of the text run.
func (*RichTextRun) FontSize ¶
func (rtr *RichTextRun) FontSize() float64
FontSize returns the font size of the text run.
func (*RichTextRun) Italic ¶
func (rtr *RichTextRun) Italic() bool
Italic returns whether italic is applied on the text run.
func (*RichTextRun) NewColor ¶
func (rtr *RichTextRun) NewColor() *Color
NewColor sets a new color to the text run and returns it.
func (*RichTextRun) Outline ¶
func (rtr *RichTextRun) Outline() bool
Outline returns whether outline is applies to the text run.
func (*RichTextRun) RemoveColor ¶
func (rtr *RichTextRun) RemoveColor()
RemoveColor removes the color of the text run.
func (*RichTextRun) SetBold ¶
func (rtr *RichTextRun) SetBold(value bool)
SetBold sets the bold property of the text run.
func (*RichTextRun) SetCharset ¶
func (rtr *RichTextRun) SetCharset(value uint8, remove bool)
SetCharset sets or removes the character set of the text run.
func (*RichTextRun) SetCondense ¶
func (rtr *RichTextRun) SetCondense(value bool)
SetCondense sets the condense property of the text run.
func (*RichTextRun) SetExtend ¶
func (rtr *RichTextRun) SetExtend(value bool)
SetExtend sets the extend property of the text run.
func (*RichTextRun) SetFontFamily ¶
func (rtr *RichTextRun) SetFontFamily(value uint8, remove bool)
SetFontFamily sets or removes the font family of the text run.
func (*RichTextRun) SetFontName ¶
func (rtr *RichTextRun) SetFontName(fontName string)
SetFontName sets the text run font.
func (*RichTextRun) SetFontScheme ¶
func (rtr *RichTextRun) SetFontScheme(value FontScheme)
SetFontScheme sets the font scheme of text run.
func (*RichTextRun) SetFontSize ¶
func (rtr *RichTextRun) SetFontSize(value float64)
SetFontSize sets the font size of the text run.
func (*RichTextRun) SetItalic ¶
func (rtr *RichTextRun) SetItalic(value bool)
SetItalic set the italic property of the text run.
func (*RichTextRun) SetOutline ¶
func (rtr *RichTextRun) SetOutline(value bool)
Outline sets the outline property of the text run.
func (*RichTextRun) SetShadow ¶
func (rtr *RichTextRun) SetShadow(value bool)
SetShadow sets the shadow property of the text run.
func (*RichTextRun) SetStrike ¶
func (rtr *RichTextRun) SetStrike(value bool)
SetStrike sets the strike property of the text run.
func (*RichTextRun) SetText ¶
func (rtr *RichTextRun) SetText(str string)
SetText sets the text value of the text run.
func (*RichTextRun) SetUnderline ¶
func (rtr *RichTextRun) SetUnderline(value Underline)
SetUnderline sets the underline property of the text run.
func (*RichTextRun) SetVerticalAlign ¶
func (rtr *RichTextRun) SetVerticalAlign(value VerticalAlign)
SetVerticalAlign sets the vertical alignment property of the text run.
func (*RichTextRun) Shadow ¶
func (rtr *RichTextRun) Shadow() bool
Shadow returns whether shadow is applied to the text run.
func (*RichTextRun) Strike ¶
func (rtr *RichTextRun) Strike() bool
Strike returns whether strike is applied to the text run.
func (*RichTextRun) Text ¶
func (rtr *RichTextRun) Text() string
Text returns the text value of the text run.
func (*RichTextRun) Underline ¶
func (rtr *RichTextRun) Underline() Underline
Underline returns the underline applied to the text run.
func (*RichTextRun) VerticalAlign ¶
func (rtr *RichTextRun) VerticalAlign() VerticalAlign
VerticalAlign returns the vertical alignment applied to the text run.
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row represents a single row in a worksheet.
type RowReader ¶
type RowReader struct {
// contains filtered or unexported fields
}
RowReader provides ReadRow method to read the worksheet rows one by one.
type RowWriter ¶
type RowWriter struct {
// contains filtered or unexported fields
}
RowWriter provides WriteRow method to write the worksheet rows one by one. Any existing rows in the worksheet are removed.
type Spreadsheet ¶
type Spreadsheet struct {
// contains filtered or unexported fields
}
Spreadsheet represents an opened spreadsheet file. It provides methods to manage the workbook and core properties of the spreadsheet.
func New ¶
func New() *Spreadsheet
New opens a new spreadsheet file and returns it. The file should be closed after use to clean up any temporary data generated to manage modifications.
The file can be saved to disk and closed by calling the SaveAndClose method. The path to which the file is saved must be set by calling SetSavePath method before SaveAndClose is called.
The file can be closed without saving to disk by calling Close method.
func Open ¶
func Open(filePath string) (*Spreadsheet, error)
Open opens an existing spreadsheet at the given path and returns it. The file should be closed after use to clean up any temporary data generated to manage modifications.
The file can be saved to disk and closed by calling SaveAndClose method. By default, the file is saved its current path but the path can be changed by calling SetSavePath method before SaveAndClose is called.
The file can be closed without saving to disk by Close method.
func (*Spreadsheet) Close ¶
func (spr *Spreadsheet) Close() error
Close closes the spreadsheet file and cleans up any temporary data generated to manage modifications. Any unsaved modifications are permanently lost.
func (*Spreadsheet) CoreProperties ¶
func (spr *Spreadsheet) CoreProperties() *CoreProperties
CoreProperties returns the core properties of the spreadsheet.
func (*Spreadsheet) SaveAndClose ¶
func (spr *Spreadsheet) SaveAndClose() error
SaveAndClose saves the spreadsheet file to disk and closes it. It also cleans up any temporary data generated to manage modifications.
func (*Spreadsheet) SavePath ¶
func (spr *Spreadsheet) SavePath() string
SavePath returns the path of the spreadsheet file where it is expected to be saved by the SaveAndClose method.
func (*Spreadsheet) SetSavePath ¶
func (spr *Spreadsheet) SetSavePath(savePath string)
SetSavePath sets or modifies the path to which a spreadsheet file is saved by SaveAndClose method.
func (*Spreadsheet) Workbook ¶
func (spr *Spreadsheet) Workbook() *Workbook
Workbook returns the workbook of the spreadsheet.
type VerticalAlign ¶
type VerticalAlign string
VericalAlign represents the vertical alignment properties of a text run.
const ( VerticalAlignBaseline VerticalAlign = "baseline" VerticalAlignSuperScript VerticalAlign = "superscript" VerticalAlignSubScript VerticalAlign = "subscript" )
VerticalAlign can be one of these values.
type Workbook ¶
type Workbook struct {
// contains filtered or unexported fields
}
Workbook represents the spreadsheet workbook. It provides methods to manage the worksheets of the spreadsheet.
func (*Workbook) NewWorksheet ¶
NewWorksheet adds a new worksheet of the given name to workbook and returns it.
func (*Workbook) WorksheetNames ¶
WorksheetNames returns a slice of names for all worksheets in the workbook.
type Worksheet ¶
type Worksheet struct {
// contains filtered or unexported fields
}
Worksheet represents a single worksheet in the workbook.
func (*Worksheet) NewRowReader ¶
NewRowReader opens the worksheet for reading and returns a row reader to read the rows. The worksheet should be closed by calling Close method after use.
func (*Worksheet) NewRowWriter ¶
NewRowWriter opens the worksheet for writing and returns a row writer to write rows. Close method muse be called after use to finish the writing process and close the worksheet.
func (*Worksheet) SetState ¶
func (ws *Worksheet) SetState(state WorksheetState)
SetState sets the worksheet to the given state.
func (*Worksheet) State ¶
func (ws *Worksheet) State() WorksheetState
State returns the state of the worksheet.
type WorksheetState ¶
type WorksheetState string
WorksheetState represents the visibility state of the worksheet.
const ( WorksheetStateVisible WorksheetState = "visible" WorksheetStateHidden WorksheetState = "hidden" WorksheetStateVeryHidden WorksheetState = "veryHidden" )
WorksheetState can be one these values.