Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [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]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Collapse]Printing-Exporting
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamental Concepts
   [Expand]Concepts
   [Collapse]Examples
    [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]Exporting
    [Expand]Miscellaneous
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap 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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Use Bricks of Different Types

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T335238.

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.

angelfish.png logo.png

The following image shows the resulting report.

Expanded See Also

How would you rate this topic?​​​​​​​