Let me give you some practical advice since I have been down this road before:
1) Have a limit to the max chars in header and show ... after that
2) If someone from marketing argues about that, show them that it looks ugly in every program including Excel
3) Try using new lines to fit things better
4) Reduce font size
The algorithm should try to play around with new lines and font sizes to get a best fit and if the text is too large trim the end of it.
If someone from marketing/management argues about that, show them that it looks ugly in every program including Excel