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

Tint value is not read correctly #695

Closed
H-Hervert opened this issue Nov 18, 2021 · 10 comments
Closed

Tint value is not read correctly #695

H-Hervert opened this issue Nov 18, 2021 · 10 comments

Comments

@H-Hervert
Copy link

I code in C#. I use NPOI(version 2.5.5).

I have this excel file whose extention is .xlsx:

dOcS2

I editted the Excel sheet via NPOI.

code:

private void button_editByNpoi_Click(object sender, EventArgs e)
        {
            string filePath = destFileName;

            IWorkbook workbook;
            using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read))
            {
                workbook = new XSSFWorkbook(fs);
            }

            /*
            //1枚目のシートを取得
            ISheet sheet = workbook.GetSheetAt(0);

            //セルを取得
            IRow row = sheet.GetRow(1);
            ICell cell = row.GetCell(1);

            //セルに書き込み
            //cell.SetCellValue("a");
            */

            using (FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write))
            {
                //上書き保存する。
                workbook.Write(fs);
            }
        }

As the result, I got this excel sheet:

59NUX

the light gray color has gone after editting. How can I keep the color?

@tonyqus
Copy link
Member

tonyqus commented Nov 18, 2021

こにじわ
This looks to be a bug. Can you share your Excel file?

@H-Hervert H-Hervert changed the title Ligt gray of backgroud color in cells are gone when you edit the excel sheet by NPOI Light gray of backgroud color in cells are gone when you edit the excel sheet by NPOI Nov 22, 2021
@H-Hervert
Copy link
Author

H-Hervert commented Nov 22, 2021

I attached the Excel file. Please refer to this.

template - コピー.xlsx

@tonyqus
Copy link
Member

tonyqus commented Nov 23, 2021

something wrong with the styles.xml in the xlsx file
图像_2021-11-24_065133

The tint value is lost because the original tint value uses scentific numberic value. Btw, is this file generated by Microsoft Office directly or from 3rd party software?

@tonyqus tonyqus added this to the NPOI 2.5.6 milestone Nov 23, 2021
@H-Hervert
Copy link
Author

something wrong with the styles.xml in the xlsx file 图像_2021-11-24_065133

The tint value is lost because the original tint value uses scentific numberic value. Btw, is this file generated by Microsoft Office directly or from 3rd party software?

This file was generated by Microsoft Office directly.

@tonyqus tonyqus removed this from the NPOI 2.5.6 milestone Feb 13, 2022
@tonyqus tonyqus closed this as completed Feb 13, 2022
@lukasz-gabryel
Copy link

Why you closed this ticket? I have this same problem, and this bug still exists.

@H-Hervert
Copy link
Author

H-Hervert commented Apr 3, 2022

As @lukasz-gabryel mentioned, the bug has not been fixed yet, right? When will it be fixed?

@tonyqus tonyqus modified the milestones: NPOI 2.6.1, NPOI 2.6.0 May 2, 2022
@tonyqus tonyqus added the xlsx label May 2, 2022
@tonyqus tonyqus closed this as completed in 1da50c2 May 2, 2022
@tonyqus tonyqus changed the title Light gray of backgroud color in cells are gone when you edit the excel sheet by NPOI Tint value is not readed correctly May 2, 2022
@tonyqus tonyqus changed the title Tint value is not readed correctly Tint value is not read correctly May 2, 2022
@H-Hervert
Copy link
Author

@tonyqus Has this bug fixed?

@tonyqus
Copy link
Member

tonyqus commented May 5, 2022

Yes, it will be available in 2.6.0

@H-Hervert
Copy link
Author

Yes, it will be available in 2.6.0

I see. So it will be fixed in 2.6.0. And 2.6.0 hasn't been finalized yet at the moment. Do you have the timeline for when 2.6.0 will be released?

@tonyqus
Copy link
Member

tonyqus commented Jun 8, 2022

The planned release date is Oct, 2022. Release note is here: #742

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants