[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamental Concepts
    [Expand]Print Preview
    [Collapse]Using Bricks
      How to: Use Bricks of Different Types
      How to: Use Modifiers of BrickGraphics
      How to: Draw a Line Brick
      How to: Modify Brick Appearance using Styles
      How to: Unite Bricks into a Non-Separable Group
      How to: Insert a Page Break between Two Bricks
      How to: Create a Non-Printable Brick
      How to: Create a Custom Brick Inherited from a Standard Brick
      How to: Create a Custom Brick Implementing the IBrick Interface
    [Expand]Using Printing Links
    [Expand]Page Header and Footer
    [Expand]Printing DevExpress Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Use Bricks of Different Types

The following example demonstrates how to use bricks of different types to display different kinds of information in a report.

First, drop a simple button onto a form and handle its Click event. In the event handler, create a new PrintingSystem class instance. Then, create a new Link object and add it to the PrintingSystem.Links collection. Subscribe to the LinkBase.CreateDetailArea and LinkBase.CreateMarginalHeaderArea events to customize a document's detail and marginal header sections, respectively. Finally, create a document and show it in the print preview by calling the Link.ShowPreview method.

In the CreateDetailArea event handler, use the ImageBrick object to display the picture of a fish and the TextBrick object to show text containing species characteristics and its description. The code also adds a CheckBoxBrick to the document and uses a simple Brick to draw borders around specific bricks.

The CreateMarginalHeaderArea event handler uses the PageImageBrick and PageInfoBrick objects to show additional information in the page header. The PageImageBrick displays the DevExpress logo at the top of every page, while two PageInfo bricks display either the current date and time or the page number, depending on the PageInfoTextBrick.PageInfo property value.

For this example, add the "angelfish.png" and "logo.png" image files to the project. You can get the necessary files from the table below.



The following image shows the resulting report.

Expanded See Also

Is this topic helpful?​​​​​​​