corelibraries-devexpress-dot-xtraprinting-3f21b830.md
Selects bricks from a document or document page(s).
Namespace : DevExpress.XtraPrinting
Assembly : DevExpress.Printing.v25.2.Core.dll
NuGet Package : DevExpress.Printing.Core
public static class BrickSelector
Public Module BrickSelector
Use the static methods stored in this class to select bricks from a document or its page(s).
| Operation | Methods |
|---|---|
| Select all bricks | The GetBricks overloaded methods |
| Select bricks that contain a specific tag | The GetBricksByTag overloaded methods |
| Select bricks that contain specific text | The GetBricksByText overloaded methods |
| Select bricks that were created by a specific control | The GetBricksByXRControl overloaded methods |
The following code selects bricks in a report document:
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);
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)
Object BrickSelector
See Also