Back to Devexpress

BrickSelector Class

corelibraries-devexpress-dot-xtraprinting-3f21b830.md

latest4.0 KB
Original Source

BrickSelector Class

Selects bricks from a document or document page(s).

Namespace : DevExpress.XtraPrinting

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

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public static class BrickSelector
vb
Public Module BrickSelector

Remarks

Use the static methods stored in this class to select bricks from a document or its page(s).

OperationMethods
Select all bricksThe GetBricks overloaded methods
Select bricks that contain a specific tagThe GetBricksByTag overloaded methods
Select bricks that contain specific textThe GetBricksByText overloaded methods
Select bricks that were created by a specific controlThe GetBricksByXRControl overloaded methods

Example

The following code selects bricks in a report document:

csharp
using DevExpress.XtraReports.UI;
using DevExpress.XtraPrinting;
// ...
// Create a simple report.
XtraReport report = new XtraReport();
DetailBand detailBand = new DetailBand();
report.Bands.Add(detailBand);
// Add two label controls and a character comb control to the report.
XRLabel label1 = new XRLabel() { Text = "First Label", Tag = "select"};
XRLabel label2 = new XRLabel() { Text = "Second Label"};
XRCharacterComb characterComb = new XRCharacterComb() { Text = "Character Comb", Tag = "select" };
detailBand.Controls.AddRange(new XRControl[] { label1, label2, characterComb });
// Get all bricks in a document.
var bricks = BrickSelector.GetBricks(report.PrintingSystem.Document); 
// Get bricks with the "select" tag from the document's first page.
var bricks = BrickSelector.GetBricksByTag(report.PrintingSystem.Document.Pages[0], "select"); 
// Get brick(s) created by a specific control.
var bricks = BrickSelector.GetBricksByXRControl(report.PrintingSystem.Document, label1);
vb
Imports DevExpress.XtraReports.UI
Imports DevExpress.XtraPrinting
' ...
' Create a simple report.
Private report As New XtraReport()
Private detailBand As New DetailBand()
report.Bands.Add(detailBand)
' Add two label controls and a character comb control to the report.
Dim label1 As New XRLabel() With {.Text = "First Label", .Tag = "select"}
Dim label2 As New XRLabel() With {.Text = "Second Label"}
Dim characterComb As New XRCharacterComb() With {.Text = "Character Comb", .Tag = "select"}
detailBand.Controls.AddRange(New XRControl() { label1, label2, characterComb })
' Get all bricks in a document.
Dim bricks = BrickSelector.GetBricks(report.PrintingSystem.Document)
' Get bricks with the "select" tag from the document's first page.
Dim bricks = BrickSelector.GetBricksByTag(report.PrintingSystem.Document.Pages(0), "select")
' Get brick(s) created by a specific control.
Dim bricks = BrickSelector.GetBricksByXRControl(report.PrintingSystem.Document, label1)

Inheritance

Object BrickSelector

See Also

BrickSelector Members

Brick

Document

Document Page

DevExpress.XtraPrinting Namespace