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

Glossary Item Box

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.

Return to the overview of Managing Printing.

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
© 2002-2012 GrapeCity, Inc. All Rights Reserved.