Reporting - XRCheckBox SVG, XRLabel HTML (v19.1)

Reporting Team Blog
08 May 2019

XRCheckBox – SVG Glyphs

Sometimes the built-in style of the XRCheckBox report control does not fit the design requirements of a printable document. It may be necessary to show custom images based on a boolean field value, rather than regular check marks. Of course it is possible to swap images dynamically using a small XRPictureBox, but the XRCheckBox offers a more direct approach that doesn’t require custom logic.

With v19.1 the XRCheckBox supports flexible SVG glyphs. There are several nested options available in the new property XRCheckBox.GlyphOptions:

  • You can choose from several built-in checkbox styles using the Style property:

Checkbox Styles

Note that we didn’t change the default glyph used by the XRCheckBox. If you don’t select any of the new styles, the control still uses a bitmap, so all your reports look the same as before your v19.1 update.

  • The Size property scales the selected check mark image, and it even affects the default bitmap glyph:

Checkbox Size

  • The most interesting new property is called CustomGlyphs and it allows you to upload custom images for each check state. Here’s an example using checkbox images from Material Design:

Custom Glyphs

Note that you can define specific sizes for your custom glyphs and our tools scale them automatically. Be careful when using small bitmap images, they will end up fuzzy if you show them at large sizes.

  • Finally, the Alignment property replaces the old XRCheckBox.TextAlignment setting. It automatically uses the value of the old property if you set it previously, so this is not a breaking change.

As a side note, thanks to customer feedback we changed the drag&drop behavior: when you drop a boolean field on the report surface, the XRCheckBox.Text property value is now automatically set to the name of the data-bound field.

XRLabel – HTML-Inspired Formatting

The XRLabel component now exposes the new property AllowMarkupText. When this is active, you can use the set of pseudo-HTML tags currently supported by our WinForms controls to display formatted content in the label.

Note that we don’t have full HTML support, and many tags are only superficially similar to HTML. Please read the documentation page in case you’re not yet aware of this functionality that is shared with several controls of our WinForms suite.

In the XtraReport class you can find a property called ImageResources. This is a list of images with assigned ids, which can be referred to in the markup for a label. Here’s the editor for this property:

ImageResources Editor

As an example, you can use markup like this:

  Size = 14<br>
  Size = 11<br>
  <color=255, 0, 0>Sample Text</color>

And here’s how it renders in Report Designer:

Pseudo-HTML Markup in XRLabel

The image placeholder icon is displayed if you specify an invalid image id:

Image Placeholder for Invalid Image ID

Images from the ImageResources list can also be used in an XRPictureBox expression binding. The node Images becomes available in the Expression Editor for this purpose:

Image Resources Expression Binding

The support for pseudo-HTML formatting can be particularly useful for ASP.NET Core developers, since the platform does not yet support a full rich text report control. Of course we don’t consider this formatting feature a complete replacement for rich text functionality, but at the same time the XRLabel-based approach is light-weight and doesn’t consume much memory.

Your Feedback Counts

As always, we’d like to hear your thoughts. Please feel free to leave comments below, and we appreciate it very much if you can submit your responses to this short survey:


Please use the link below to register for our upcoming webinar on Dashboards, Reporting and Data Analytics, where all new features the the v19.1 release are demonstrated.

Register for the Dashboards, Reporting & Data Analytics v19.1 Webinar

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.