Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read generated file by GetRows or Rows return unexpect result #732

Closed
kaideng-nmg opened this issue Nov 17, 2020 · 1 comment
Closed

Read generated file by GetRows or Rows return unexpect result #732

kaideng-nmg opened this issue Nov 17, 2020 · 1 comment
Labels
confirmed This issue can be reproduced

Comments

@kaideng-nmg
Copy link

kaideng-nmg commented Nov 17, 2020

Description

I test read excel file with an generated by this package.If I use GetRows or Rows function.It will return unexpect result.return result not rows result.It return data one by one cell.but the GetCols and Cols is correctly.I generate the excel file with StreamWriterAPI and Style

Describe the results you received:
2020-11-17_18-36

Describe the results you expected:
It should return whole row data

generate file code

styleID, _ := e.File.NewStyle(&excelize.Style{
		Font: &excelize.Font{
			Size: 13, // 设置字体大小
		},
		Alignment: &excelize.Alignment{
			Horizontal: "center", // 水平剧中
			Vertical:   "center", // 垂直剧中
		},
	})
if err = StreamWriter.SetRow(fromCell, []interface{}{excelize.Cell{StyleID: styleID, Value: value}}); 
     err != nil {return}

read code

file, err := excelize.OpenFile(path)
	if err != nil {
		return err
	}
rows, err := file.GetRows(sheetName)
	if err != nil {
		return nil, err
	}
	return rows, nil

Environment details (OS, Microsoft Excel™ version, physical, etc.):
excelize version: 2.3.1
go version: go1.15.3 linux/amd64
os: ubuntu18

similar with #519

test.zip this is Excel file

@xuri xuri added confirmed This issue can be reproduced in progress Working in progress labels Nov 18, 2020
@xuri xuri closed this as completed in 92c8626 Nov 18, 2020
@xuri
Copy link
Member

xuri commented Nov 19, 2020

Thanks for your issue. I have fixed it, please try to use the master branch code, and this patch will be released in the next version.

@xuri xuri removed the in progress Working in progress label Nov 19, 2020
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed This issue can be reproduced
Projects
None yet
Development

No branches or pull requests

2 participants