Skip to main content

TextBrick Class

A visual brick that contains text.

Namespace: DevExpress.XtraPrinting

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

Declaration

[BrickExporter(typeof(TextBrickExporter))]
public class TextBrick :
    TextBrickBase,
    ITextBrick,
    IVisualBrick,
    IBaseBrick,
    IBrick,
    ITableCell

Remarks

TextBrick is used to type plain text in a document and provides options that define the text color, alignment, font and format settings.

TextBrick

To print rotated text in your document, use the LabelBrick class.

To insert rich text into your document, use the RichTextBrick class.

Example

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

MeasureString1

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.
    printingSystem1.Begin();

    // 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.
    printingSystem1.End();

    // Preview the report.
    printingSystem1.PreviewFormEx.Show();

The following code snippets (auto-collected from DevExpress Examples) contain references to the TextBrick class.

Note

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.

Inheritance

Show 11 items
See Also