You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
480 B
26 lines
480 B
package Test
|
|
|
|
import (
|
|
"github.com/tealeg/xlsx"
|
|
"testing"
|
|
)
|
|
|
|
func TestReadXlsx(t *testing.T){
|
|
outFileName:=`E:\Work\dsMin\dsBaseWeb\Html\ExcelTemp\test2.xlsx`
|
|
file := xlsx.NewFile()
|
|
sheet,err := file.AddSheet("sheet1")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
row := sheet.AddRow()
|
|
row.SetHeightCM(1) //设置每行的高度
|
|
cell := row.AddCell()
|
|
cell.Value = "haha"
|
|
cell = row.AddCell()
|
|
cell.Value = "1234567"
|
|
err = file.Save(outFileName)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|