xls

package
v0.0.0-...-a11b62f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const TableFormat = `` /* 139-byte string literal not displayed */

TableFormat 单位元样式

Variables

This section is empty.

Functions

func Cell

func Cell(col interface{}, row int) (cell string)

Cell 把坐标转换成单位元格

func ConvertDate

func ConvertDate(d string) string

ConvertDate 转换日期,把 05-16-20 格式的日期转换成 2020-05-16 格式,无法转换则返回原数据

func SetWidth

func SetWidth(book *excelize.File, sheet string, widthes map[string]float64)

SetWidth 设置宽度 Deprecated

func Write

func Write(book *excelize.File, sheet string, axis string, data util.Dater)

Write 向 Excel 写入数据 Deprecated

func WriteData

func WriteData(book *excelize.File, sheet string, axis string, data util.Dater, header string, widthes map[string]float64)

WriteData 向 Excel 写入数据 Deprecated

Types

type File

type File struct {
	*excelize.File
}

File Excel 文件

func NewFile

func NewFile() *File

NewFile 新建 Excel 文件

func (*File) GetSheet

func (f *File) GetSheet(index interface{}) *WorkSheet

GetSheet 获取工作表

func (*File) SaveAs

func (f *File) SaveAs(p interface{})

SaveAs 保存文件

func (*File) SetWidth

func (f *File) SetWidth(sheet string, widthes map[string]float64)

SetWidth 设置表格的宽度

func (*File) WriteData

func (f *File) WriteData(sheet string, axis string, header interface{}, data util.Dater)

WriteData 设置表格的宽度

type Reader

type Reader struct {
	*excelize.Rows
	// contains filtered or unexported fields
}

Reader Excel

func NewRowReader

func NewRowReader(xls *excelize.File, sheet string, skip int, converters ...text.ConvertFunc) *Reader

NewRowReader 工作表构造函数

func NewXlsReader

func NewXlsReader(r io.Reader, sheet string, skip int, converters ...text.ConvertFunc) *Reader

NewXlsReader Excel Reader 构造函数

func (*Reader) ReadAll

func (r *Reader) ReadAll(d text.Data)

ReadAll 读取所有数据

type WorkSheet

type WorkSheet struct {
	// contains filtered or unexported fields
}

WorkSheet 工作表

func (*WorkSheet) Rename

func (s *WorkSheet) Rename(newName string)

Rename 修改工作表名称

func (*WorkSheet) Write

func (s *WorkSheet) Write(axis string, header string, widthes map[string]float64, data util.Dater)

Write 写入数据

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL