Version

Repeat Field Headers on All Pages

The WPF Reporting engine automatically prints the first occurrence of the field headers. If you bind a DataPresenter control to a flat data source that has many records, the WPF Reporting engine will only print the field headers at the top of the first page. However, you can modify this behavior by setting the ReportSettings object’s RepeatType property.

Note
Note

The LabelLocation property of a FieldLayoutSettings object overrides the RepeatType property of the ReportSettings object. If you set the LabelLocation property to InCells or Hidden, the RepeatType property will not affect the printout.

Settings

You can set the RepeatType property to the following RepeatType enumeration values:

  • FirstOccurrence - The default setting that prints the first occurrence of field headers.

  • PageBreak - The WPF Reporting engine prints the field headers at the top of the page for the first record in that particular page. If you have hierarchical data, it also prints the first occurrence of field headers for the child records in that page.

  • LevelBreak - This setting prints field headers for all sets of child records that are expanded as well as the next parent-level record. For example, if you expand the second record before printing, field headers will be printed for the first root-level record, the second record’s child records, and the third root-level record that follows the expanded child records. If you do not have hierarchical data, this setting is the same as PageBreak.

Flat Data Hierarchical Data

FirstOccurrence

xamData Repeat Field Headers on All Pages 01.png
xamData Repeat Field Headers on All Pages 02.png

PageBreak

xamData Repeat Field Headers on All Pages 03.png
xamData Repeat Field Headers on All Pages 04.png

LevelBreak

xamData Repeat Field Headers on All Pages 05.png
xamData Repeat Field Headers on All Pages 06.png

The example code demonstrates how to repeat field headers on all pages. The example code assumes you already have a Report object named report1.

In Visual Basic:

Imports Infragistics.Windows.Reporting
...
report1.ReportSettings.RepeatType = RepeatType.PageBreak
...

In C#:

using Infragistics.Windows.Reporting;
...
report1.ReportSettings.RepeatType = RepeatType.PageBreak;
...