apply_styles method on sheet #9
Comments
If you work with vanilla As far as |
I think hiding that might solve the issue. How would it work though? |
It's possible that we can patch |
I like that idea. Make sure to also patch the |
We could do it like this: module AxlsxStyler
module Axlsx
module Package
original_serialize = instance_method(:serialize)
define_method :serialize do
@workbook.apply_styles
original_serialize.bind(self).()
end
original_to_stream = instance_method(:to_stream)
define_method :to_stream do
@workbook.apply_styles
original_to_stream.bind(self).()
end
end
end
end I read this method of patching from this stackoverflow post http://stackoverflow.com/questions/4470108/when-monkey-patching-a-method-can-you-call-the-overridden-method-from-the-new-i |
Thanks for the example. I will look at it some time next week. In the meantime it would be great to know what is the root cause of your problems. |
Sorry I should have mentioned that its not an issue. I was just wondering if that method could possibly done on the sheet level but you say that's not possible so that's okay with me. |
Ah, good. I'm just going to close this one then. |
Are you still going to try and hide the call to |
I thought to slack away for a bit, but you're puting me on the spot 😄 Could you please review this change? |
Also, if you want to make your own PR, please feel free to do so. |
In my gem SpreadsheetArchitect I have the ability to create axlsx sheets individually. I was wondering if we can get the
workbook.apply_styles
to also be available assheet.apply_styles
so that I can apply the styling before returning the sheet.The text was updated successfully, but these errors were encountered: