How to draw page numbers, headers and footers

<< Click to display table of contents >>

How to draw page numbers, headers and footers

Complex headers and footers, the same for all pages

The component supports complex headers and footers, they can be multiline, contain images, tables, etc.

They must be assigned to TRVPrint component by the methods SetHeader and SetFooter.

See the example:


You can assign special headers and footers for the first page, odd/even pages.

You can insert page numbers and page counts.

Drawing headers and footers yourself

If you need different headers for different pages, you need to draw them yourself, using OnPagePrepaint event.

This demo shows how to draw a simple text as a header:


Since you draw this text yourself, you can draw as many lines as you want.

RichViewActions process this event themselves and draw one plain text line. They understand several codes like page number and pages count.

Drawing complex headers and footers using TRVReportHelper

If you need to draw more complex headers (different for different pages), you can use TRVReportHelper component for this.

Examples are shown in this forum topic: