Spread for ASP.NET 11 Product Documentation
Adding Headers and Footers to Printed Pages
Spread for ASP.NET 11 Product Documentation > Developer's Guide > Customizing User Interaction > Managing Printing > Adding Headers and Footers to Printed Pages

You can add headers and footers to the printed pages by using the Content property in the PrintSheet event. You can use HTML characters in the header or footer string. An example of this would be the line break tag, <BR>, for breaking to a new line.

Using Code

Set the Content property in the PrintSheet event.

Example

The following code adds a header and footer to the printed page.

C#
Copy Code
private void FpSpread1_PrintSheet(object sender, FarPoint.Web.Spread.PrintEventArgs e)
   {
     if (e.Header == true)
     {
      e.Content = "Header<BR>Test";
     }
    if (e.Header == false)
    {
     e.Content = "Footer";
    }
   } 
VB
Copy Code
Private Sub FpSpread1_PrintSheet(ByVal sender As Object, ByVal e As FarPoint.Web.Spread.PrintEventArgs) Handles FpSpread1.PrintSheet
   If e.Header = True Then
    e.Content = "Header<BR>Test"
   End If
   If e.Header = False Then
    e.Content = "Footer"
   End If
End Sub