Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Implement Conditional Formatting for worksheet #33
I'm interested in this feature. I started working on it in my fork (progress so far), but I have a couple of questions.
As an example, here's what Excel on Mac generates (closing
RE: 1) Absolutely perfect.
It is basically a container node for
Models for all of those objects are already in the stylesheet directory, I just never got around to making a dxf class :(
The last step would be adding adding an option for add_style to mark the style as differential and return the dxfs index so when you create your conditional_formatting_rule, you have an dxfId.
In the mean time, please send in a pull request for your stuff!
referenced this issue
Apr 20, 2012
added a commit
Apr 20, 2012
I did some more work on this today, and Dxf elements now exist. I think all the commits got automatically added to the pull request I sent earlier.
I did a bunch of messing around with Styles#add_style so that styles for Xf elements continue to get put inside
With the most recent commits I'm able to create .xlsx files with working conditional formatting (see examples/example_conditional_formatting.rb). We're still missing support for dataBar, colorScale, and iconSet child elements of ConditionalFormattingRule, which aren't that important to me.
@scpike This is really great work mate. You now have full access to the repo so when you run into something you want, please don't hesitate to add it in. I am really impressed with the quality of your work. I've set you up with direct access to the repo. If you ever have any questions you can usually find me lurking in #axlsx (the ci environment for this gem reports there) or #travisci on freenode.
I just plugged in colorScale and will knock off dataBar and iconSet today as well so we can call it done (until someone reports a bug of course!)
That Style#add_style method does indeed need a bit of love - but I am so impressed with this I think I'll release it next week with a blog post! Let me know your twitter handle if you have one.
It is all implemented - but we need some testing help!
After spending a few hours to build in icon set, data bar and color scale - only to find out that my crappy 2007 Mac version tells me very politely that it does not support those conditional formats. Any out there have a windows version handy to do some testing? No validation errors or fix errors so the data should be clean - just cant verify if it actually works...
@randym Thanks for the compliment, you really know who to make a guy want to contribute!
I have Excel for Mac 2011, which supports icon set, data bar, and color scale. They worked with no errors, but the Icon set showed all green lights. I modified IconSet#initial_value_objects to have three based on percentages, so our default now matches the example in 184.108.40.206, and got a much nicer looking thing.