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

set header background color using code #184

Open
emkoos opened this issue Apr 22, 2022 · 1 comment
Open

set header background color using code #184

emkoos opened this issue Apr 22, 2022 · 1 comment

Comments

@emkoos
Copy link

emkoos commented Apr 22, 2022

Hi. Is it possible to create styles for header using code when creating a file?

I found a solution using the event to set the AutoSizeColumns, but with the colors it doesn't work anymore, because the Save function overwrites them.

@mganss
Copy link
Owner

mganss commented Apr 22, 2022

The invocation of the Saving event happens right before the workbook is written so I'm surprised the style gets overwritten:

Saving?.Invoke(this, new SavingEventArgs(sheet));
Workbook.Write(stream);

Have you already investigated where the overwriting occurs?

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

No branches or pull requests

2 participants