ExcelHelper

package
v1.1.26 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: AGPL-3.0 Imports: 2 Imported by: 0

README

数据excel操作

  1. 导出数据到excel
data := [][]string{}
cols := []string{"id", "name", "value"}

for i := 1; i <= 10000; i++ {
  id := fmt.Sprintf("%d", i)
  name := fmt.Sprintf("name-%d", i)
  value := fmt.Sprintf("value-%d", i)
  itemData := []string{id, name, value}
  data = append(data, itemData)
}
wEx:=NewWriteExcel()
wEx.SetTitle(cols)
wEx.SetData(data)
wEx.SetShellNum(1)
err:=wEx.Write("test.xlsx")
if err !=nil{
  fmt.Println("写入失败", err)
}else{
  fmt.Println("数据写入完成!!!")
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CellCols = []string{"A", "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"}

excel个列的简称 https://blog.csdn.net/wtt234/article/details/124531074

Functions

func NewWriteExcel

func NewWriteExcel() *writeExcel

Types

This section is empty.

Jump to

Keyboard shortcuts

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