Documentation ¶
Index ¶
- func ArrayToExcel(sheetName string, data [][]string) (*xlsx.File, error)
- func ExportCSV(excelFileName string, sheetIndex int, delimiter string, out io.Writer) error
- func GetCellValue(location, sheetName, cell, errDefault string) string
- func GetCellsValues(location, sheetName string, cells []string, errDefault string) (values []string)
- func GetLetterIndex(letter string) (r int)
- func GetMapKeys(m map[string]interface{}) (keys []string)
- func GetRowColIndex(cell string) (row, col int)
- func GetRowColValue(location, sheetName string, row, col int, errDefault string) string
- func GetSheetCellValue(sheet *Sheet, cell, errDefault string) string
- func GetSheetCellsValues(sheet *Sheet, cells []string, errDefault string) (values []string)
- func GetSheetColumnNames(file string, sheetName string) ([]string, error)
- func GetSheetNameByIndex(file string, index int) (string, error)
- func GetSheetNames(location string) ([]string, error)
- func GetSheetRowColValue(sheet *Sheet, row, col int, errDefault string) string
- func ImportCSV(csvPath string, delimiter string) (*xlsx.File, error)
- func IsHasSheet(file, sheetName string) bool
- func JSONToExcel(sheetName string, jsData []byte, include string, exclude string, locale string) (*xlsx.File, error)
- func OpenBook(location string) (*xlsx.File, error)
- func PrintSheet(sheet *Sheet)
- func PrintSheetByIndex(file string, sheetIndex int)
- func PrintSheetByName(file string, sheetName string)
- func PrintSheetNames(file string)
- func SqlRowsToExcel(sheetName string, rows *sql.Rows, include string, exclude string) (*xlsx.File, error)
- func SqlRowsToExcelWithLocale(sheetName string, tableName string, rows *sql.Rows, include string, ...) (*xlsx.File, error)
- func ValueToExcel(sheetName string, rows interface{}, include string, exclude string) (*xlsx.File, error)
- func ValueToExcelWithLocale(sheetName string, rows interface{}, include string, exclude string, ...) (*xlsx.File, error)
- type Sheet
- func GetSheet(file string, sheetIndex int) (*Sheet, error)
- func GetSheetByIndex(file string, sheetIndex int) (*Sheet, error)
- func GetSheetByName(file string, sheetName string) (*Sheet, error)
- func GetSheetFromBookByIndex(book *xlsx.File, sheetIndex int) (*Sheet, error)
- func GetSheetFromByteArray(data []byte, sheetIndex int) (*Sheet, error)
- func NewSheet(sheet *xlsx.Sheet) *Sheet
- func (s *Sheet) GetCellFloat64ByRowIndexColName(rowIndex int, colName string) float64
- func (s *Sheet) GetCellIntByRowIndexColName(rowIndex int, colName string) int
- func (s *Sheet) GetCellValue(cell string) (value string)
- func (s *Sheet) GetCellValueByRowIndexColName(rowIndex int, colName string) string
- func (s *Sheet) GetColNameIndex(colName string) int
- func (s *Sheet) GetHeaderRowValues() (vs []string)
- func (s *Sheet) GetRowColValue(row, col int, errDefault string) (value string)
- func (sheet *Sheet) Print()
- func (sheet *Sheet) PrintCell(cell string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayToExcel ¶
ArrayToExcel write data
func GetCellValue ¶
GetCellValue return file sheet cell value cell is Excel format. eg: AA23
func GetCellsValues ¶
func GetCellsValues(location, sheetName string, cells []string, errDefault string) (values []string)
GetCellsValues returns cells values
func GetLetterIndex ¶
GetLetterIndex returns Excel Cell ColumnIndex index start from 0
func GetMapKeys ¶
GetMapKeys return map keys
func GetRowColIndex ¶
GetRowColIndex returns Cell row and column index. the index start from 0
func GetRowColValue ¶
GetRowColValue returns excel row col value parameters: location sheetname, row,col
func GetSheetCellValue ¶
GetSheetCellValue returns sheet cell value
func GetSheetCellsValues ¶
GetSheetCellsValues return cells values.
func GetSheetColumnNames ¶
GetSheetColumnNames returns Sheet column names, call sheet GetHeaderRowValues
func GetSheetNameByIndex ¶
GetSheetNameByIndex returns index sheet name.
func GetSheetNames ¶
GetSheetNames returns include sheet names.
func GetSheetRowColValue ¶
GetSheetRowColValue returns sheet row col value
func JSONToExcel ¶
func JSONToExcel( sheetName string, jsData []byte, include string, exclude string, locale string, ) (*xlsx.File, error)
JSONToExcel define values jsData should contain a array
func PrintSheetByIndex ¶
PrintSheetByIndex print
func SqlRowsToExcel ¶
func SqlRowsToExcel(sheetName string, rows *sql.Rows, include string, exclude string) (*xlsx.File, error)
SqlRowsToExcel sql rows to excel disable locale
func SqlRowsToExcelWithLocale ¶
func SqlRowsToExcelWithLocale(sheetName string, tableName string, rows *sql.Rows, include string, exclude string, locale string, enableLocale bool) (*xlsx.File, error)
SqlRowsToExcelWithLocale sql rows to excel Locale message, table column name. params:
sheetName rows include exclude locale enableLocale
Types ¶
type Sheet ¶
Sheet define sheet
func GetSheetByIndex ¶
GetSheetByIndex returns Sheet index from 0
func GetSheetByName ¶
GetSheetByName returns Sheet
func GetSheetFromBookByIndex ¶
GetSheetFromBookByIndex returns Sheet
func GetSheetFromByteArray ¶
GetSheetFromByteArray returns Sheet
func (*Sheet) GetCellFloat64ByRowIndexColName ¶
GetCellFloat64ByRowIndexColName return cell float value
func (*Sheet) GetCellIntByRowIndexColName ¶
GetCellIntByRowIndexColName return cell int value
func (*Sheet) GetCellValue ¶
GetCellValue returns cell value
func (*Sheet) GetCellValueByRowIndexColName ¶
GetCellValueByRowIndexColName returns cell value
func (*Sheet) GetColNameIndex ¶
GetColNameIndex returns colname index -1 means not found.
func (*Sheet) GetHeaderRowValues ¶
GetHeaderRowValues return header row values
func (*Sheet) GetRowColValue ¶
GetRowColValue returns row col value process out of index error