excel

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DExcel = &Excel{}

Functions

This section is empty.

Types

type Excel

type Excel struct{}

func (*Excel) ExcelToSQL

func (obj *Excel) ExcelToSQL(filename string, sheetname string, tablename string, fields []string, is_column_mode bool) ([]string, error)

ExcelToSQL Excel转成SQL语句

func (*Excel) SliceToExcelBuff

func (obj *Excel) SliceToExcelBuff(s [][]interface{}) (buf *bytes.Buffer)

SliceToExcelBuff 将切片转换为Excel格式,并返回bytes.Buffer,可以保存为文件或写入http响应体

func (*Excel) SliceToExcelFile

func (obj *Excel) SliceToExcelFile(s [][]interface{}, path string, filename string) (err error)

SliceToExcelFile 将切片写入Excel文件

func (*Excel) SliceToGinResp

func (obj *Excel) SliceToGinResp(s [][]interface{}, filename string, context *gin.Context)

SliceToGinResp 将切片写入Excel文件,写入http响应体,实现Excel文件下载

func (*Excel) StructSliceToGinResp

func (obj *Excel) StructSliceToGinResp(slice interface{}, filename string, context *gin.Context)

StructSliceToGinResp 将结构体切片写入Excel文件,写入http响应体,实现Excel文件下载

func (*Excel) StructToSlice

func (obj *Excel) StructToSlice(slice interface{}, addFieldName bool) [][]interface{}

StructToSlice 将任意结构体切片转换为二维切片[][]interface{},addFieldName是否添加字段名

Jump to

Keyboard shortcuts

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