tealeg / xlsx

Go library for reading and writing XLSX files.
Other
5.81k stars 810 forks source link

Don't work example add cell #724

Closed Dementir closed 2 years ago

Dementir commented 2 years ago

Hello i updated lib to v3.2.3

I try example:

    file := xlsx.NewFile()
    sheet, err := file.AddSheet("Sheet1")
    if err != nil {
        fmt.Printf(err.Error())
    }
    row := sheet.AddRow()
    cell := row.AddCell()
    cell.Value = "I am a cell!"
    err = file.Save("MyXLSXFile.xlsx")
    if err != nil {
        fmt.Printf(err.Error())
    }

And in file i saw that first row is hidden. Excel version - 16.51 (21071101)

Снимок экрана 2021-07-25 в 15 53 57
linzhicheng5512 commented 2 years ago

you need set row height with row.SetHeight(), the default height of row is 0.

rentiansheng commented 2 years ago

you need set row height with row.SetHeight(), the default height of row is 0.

No, the A1 cell of this operation has a width by default。

I suspect that the wrong file was opened.

Dementir commented 2 years ago

Problem is this. I didn't set height because in previous version library have default height

ty @rentiansheng you need set row height with row.SetHeight(), the default height of row is 0.