ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

PrintInfo.PageHeader Property

Gets or sets the string to be printed at the top of each page.

[Visual Basic]

Public Property PageHeader As String

[C#]

public string PageHeader {get;set;}

[Delphi]

public property PageHeader: String read get_PageHeader write set_PageHeader;

Remarks

By default, this property returns an empty string, and no page header is printed.

If specified, the page header can consist of up to three substrings separated by the \t character sequence. The first substring will be left-aligned, the second centered, and the third right-aligned on the printed page. The \p sequence will be replaced by the current page number during printing.

In addition, the following characters provide even greater control over the appearance of the PageHeader property when the grid is so large that columns span more than one printed page.

\p

Current page number. 1-based, and incremented by subpages (that is, the group of pages that hold all of the columns for a set of records).

\P

Total number of pages; each sub-page is counted separately.

\g

Current subpage group number. 1-based.

\G

Total number of subpage groups.

\s

Current subpage number. 1-based.

\S

Total number of subpages.

Example

The following code sets the PageHeader property of the default PrintInfo object so that the current date is on the left, and the page number is on the right, preceded by the word "Page":

·      Visual Basic

       Me.C1TrueDBGrid1.PrintInfo.PageHeader = CStr(Now) + Chr(Keys.Tab) + Chr(Keys.Tab) "Page\p"

·      C#

       this.c1TrueDBGrid1.PrintInfo.PageHeader = DateTime.Now.ToString() + "\t\tPage\p";

·      Delphi

       Self.C1TrueDBGrid1.PrintInfo.PageHeader := DateTime.Now.ToString() + '\t\tPage\p';

For a more detailed header that displays the number of groups is on the left, the sub-page number in the center, and the total number of pages is on the right (preceded by the word "Page"), use the following code:

·      Visual Basic

       Me.C1TrueDBGrid1.PrintInfo.PageHeader = Chr(Keys.Tab) + "Page:\g of group \G, \s of subpage \S, \p of page \P"

·      C#

       this.c1TrueDBGrid1.PrintInfo.PageHeader = "\tPage:\g of group \G, \s of subpage \S, \p of page \P";

·      Delphi

       Self.C1TrueDBGrid1.PrintInfo.PageHeader := '\tPage:\g of group \G, \s of subpage \S, \p of page \P';

See Also

PrintInfo Class | PrintInfo Members | C1.Win.C1TrueDBGrid Namespace


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.