excel

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ColumnLetter = [...]string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "Values", "W", "X", "Y", "Z", "AA", "AB", "AC"}
View Source
var HeaderStyle = &excelize.Style{
	Border: []excelize.Border{{
		Type:  "left",
		Color: "000000",
		Style: 1,
	},
		{
			Type:  "top",
			Color: "000000",
			Style: 1,
		},
		{
			Type:  "bottom",
			Color: "000000",
			Style: 1,
		},
		{
			Type:  "right",
			Color: "000000",
			Style: 1,
		}},
	Fill: excelize.Fill{
		Type:    "pattern",
		Pattern: 1,
		Color:   []string{"#bfbfbf"},
	},
	Font: &excelize.Font{Bold: true},
	Alignment: &excelize.Alignment{
		Horizontal: "center",
		Vertical:   "center",
	},
	Protection:   nil,
	NumFmt:       0,
	CustomNumFmt: nil,
	NegRed:       false,
}
View Source
var Style = &excelize.Style{
	Alignment: &excelize.Alignment{
		Horizontal: "center",
		Vertical:   "center",
	},
}

Functions

func MergeCell

func MergeCell(sw *excelize.StreamWriter, startRowNum, endRowNum int, cells []string)

MergeCell performs the operation.

func NewFile

func NewFile(sheet string, header []string) (*excelize.File, error)

NewFile creates and returns a new instance.

func NewSheet

func NewSheet(f *excelize.File, sheet string, header []string) error

NewSheet creates and returns a new instance.

func SetBodyRow

func SetBodyRow(sw *excelize.StreamWriter, f *excelize.File, rowNum int, cellVal []any)

SetBodyRow updates or inserts a value.

func SetBodyRow2

func SetBodyRow2(sw *excelize.StreamWriter, f *excelize.File, rowNum int, cellVal []string, errStyleLoc map[int]byte)

SetBodyRow2 updates or inserts a value.

func SetCellDropListStyle

func SetCellDropListStyle(sw *excelize.StreamWriter, f *excelize.File, hiddenSheetName string, dropListSize int, effectCellStart, effectCellEnd string)

SetCellDropListStyle updates or inserts a value.

func SetHeaderRow

func SetHeaderRow(sw *excelize.StreamWriter, f *excelize.File, rowNum int, colWith float64, headers []string)

SetHeaderRow updates or inserts a value.

func SetNoteRow

func SetNoteRow(sw *excelize.StreamWriter, f *excelize.File, rowNum, maxCol int, rowHeight float64, note string) error

SetNoteRow updates or inserts a value.

func ToRow added in v1.7.10

func ToRow(v any) (headers []string, values []any, err error)

TODO: support struct map array subField, merge cell

Types

type ColumnNumber

type ColumnNumber int
const (
	A ColumnNumber = iota
	B
	C
	D
	E
	F
	G
	H
	I
	J
	K
	L
	M
	N
	O
	P
	Q
	R
	S
	T
	U
	V
	W
	X
	Y
	Z
	AA
	AB
	AC
)

func (ColumnNumber) Sting

func (c ColumnNumber) Sting() string

Sting returns the result.

type Export added in v1.7.10

type Export struct {
	Name string
	*excelize.File
	Options excelize.Options
}

func (*Export) Respond added in v1.7.10

func (res *Export) Respond(ctx context.Context, w http.ResponseWriter) (int, error)

Respond performs the operation.

func (*Export) ServeHTTP added in v1.7.10

func (res *Export) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP executes the operation.

func (*Export) WriteTo added in v1.7.10

func (e *Export) WriteTo(w io.Writer) (int64, error)

WriteTo performs the operation.

Jump to

Keyboard shortcuts

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