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

Set size for the comment box 生成批注无法自适应大小 #1688

Closed
z-hua opened this issue Oct 10, 2023 · 1 comment
Closed

Set size for the comment box 生成批注无法自适应大小 #1688

z-hua opened this issue Oct 10, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@z-hua
Copy link
Contributor

z-hua commented Oct 10, 2023

Description

使用 AddComment 函数生成批注时,显示批注的 tips 无法显示全所有的批注,要手动编辑批注修改其宽高才能显示完全。我使用的是 WPS 。

Output of go version:

go version go1.21.1 windows/amd64

Excelize version or commit ID:

2.8.0

Environment details (OS, Microsoft Excel™ version, physical, etc.):

WPS

@xuri xuri added the enhancement New feature or request label Oct 10, 2023
@xuri xuri changed the title 生成批注无法自适应大小 Set size for the comment box 生成批注无法自适应大小 Oct 10, 2023
@xuri xuri added the in progress Working in progress label Oct 10, 2023
@xuri xuri closed this as completed in d9a0da7 Oct 10, 2023
@xuri
Copy link
Member

xuri commented Oct 10, 2023

Thanks for your issue. I have added support for set the height and width for the comments box, please try to upgrade the master branch code, and this feature will be released in the next version. Now you can change the comments box size like this:

err := f.AddComment("Sheet1", excelize.Comment{
    Cell:   "A5",
    Author: "Excelize",
    Paragraph: []excelize.RichTextRun{
        {Text: "Excelize: ", Font: &excelize.Font{Bold: true}},
        {Text: "This is a comment."},
    },
+   Height: 40,
+   Width:  180,
})

@xuri xuri removed the in progress Working in progress label Oct 10, 2023
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
- Using sync map internally to get cell value concurrency safe
- Support set the height and width for the comment box
- Update the unit test
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