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

Add styling support for Excel (binary) format #19

Open
jimkohl opened this issue Dec 10, 2019 · 5 comments
Open

Add styling support for Excel (binary) format #19

jimkohl opened this issue Dec 10, 2019 · 5 comments
Assignees

Comments

@jimkohl
Copy link

jimkohl commented Dec 10, 2019

I really like the patterns setup here. Looks like the various styling options for tables are not supported for Excel. The default font is WAY too small and I want also to BOLD headers.
I tried using the patterns laid out (and it is even stated they aren't supported).
Is there a plan for adding this?

Any suggestions as to how I can force this to a bigger font?
I'll dig into the code more but I think this would be a huge value.
Thanks
jim

@jimkohl
Copy link
Author

jimkohl commented Dec 11, 2019

Also have tried using panda but that's not working either :(.

@jimkohl
Copy link
Author

jimkohl commented Dec 12, 2019

I just decided to mess w the objects hanging off of pytablewriter instead to get rid of the difficult to read choice of font / size:
self.writer.open(file_path)
self.writer = self.tableWriterClass()
self.writer.MAX_CELL_WIDTH = 15
self.format_table['header']['font_name'] = "Arial"
self.format_table['header']['font_size'] = 14
self.default_format['font_size'] = 14
self.default_format['font_name'] = "Arial"

I'm sure there's more brute force stuff to discover ahead, but it would really be good if the various cell styling things followed patterns of Markdown, etc. such as column centering.

@thombashi thombashi self-assigned this Jan 1, 2020
@thombashi
Copy link
Owner

thombashi commented Jan 1, 2020

Thank you for your feedback.

Unfortunately, Excel writer classes have not supported style settings for now.
However I have plan to support that feature.

@jimkohl
Copy link
Author

jimkohl commented Jan 1, 2020 via email

@stezz
Copy link

stezz commented Nov 7, 2020

Lovely project @thombashi ! I have the same issue as @jimkohl and ended up solving it the same way. However I believe that a quick and dirty fix would be just to set
Default.FONT_NAME = 'Arial'
Then the style would be just fine and the whole need would disappear. Frankly I believe that 'MS Gothic' is not the best default font for an Excel ;)
Thanks again for your efforts and giving us this great lib!

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