A newer version of this page is available. Switch to the current version.

BrickGraphics.DrawString(String, RectangleF) Method

Adds a specific TextBrick to a report.

Namespace: DevExpress.XtraPrinting

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


public TextBrick DrawString(
    string text,
    RectangleF rect
Public Function DrawString(
    text As String,
    rect As RectangleF
) As TextBrick


Name Type Description
text String

The text displayed in a specific TextBrick.

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.


Type Description

The TextBrick added to a report.


This method adds a specific TextBrick to a report. TextBrick position and size are specified via the rect parameter. Graphical settings which are not defined via this method are obtained from the corresponding BrickGraphics properties.


This example demonstrates how to create a TextBrick using the BrickGraphics.DrawString method.


using DevExpress.XtraPrinting;
// ...

    VisualBrick visBrick;
    BrickGraphics brickGraph = printingSystem1.Graph;
    string s = "Developer Express Inc.";

    // Measure the string.
    SizeF sz = brickGraph.MeasureString(s);

    // Start the report generation.

    // Create a rectangle of the calculated size.
    RectangleF rect = new RectangleF(new PointF(0, 0), sz);
    // Specify a page area.
    brickGraph.Modifier = BrickModifier.Detail;
    // Create a text brick.
    visBrick = brickGraph.DrawString(s, Color.Black, rect, BorderSide.All);

    // Finish the report generation.

    // Preview the report.
See Also