Skip to main content

BrickGraphics.DrawPageInfo(PageInfo, String, Color, RectangleF, BorderSide) Method

Adds a specific PageInfoBrick to a report.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.Printing.v22.2.Core.dll

NuGet Packages: DevExpress.Printing.Core, DevExpress.Win.Dashboard.Design


public PageInfoBrick DrawPageInfo(
    PageInfo pageInfo,
    string format,
    Color foreColor,
    RectangleF rect,
    BorderSide sides


Name Type Description
pageInfo PageInfo

The type of infomation, displayed in the PageInfoBrick.

format String

The text to display in the PageInfoBrick.

foreColor Color

The text color for the added PageInfoBrick.

rect RectangleF

The RectangleF structure that specifies the location and size of the current brick in measurement units, specified via the BrickGraphics.PageUnit property value.

sides BorderSide

Border settings for the PageInfoBrick.


Type Description

The PageInfoBrick added to a report.


PageInfoBrick can be created in the page header and page footer areas. The information displayed within the PageInfoBrick depends upon the pageInfo and format parameter values. If the pageInfo parameter value is PageInfo.RomHiNumber or PageInfo.RomLowNumber, the format parameter value is simply ignored and page numbers are displayed using upper or lowercase roman numerals. If the pageInfo parameter value is PageInfo.None, the PageInfoBrick displays a string defined via the format parameter. If the pageInfo parameter value is PageInfo.DateTime, PageInfo.Number or PageInfo.NumberOfTotal, the format parameter value is assumed to be a format string for the information displayed in the PageInfoBrick. For additional information on formatting different value types see the “IFormatProvider Interface” topic in MSDN documentation.


This example demonstrates how to create a PageInfoBrick, used to display information. The first PageInfoBrick displays the current date and time using the FullDateTimePattern. The second brick displays the current page number and the total number of pages in the report.

using DevExpress.XtraPrinting;
// ...

    PageInfoBrick pinfoBrick;
    BrickGraphics brickGraph = printingSystem1.Graph;

    // Start the report generation.

    // Create a rectangle
    RectangleF rect = new RectangleF(new PointF(0, 0), new SizeF(250, 20));

    // Specify the page header.
    brickGraph.Modifier = BrickModifier.MarginalHeader;

    // Create page info brick to display the current time in full format.
    pinfoBrick = brickGraph.DrawPageInfo(PageInfo.DateTime, "{0:F}" , Color.Black, rect, 

    // Specify the page footer.
    brickGraph.Modifier = BrickModifier.MarginalFooter;

    // Create page info brick to display page number.
    pinfoBrick = brickGraph.DrawPageInfo(PageInfo.NumberOfTotal, "Page {0} of {1}", 
         Color.Black, rect, BorderSide.None);

    // Finish the report generation.

    // Preview the report.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DrawPageInfo(PageInfo, String, Color, RectangleF, BorderSide) method.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also