Back to Devexpress

BrickStringFormat Class

corelibraries-devexpress-dot-xtraprinting-841ef4a8.md

latest7.4 KB
Original Source

BrickStringFormat Class

Encapsulates text layout information (such as alignment, orientation and tab stops) and display manipulations (such as ellipsis insertion and national digit substitution).

Namespace : DevExpress.XtraPrinting

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

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public class BrickStringFormat :
    ICloneable
vb
Public Class BrickStringFormat
    Implements ICloneable

The following members return BrickStringFormat objects:

Show 19 links

LibraryRelated API Members
Cross-Platform Class LibraryBrickGraphics.StringFormat
BrickStringFormat.ChangeAlignment(DXStringAlignment, DXStringAlignment)
BrickStringFormat.ChangeAlignment(DXStringAlignment)
BrickStringFormat.ChangeAlignment(HorzAlignment, VertAlignment)
BrickStringFormat.ChangeAlignment(StringAlignment, StringAlignment)
BrickStringFormat.ChangeAlignment(StringAlignment)
BrickStringFormat.ChangeAlignment(TextAlignment)
BrickStringFormat.ChangeFormatFlags(DXStringFormatFlags)
BrickStringFormat.ChangeFormatFlags(StringFormatFlags)
BrickStringFormat.ChangeLineAlignment(DXStringAlignment)
BrickStringFormat.ChangeLineAlignment(StringAlignment)
BrickStringFormat.Create(TextAlignment, Boolean, DXStringTrimming, Boolean)
BrickStringFormat.Create(TextAlignment, Boolean, StringTrimming, Boolean)
BrickStringFormat.Create(TextAlignment, Boolean)
BrickStringFormat.Create(TextAlignment, DXStringFormatFlags, DXStringTrimming)
BrickStringFormat.Create(TextAlignment, StringFormatFlags, StringTrimming)
BrickStyle.StringFormat
TextBrick.StringFormat
.NET Reporting ToolsXRControlStyle.StringFormat

Remarks

The BrickStringFormat class defines formatting for bricks containing text information. Format settings include text, line alignment, and formatting flags.

Example

The following code demonstrates use of the BrickStringFormat. It creates a new BrickStringFormat object, sets the text alignment to Center , and text direction to DirectionVertical.

csharp
using DevExpress.XtraPrinting;
// ...

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

    // Specify the string format.
    StringFormat sFormat = new StringFormat(StringFormatFlags.DirectionVertical);
    sFormat.Alignment = StringAlignment.Center;
    sFormat.LineAlignment = StringAlignment.Center;

    // Create the BrickStringFormat object.
    BrickStringFormat brickSFormat = new BrickStringFormat(sFormat);

    // Measure the string according to the specified format
    SizeF sz = brickGraph.MeasureString(s, 30, sFormat);

    // Start the report generation.
    printingSystem1.Begin();

    // Set the brick string format
    brickGraph.StringFormat = brickSFormat;

    // Create a rectangle.
    RectangleF rect = new RectangleF(new PointF(0, 0), new SizeF(30, 150));
    // Specify a page area.
    brickGraph.Modifier = BrickModifier.Detail;
    // Add a brick to the report.
    visBrick = brickGraph.DrawString(s, Color.MidnightBlue, rect, BorderSide.All);

    // Finish the report generation.
    printingSystem1.End();

    // Preview the report.
    printingSystem1.PreviewFormEx.Show();
vb
Imports DevExpress.XtraPrinting
' ...

    Dim visBrick As VisualBrick
    Dim brickGraph As BrickGraphics = printingSystem1.Graph
    Dim s As String = "Developer Express Inc."

    ' Specify the string format.
    Dim sFormat As StringFormat = New StringFormat(StringFormatFlags.DirectionVertical)
    sFormat.Alignment = StringAlignment.Center
    sFormat.LineAlignment = StringAlignment.Center

    ' Create the BrickStringFormat object.
    Dim brickSFormat As BrickStringFormat = New BrickStringFormat(sFormat)

    ' Measure the string according to the specified format
    Dim sz As SizeF = brickGraph.MeasureString(s, 30, sFormat)

    ' Start the report generation.
    printingSystem1.Begin()

    ' Set the brick string format
    brickGraph.StringFormat = brickSFormat

    ' Create a rectangle.
    Dim rect As RectangleF = New RectangleF(New PointF(0, 0), New SizeF(30, 150))
    ' Specify a page area.
    brickGraph.Modifier = BrickModifier.Detail
    ' Add a brick to the report.
    visBrick = brickGraph.DrawString(s, Color.MidnightBlue, rect, BorderSide.All)

    ' Finish the report generation.
    printingSystem1.End()

    ' Preview the report.
    printingSystem1.PreviewFormEx.Show()

Inheritance

Object BrickStringFormat

See Also

BrickStringFormat Members

DevExpress.XtraPrinting Namespace