Code Monkey home page Code Monkey logo

Comments (5)

rabanti-github avatar rabanti-github commented on May 19, 2024

Hi
Thank you for the report. I will have a look at this ASAP.

But it could be that we have a reference problem here (probably a bug) with the Basic Styles. The styles are stored as references not values, and redefining BasicStyles.ColorizedBackground may override all references in the cells.
As quick fix, you could try to use the copy function of the style class to create two distinct styles instead of of using BasicStyle.ColorizedBackground directly.

But like said, I will look into it.

from picoxlsx.

AK5nowman avatar AK5nowman commented on May 19, 2024

Gave that a quick test, same results

Style evenStyle = new Style().CurrentFill.BackgroundColor = "a6a1a1";
Style diffStyle = new Style();
diffStyle.CurrentBorder.BottomStyle = Style.Border.StyleValue.medium;
diffStyle.CurrentBorder.BottomColor = "bf6262";

workbook.CurrentWorksheet.AddCellRange(data, new Cell.Address(0, idx), new Cell.Address(data.Count - 1, idx), evenStyle);
workbook.CurrentWorksheet.GetCell(2, idx).SetStyle(diffStyle);

from picoxlsx.

AK5nowman avatar AK5nowman commented on May 19, 2024

Mighty embarrassing... I had a variable mistyped in some supporting code that my breakpoints weren't capturing.

I apologize for wasting your time. Thank you for the repo!

from picoxlsx.

rabanti-github avatar rabanti-github commented on May 19, 2024

No Problem.
I know that the style section is quite complicated und not very well documented. A rewriting is ongoing since some months. But it will take probably some additional months until it can be released.
Please let me know if you find inconveniences, problems or bugs. Thank you.

from picoxlsx.

AK5nowman avatar AK5nowman commented on May 19, 2024

So I'm doing this below:

Style style1 = new Style();
style1.CurrentFill.BackgroundColor = "00ff00";
Style style2 = new Style();

And then I write some cells with an explicit style of either default or style1 or style2. The cells I'm expecting to have a colored background, because of style1, do not.

from picoxlsx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.