windowsforms-devexpress-dot-xtragantt-dot-options-dot-ganttcontroloptionsprint-604c6746.md
Gets or sets the type of information displayed in the page footer.
Namespace : DevExpress.XtraGantt.Options
Assembly : DevExpress.XtraGantt.v25.2.dll
NuGet Package : DevExpress.Win.Gantt
[DefaultValue(PageInfo.NumberOfTotal)]
[XtraSerializableProperty]
public PageInfo PageInfoType { get; set; }
<DefaultValue(PageInfo.NumberOfTotal)>
<XtraSerializableProperty>
Public Property PageInfoType As PageInfo
| Type | Default | Description |
|---|---|---|
| PageInfo | NumberOfTotal |
A value that specifies the type of information.
|
Available values:
| Name | Description |
|---|---|
| None |
Indicates that the PageInfoTextBrick.Format property value is displayed in the current PageInfoTextBrick.
| | Number |
Indicates that the current page number is displayed in the PageInfoBrick.
| | NumberOfTotal |
Indicates that both the current page number and the total number of pages in the current report are displayed in the current PageInfoBrick.
| | RomLowNumber |
Indicates that the current page number is displayed in the PageInfoBrick using roman numerals in lowercase.
| | RomHiNumber |
Indicates that the current page number is displayed in the PageInfoBrick using roman numerals in uppercase.
| | DateTime |
Indicates that the current date and time are displayed in the PageInfoBrick.
| | UserName |
Indicates that the user name for the current thread is displayed in the PageInfoBrick.
| | Total |
Indicates that the total number of pages is displayed in the PageInfoBrick.
|
You can access this nested property as listed below:
| Object Type | Path to PageInfoType |
|---|---|
| GanttControl |
.OptionsPrint .PageInfoType
|
You can print the chart legend and additional information in page footers.
Enable the PrintLegend property to display a chart legend in page footers.
The AppearancePrint property provides access to appearance settings used to print the control. You can use the following properties to specify how to print the legend:
Ensure that the UsePrintStyles property is set to true (the default value) to enable these settings.
Enable the PrintPageInfo property to display additional information in page footers. The default footer contains the current date, page number, and the total number of pages.
Use the PageInfoType property to specify the type of information that should be displayed. The PageInfoFormat property allows you to apply a custom format to this information. Use the {0} and {1} placeholders to insert a specific portion of information into the format. The passed content depends on the type of information. For example, if PageInfoType is set to NumberOfTotal, {0} is replaced with the page number, and {1} is replaced with the total number of pages.
You can also use the PageInfoCaption property to display a custom caption in the page footers.
The AppearancePrint property provides access to the PageInfo and PageInfoCaption properties that specify appearance settings used to print page information.
The code below shows how to display the chart legend and page information.
using System.Drawing;
using DevExpress.XtraPrinting;
// Print the chart legend.
ganttControl1.OptionsPrint.PrintLegend = DefaultBoolean.True;
// Specify custom foreground and background colors for the chart legend.
ganttControl1.AppearancePrint.Legend.BackColor = Color.FromArgb(224, 224, 224);
ganttControl1.AppearancePrint.Legend.Options.UseBackColor = true;
ganttControl1.AppearancePrint.LegendItem.ForeColor = Color.FromArgb(64, 0, 64);
ganttControl1.AppearancePrint.LegendItem.Options.UseForeColor = true;
// Print the Project's caption and Project Manager's name in the footer.
ganttControl1.OptionsPrint.PrintPageInfo = DefaultBoolean.True;
ganttControl1.OptionsPrint.PageInfoType = XtraPrinting.PageInfo.UserName;
ganttControl1.OptionsPrint.PageInfoFormat = "Project Manager: {0}";
ganttControl1.OptionsPrint.PageCaption = "Software Development";
// Specify the footer background color.
ganttControl1.AppearancePrint.PageInfo.BackColor = Color.FromArgb(255, 192, 128);
ganttControl1.AppearancePrint.PageInfo.Options.UseBackColor = true;
Imports System.Drawing
Imports DevExpress.XtraPrinting
' Print the chart legend.
ganttControl1.OptionsPrint.PrintLegend = DefaultBoolean.True
' Specify custom foreground and background colors for the chart legend.
ganttControl1.AppearancePrint.Legend.BackColor = Color.FromArgb(224, 224, 224)
ganttControl1.AppearancePrint.Legend.Options.UseBackColor = True
ganttControl1.AppearancePrint.LegendItem.ForeColor = Color.FromArgb(64, 0, 64)
ganttControl1.AppearancePrint.LegendItem.Options.UseForeColor = True
' Print the Project's caption and Project Manager's name in the footer.
ganttControl1.OptionsPrint.PrintPageInfo = DefaultBoolean.True
ganttControl1.OptionsPrint.PageInfoType = XtraPrinting.PageInfo.UserName
ganttControl1.OptionsPrint.PageInfoFormat = "Project Manager: {0}"
ganttControl1.OptionsPrint.PageCaption = "Software Development"
' Specify the footer background color.
ganttControl1.AppearancePrint.PageInfo.BackColor = Color.FromArgb(255, 192, 128)
ganttControl1.AppearancePrint.PageInfo.Options.UseBackColor = True
See Also
Print and Export Gantt Control
GanttControlOptionsPrint Class