Documentation
¶
Index ¶
- Variables
- func ColumnNumberToText(columnNumber int) (string, error)
- func ColumnTextToNumber(columnText string) int
- func ReadDemo(filename string)
- func WriteDemo(filename string)
- type Cell
- func (my *Cell) GetBorder() *array.AnyArray[border]
- func (my *Cell) GetContent() any
- func (my *Cell) GetContentType() CellContentType
- func (my *Cell) GetCoordinate() string
- func (my *Cell) GetFontBold() bool
- func (my *Cell) GetFontFamily() string
- func (my *Cell) GetFontItalic() bool
- func (my *Cell) GetFontRgb() string
- func (my *Cell) GetFontSize() float64
- func (my *Cell) GetPatternRgb() string
- func (my *Cell) GetWrapText() bool
- func (my *Cell) Init(content any) *Cell
- func (*Cell) NewByAny(content any) *Cell
- func (*Cell) NewByBool(content any) *Cell
- func (*Cell) NewByFloat64(content any) *Cell
- func (*Cell) NewByFormula(content string) *Cell
- func (*Cell) NewByInt(content any) *Cell
- func (*Cell) NewByTime(content time.Time) *Cell
- func (my *Cell) SetBorderBottomRbgFunc(condition func() (string, bool)) *Cell
- func (my *Cell) SetBorderBottomRgb(borderBottomRgb string, condition bool) *Cell
- func (my *Cell) SetBorderBottomStyle(borderBottomStyle int, condition bool) *Cell
- func (my *Cell) SetBorderBottomStyleFunc(condition func() (int, bool)) *Cell
- func (my *Cell) SetBorderDiagonalDownRbgFunc(condition func() (string, bool)) *Cell
- func (my *Cell) SetBorderDiagonalDownRgb(borderDiagonalDownRgb string, condition bool) *Cell
- func (my *Cell) SetBorderDiagonalDownStyle(borderDiagonalDownStyle int, condition bool) *Cell
- func (my *Cell) SetBorderDiagonalDownStyleFunc(condition func() (int, bool)) *Cell
- func (my *Cell) SetBorderDiagonalUpRbgFunc(condition func() (string, bool)) *Cell
- func (my *Cell) SetBorderDiagonalUpRgb(borderDiagonalUpRgb string, condition bool) *Cell
- func (my *Cell) SetBorderDiagonalUpStyle(borderDiagonalUpStyle int, condition bool) *Cell
- func (my *Cell) SetBorderDiagonalUpStyleFunc(condition func() (int, bool)) *Cell
- func (my *Cell) SetBorderLeftRbgFunc(condition func() (string, bool)) *Cell
- func (my *Cell) SetBorderLeftRgb(borderLeftRgb string, condition bool) *Cell
- func (my *Cell) SetBorderLeftStyle(borderLeftStyle int, condition bool) *Cell
- func (my *Cell) SetBorderLeftStyleFunc(condition func() (int, bool)) *Cell
- func (my *Cell) SetBorderRightRbgFunc(condition func() (string, bool)) *Cell
- func (my *Cell) SetBorderRightRgb(borderRightRgb string, condition bool) *Cell
- func (my *Cell) SetBorderRightStyle(borderRightStyle int, condition bool) *Cell
- func (my *Cell) SetBorderRightStyleFunc(condition func() (int, bool)) *Cell
- func (my *Cell) SetBorderSurrounding(borderRgb string, borderStyle int, condition bool) *Cell
- func (my *Cell) SetBorderSurroundingFunc(condition func() (string, int, bool)) *Cell
- func (my *Cell) SetBorderTopRbgFunc(condition func() (string, bool)) *Cell
- func (my *Cell) SetBorderTopRgb(borderTopRgb string, condition bool) *Cell
- func (my *Cell) SetBorderTopStyle(borderTopStyle int, condition bool) *Cell
- func (my *Cell) SetBorderTopStyleFunc(condition func() (int, bool)) *Cell
- func (my *Cell) SetContent(content any) *Cell
- func (my *Cell) SetContentType(contentType CellContentType) *Cell
- func (my *Cell) SetCoordinate(coordinate string) *Cell
- func (my *Cell) SetFontBold(fontBold bool, condition bool) *Cell
- func (my *Cell) SetFontBoldFunc(condition func() (bool, bool)) *Cell
- func (my *Cell) SetFontFamily(fontFamily string, condition bool) *Cell
- func (my *Cell) SetFontFamilyFunc(condition func() (string, bool)) *Cell
- func (my *Cell) SetFontItalic(fontItalic bool, condition bool) *Cell
- func (my *Cell) SetFontItalicFunc(condition func() (bool, bool)) *Cell
- func (my *Cell) SetFontRgb(fontRgb string, condition bool) *Cell
- func (my *Cell) SetFontRgbFunc(condition func() (string, bool)) *Cell
- func (my *Cell) SetFontSize(fontSize float64, condition bool) *Cell
- func (my *Cell) SetFontSizeFunc(condition func() (float64, bool)) *Cell
- func (my *Cell) SetPatternRgb(patternRgb string, condition bool) *Cell
- func (my *Cell) SetPatternRgbFunc(condition func() (string, bool)) *Cell
- func (my *Cell) SetWrapText(wrapText bool) *Cell
- type CellContentType
- type ReadError
- type Reader
- func (my *Reader) AutoRead(filename ...any) *Reader
- func (my *Reader) AutoReadBySheetName(sheetName string, filename ...any) *Reader
- func (my *Reader) Data() *dict.AnyDict[uint64, *array.AnyArray[string]]
- func (my *Reader) DataWithTitle() (*dict.AnyDict[uint64, *dict.AnyDict[string, string]], error)
- func (my *Reader) GetFinishedRow() int
- func (my *Reader) GetOriginalRow() int
- func (my *Reader) GetSheetName() string
- func (my *Reader) GetTitle() *array.AnyArray[string]
- func (my *Reader) GetTitleRow() int
- func (*Reader) New() *Reader
- func (my *Reader) OpenFile(filename ...any) *Reader
- func (my *Reader) Read() *Reader
- func (my *Reader) ReadTitle() *Reader
- func (my *Reader) SetDataByRow(rowNumber uint64, data []string) *Reader
- func (my *Reader) SetFinishedRow(finishedRow int) *Reader
- func (my *Reader) SetOriginalRow(originalRow int) *Reader
- func (my *Reader) SetSheetName(sheetName string) *Reader
- func (my *Reader) SetTitle(titles []string) *Reader
- func (my *Reader) SetTitleRow(titleRow int) *Reader
- func (my *Reader) ToDataFrame(titleWithType map[string]series.Type) dataframe.DataFrame
- func (my *Reader) ToDataFrameDefaultType() dataframe.DataFrame
- func (my *Reader) ToDataFrameDetectType() dataframe.DataFrame
- type Row
- type SetCellError
- type WriteError
- type Writer
- func (my *Writer) ActiveSheetByIndex(sheetIndex int) *Writer
- func (my *Writer) ActiveSheetByName(sheetName string) *Writer
- func (my *Writer) AddRow(excelRow *Row) *Writer
- func (my *Writer) CreateSheet(sheetName string) *Writer
- func (my *Writer) Download(writer http.ResponseWriter) error
- func (my *Writer) GetExcelizeFile() *excelize.File
- func (my *Writer) GetFilename() string
- func (*Writer) New(filename ...any) *Writer
- func (my *Writer) Save() error
- func (my *Writer) SetColumnWidthByIndex(col int, width float64) *Writer
- func (my *Writer) SetColumnWidthByText(col string, width float64) *Writer
- func (my *Writer) SetColumnsWidthByIndex(startCol, endCol int, width float64) *Writer
- func (my *Writer) SetColumnsWidthByText(startCol, endCol string, width float64) *Writer
- func (my *Writer) SetFilename(filename string) *Writer
- func (my *Writer) SetRows(excelRows []*Row) *Writer
- func (my *Writer) SetSheetName(sheetName string) *Writer
- func (my *Writer) SetTitleRow(titles []string, rowNumber uint64) *Writer
Constants ¶
This section is empty.
Variables ¶
var ( SetCellErr SetCellError ReadErr ReadError WriteErr WriteError )
Functions ¶
func ColumnNumberToText ¶
ColumnNumberToText 列索引转文字
Types ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Cell Excel单元格
var CellApp Cell
func (*Cell) GetContentType ¶
func (my *Cell) GetContentType() CellContentType
GetContentType 获取单元格类型
func (*Cell) NewByFloat64 ¶ added in v1.7.11
func (*Cell) NewByFormula ¶ added in v1.7.11
func (*Cell) SetBorderBottomRbgFunc ¶
SetBorderBottomRbgFunc 设置边框颜色:下 函数
func (*Cell) SetBorderBottomRgb ¶
SetBorderBottomRgb 设置边框颜色:下
func (*Cell) SetBorderBottomStyle ¶
SetBorderBottomStyle 设置边框样式:下
func (*Cell) SetBorderBottomStyleFunc ¶
SetBorderBottomStyleFunc 设置边框样式:下 函数
func (*Cell) SetBorderDiagonalDownRbgFunc ¶
SetBorderDiagonalDownRbgFunc 设置边框颜色:对角线下 函数
func (*Cell) SetBorderDiagonalDownRgb ¶
SetBorderDiagonalDownRgb 设置边框颜色:对角线下
func (*Cell) SetBorderDiagonalDownStyle ¶
SetBorderDiagonalDownStyle 设置边框样式:对角线下
func (*Cell) SetBorderDiagonalDownStyleFunc ¶
SetBorderDiagonalDownStyleFunc 设置边框样式:对角线下 函数
func (*Cell) SetBorderDiagonalUpRbgFunc ¶
SetBorderDiagonalUpRbgFunc 设置边框颜色:对角线上 函数
func (*Cell) SetBorderDiagonalUpRgb ¶
SetBorderDiagonalUpRgb 设置边框颜色:对角线上
func (*Cell) SetBorderDiagonalUpStyle ¶
SetBorderDiagonalUpStyle 设置边框样式:对角线上
func (*Cell) SetBorderDiagonalUpStyleFunc ¶
SetBorderDiagonalUpStyleFunc 设置边框样式:对角线上 函数
func (*Cell) SetBorderLeftRbgFunc ¶
SetBorderLeftRbgFunc 设置边框颜色:左 函数
func (*Cell) SetBorderLeftRgb ¶
SetBorderLeftRgb 设置边框颜色:左
func (*Cell) SetBorderLeftStyle ¶
SetBorderLeftStyle 设置边框样式:左
func (*Cell) SetBorderLeftStyleFunc ¶
SetBorderLeftStyleFunc 设置边框样式:左 函数
func (*Cell) SetBorderRightRbgFunc ¶
SetBorderRightRbgFunc 设置边框颜色:右 函数
func (*Cell) SetBorderRightRgb ¶
SetBorderRightRgb 设置边框颜色:右
func (*Cell) SetBorderRightStyle ¶
SetBorderRightStyle 设置边框样式:右
func (*Cell) SetBorderRightStyleFunc ¶
SetBorderRightStyleFunc 设置边框样式:右 函数
func (*Cell) SetBorderSurrounding ¶
SetBorderSurrounding 设置四周边框
func (*Cell) SetBorderSurroundingFunc ¶
SetBorderSurroundingFunc 设置四周边框 函数
func (*Cell) SetBorderTopRbgFunc ¶
SetBorderTopRbgFunc 设置边框颜色:上 函数
func (*Cell) SetBorderTopRgb ¶
SetBorderTopRgb 设置边框颜色:上
func (*Cell) SetBorderTopStyle ¶
SetBorderTopStyle 设置边框样式:上
func (*Cell) SetBorderTopStyleFunc ¶
SetBorderTopStyleFunc 设置边框样式:上 函数
func (*Cell) SetContentType ¶
func (my *Cell) SetContentType(contentType CellContentType) *Cell
SetContentType 设置单元格类型
func (*Cell) SetCoordinate ¶
SetCoordinate 设置单元格坐标
func (*Cell) SetFontBold ¶
SetFontBold 设置字体粗体
func (*Cell) SetFontBoldFunc ¶
SetFontBoldFunc 设置字体粗体:函数
func (*Cell) SetFontFamily ¶
SetFontFamily 设置字体
func (*Cell) SetFontFamilyFunc ¶
SetFontFamilyFunc 设置字体:函数
func (*Cell) SetFontItalic ¶
SetFontItalic 设置字体斜体
func (*Cell) SetFontItalicFunc ¶
SetFontItalicFunc 设置字体斜体:函数
func (*Cell) SetFontRgb ¶
SetFontRgb 设置字体颜色
func (*Cell) SetFontRgbFunc ¶
SetFontRgbFunc 设置字体颜色:函数
func (*Cell) SetFontSize ¶
SetFontSize 设置字体字号
func (*Cell) SetFontSizeFunc ¶
SetFontSizeFunc 设置字体字号:函数
func (*Cell) SetPatternRgb ¶
SetPatternRgb 设置填充色
func (*Cell) SetPatternRgbFunc ¶
SetPatternRgbFunc 设置填充色:函数
type CellContentType ¶
type CellContentType string
CellContentType 单元格内容类型
const ( CellContentTypeAny CellContentType = "any" CellContentTypeFormula CellContentType = "formula" CellContentTypeInt CellContentType = "int" CellContentTypeFloat64 CellContentType = "float64" CellContentTypeBool CellContentType = "bool" CellContentTypeTime CellContentType = "time" )
type Reader ¶
type Reader struct { Err error // contains filtered or unexported fields }
Reader Excel读取器
var ReaderApp Reader
func (*Reader) AutoReadBySheetName ¶
AutoReadBySheetName 自动读取(默认第一行是表头,从第二行开始)
func (*Reader) DataWithTitle ¶
DataWithTitle 获取数据:带有title的有序字典
func (*Reader) SetDataByRow ¶
SetDataByRow 设置单行数据
func (*Reader) SetFinishedRow ¶
SetFinishedRow 设置读取终止行
func (*Reader) SetOriginalRow ¶
SetOriginalRow 设置读取起始行
func (*Reader) SetSheetName ¶
SetSheetName 设置工作表名称
func (*Reader) ToDataFrame ¶
ToDataFrame 获取DataFrame类型数据
func (*Reader) ToDataFrameDefaultType ¶
ToDataFrameDefaultType 获取DataFrame类型数据 通过Excel表头自定义数据类型
func (*Reader) ToDataFrameDetectType ¶
ToDataFrameDetectType 获取DataFrame类型数据 通过自动探寻数据类型
type Row ¶
type Row struct { Err error // contains filtered or unexported fields }
Row Excel行
var RowApp Row
type SetCellError ¶ added in v1.10.26
func (*SetCellError) Error ¶ added in v1.10.26
func (my *SetCellError) Error() string
func (*SetCellError) Is ¶ added in v1.10.26
func (my *SetCellError) Is(target error) bool
func (*SetCellError) Panic ¶ added in v1.10.26
func (*SetCellError) Panic() myError.IMyError
type WriteError ¶ added in v1.10.26
func (*WriteError) Error ¶ added in v1.10.26
func (my *WriteError) Error() string
func (*WriteError) Is ¶ added in v1.10.26
func (my *WriteError) Is(target error) bool
func (*WriteError) Panic ¶ added in v1.10.26
func (*WriteError) Panic() myError.IMyError
type Writer ¶
type Writer struct { Err error // contains filtered or unexported fields }
Writer Excel写入器
var WriterApp Writer
func (*Writer) ActiveSheetByIndex ¶
ActiveSheetByIndex 选择工作表(根据编号)
func (*Writer) ActiveSheetByName ¶
ActiveSheetByName 选择工作表(根据名称)
func (*Writer) CreateSheet ¶
CreateSheet 创建工作表
func (*Writer) Download ¶
func (my *Writer) Download(writer http.ResponseWriter) error
Download 下载Excel
func (*Writer) GetExcelizeFile ¶
func (my *Writer) GetExcelizeFile() *excelize.File
GetExcelizeFile 获取excelize文件对象
func (*Writer) SetColumnWidthByIndex ¶
SetColumnWidthByIndex 设置单列宽:通过列索引
func (*Writer) SetColumnWidthByText ¶
SetColumnWidthByText 设置单列宽:通过列名称
func (*Writer) SetColumnsWidthByIndex ¶
SetColumnsWidthByIndex 设置多列宽:通过列索引
func (*Writer) SetColumnsWidthByText ¶
SetColumnsWidthByText 设置多列宽:通过列名称
func (*Writer) SetFilename ¶
SetFilename 设置文件名
func (*Writer) SetSheetName ¶
SetSheetName 设置sheet名称