Recently, I meet a problem that I need to insert header and footer in excel with C#, I use the following code:

        Worksheet sheet = workbook.Worksheets[0];
        sheet.PageSetup.FullHeaderString = "E-iceblue";
        sheet.PageSetup.IsPrintHeadings = true;
        sheet.Visibility = WorksheetVisibility.Visible;

        sheet.PageSetup.LeftFooter = "everlasting";

But when I launch it, the header and footer do not appear in the excel table, after I click insert header and footer button, it shows, When I put it in a view and print it out, it shows header and footer.What is the problem?

Can anybody help me?
I use the OS and Spire.XLS.

Recommended Answers

All 2 Replies

Perhaps your excel is not set to display the header & footer even though they are there?

That possibility is very small.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.