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

get style details #314

Closed
shaunc opened this issue Dec 20, 2018 · 15 comments · Fixed by #1574
Closed

get style details #314

shaunc opened this issue Dec 20, 2018 · 15 comments · Fixed by #1574
Labels
enhancement New feature or request

Comments

@shaunc
Copy link

shaunc commented Dec 20, 2018

Description

Need api (or doc at least) on how to go from style number to attributes of style (such as color).

I am trying to get the color of a particular cell in a spreadsheet I am reading. I don't see how this is possible. There is a function that returns a handle to the style, but what to do with that number?

Describe the results you received:

Documentation has no information on how to get color from style.

Describe the results you expected:

Documentation would explain how to get color from style in terms of API details.

Output of go version:

go version go1.11.3 darwin/amd64

Excelize version or commit ID:

v1.4.0```
@dayfine
Copy link

dayfine commented Dec 21, 2018

Is this an Excel issue or excelize issue?
http://dmcritchie.mvps.org/excel/colors.htm

Would also be nice to name the API you tried to call....

@xuri xuri added the enhancement New feature or request label Jan 7, 2019
@dolmen
Copy link
Contributor

dolmen commented Jan 18, 2019

@dayfine The point of this issue is that there is no API to retrieve the style definition from a style ID retrieved with GetCellStyle.

@kor44
Copy link

kor44 commented Mar 23, 2020

Can't find documentation how to get details about style by ID returned GetCellStyle.

@xuri
Copy link
Member

xuri commented Mar 23, 2020

Hi @kor44, the style ID return by GetCellStyle used for set other cells with the same style, this lib doesn't support to get cell style details currently, but the File.Style struct is helpful, you can parse it manually to get the style as you need, also reference this example: get cell background color.

@kor44
Copy link

kor44 commented Mar 25, 2020

@xuri thanks for answer.

@RobbieMcKinstry
Copy link

Is there any plan to add this feature in the future? Would you be willing to accept a PR?

@xuri
Copy link
Member

xuri commented Jun 25, 2020

I will consider adding support for this feature later. I'll certainly accept that patch if somebody did that.

@Jonham
Copy link
Contributor

Jonham commented Jan 7, 2022

hi, @xuri I would like to implement this. Can give any guide on how to add or change any api.

@xu123shuai456
Copy link

@Jonham Hello, do you have an API to get the style through the style ID?

@xuri
Copy link
Member

xuri commented Apr 4, 2023

This feature has been working in progress (as a project of the Institute of Software Chinese Academy of Sciences 2023 Open Source Promotion Plan), the library will be supported to get style definitions by index in a future released version, in August, 2023.

@ernierasta
Copy link

I am also very excited for this feature, let us know if there is progress on that! And thank you for excellent library!

@GoldenSheep402
Copy link

I’m quite interested in this feature.
Does this mean giving the block which you want to get the style and then checking the form of the block and get the style by the form of the block?
Or giving an area and get all the style including the area?

@xuri
Copy link
Member

xuri commented Apr 26, 2023

As the dolmen says:

The point of this issue is that there is no API to retrieve the style definition from a style ID retrieved with GetCellStyle.

This library needs a function for reading style definition details, the style is read in the style sheet through the given style ID and returns the complete style formats.

@SingAurora
Copy link

This feature has been working in progress (as a project of the Institute of Software Chinese Academy of Sciences 2023 Open Source Promotion Plan), the library will be supported to get style definitions by index in a future released version, in August, 2023.

I will put all my energy into this advanced project. Working on another project has a high probability of failure.
我就死磕这一个项目,再开一个,不能投入大量精力,感觉大概率要陪跑

@xuri xuri linked a pull request Aug 24, 2023 that will close this issue
10 tasks
xuri pushed a commit that referenced this issue Aug 24, 2023
- Add new function GetStyle support for get style definition
@xuri xuri removed the in progress Working in progress label Aug 24, 2023
@xuri
Copy link
Member

xuri commented Aug 25, 2023

The new function GetStyle has been added. Now, we can get style index at first, and then get the style definition with that. Please try to upgrade the master branch code. This feature will be released in the next version.

jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
…x-os#1574)

- Add new function GetStyle support for get style definition
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

Successfully merging a pull request may close this issue.