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

Handle and updates worksheet dimensions automatically #1200

Open
Strangeralonel opened this issue Apr 7, 2022 · 5 comments
Open

Handle and updates worksheet dimensions automatically #1200

Strangeralonel opened this issue Apr 7, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@Strangeralonel
Copy link

I used "excel" to add a line at the end of the workbook and save it. It's work, and both office and WPS can preview it.

But when I use Node to read this file, I can't read the newly added content. The NODE found an attribute "! Ref". This area is still the old attribute

It is worth mentioning that when I found that the NODE could not read the information normally, I saved it again with "office / WPS". It is found that the node can be read normally.

So I guess "! Ref" represents the content range of EXECL. Whether to update the relevant content when it is not saved. Unfortunately, my ability is not enough to read the source code and modify it.

My Go Code:

        file, err := excelize.OpenFile("./1.xlsx")
	if err != nil {
		log.Println("open err: ", err)
	}
	file.SetCellInt("Sheet1", "A2", 22)
	file.SetCellInt("Sheet1", "B2", 22)

	if err := file.Save(); err != nil {
		log.Println("save err :", err)
	}

My Node Code:

let xlsx = require('xlsx');

let workbook = xlsx.readFile('1.xlsx');

let sheetNames = workbook.SheetNames;

console.log(workbook.Sheets["Sheet1"])

Describe the results you received:
image

Describe the results you expected:
'!ref': 'A2:B2',

Go Environment:
go version go1.15.6 darwin/amd64
github.com/xuri/excelize/v2 v2.5.0

Node Environment:
v16.14.2
xlsx: "^0.18.5"

Thanks

@xuri
Copy link
Member

xuri commented Apr 7, 2022

Thanks for your feedback. Please provide your input file attachment without confidential info if you can.

@xuri xuri added the needs more info This issue can't reproduce, need more info label Apr 7, 2022
@Strangeralonel
Copy link
Author

Strangeralonel commented Apr 7, 2022

okay ~
@xuri

this just a test file

1.xlsx

@xuri
Copy link
Member

xuri commented Apr 7, 2022

This library doesn't handle and updates worksheet dimensions automatically when saving the spreadsheet currently. I'll consider adding this feature support later. You can calculate it by the total columns and rows of the worksheet.

@xuri xuri changed the title After saving,useing node cannot read new data Handle and updates worksheet dimensions automatically Apr 7, 2022
@xuri xuri added enhancement New feature or request and removed needs more info This issue can't reproduce, need more info labels Apr 7, 2022
@Strangeralonel
Copy link
Author

Thanks, can i see this feature in the next version?
Sorry, I didn't mean to urge you。because it too important to me ~~

@xuri
Copy link
Member

xuri commented Apr 7, 2022

Sorry, this feature won't be released in the next version. You can calculate it by the total columns and rows of the worksheet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants