Quick Header/Footer question

Feb 23, 2011 at 6:56 PM

It looks like Header./Footer.Left, Center, and Right are just strings.  Is there any way to adjust the style?  Specifically I'd like to decrease the font size for my footings.

Apr 6, 2011 at 6:41 AM

I meet the same situation as you do. Well, I write  a simple code as example.(Using C#)

sheet1.header.center="My title";

It seems whenever i use this code. The header's original style of my template excel file  will  be cleared again after I export to a new excel file.

but I can't find which way can "rebuild"  the header style. Such as  font size,bold,underline.

ps. "sheet1" is my sheet name of exporting excel. 

 

Apr 6, 2011 at 9:58 AM

ok...I have done. Here is  your answer. At first, this is not NPOI's fault, just because we don't know the thoughtof excel. 

 I write a simple code about it (Using C#)

sheet1.header.center="My title";  ==>It will print out the string using Excel 's default font.

and I change a little bit.

sheet1.header.center=" &B &14 &\"Arial\" My title"; ==>It will print out the string using Bold font ,Font size as 14 ,and Font name as Arial.

then you may find the clue. 

I suggest you may find your answer by using VBA 's Programming thought. Good Luck.

 

 

Apr 6, 2011 at 3:08 PM

That's a big help, thank you very much