Skip to main content
A newer version of this page is available. .
All docs
V22.1

XRCrossTabCell.AllowMarkupText Property

Gets or sets whether you can use HTML-style markup tags to format the cell text.

Namespace: DevExpress.XtraReports.UI.CrossTab

Assembly: DevExpress.XtraReports.v22.1.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[DefaultValue(false)]
[SRCategory(ReportStringId.CatBehavior)]
public virtual bool AllowMarkupText { get; set; }

Property Value

Type Default Description
Boolean false

true if the control allows markup text; otherwise, false.

Remarks

If a cell’s AllowMarkupText property is set to true, you can use markup tags to format the cell’s Text and Format String properties.

HTML-like markup in a cell's format string

Supported Tags

The XRCrossTabCell supports the following tags:

Tag

End Tag

Supported in XLS / XLSX Export

Description

<p>

</p>

Inserts line breaks.

<br>

-

Icon-yes

Inserts a single line break.

<nbsp>

-

Icon-yes

Inserts a space.

<color=value>
Examples:
<color=red>
<color=0,255,0>
<color=255,0,255,0>
<color=#0000FF>

</color>

Icon-yes

Specifies the text color.

<backcolor=value>
Examples:
<backcolor=red>
<backcolor=0,255,0>
<backcolor=255,0,255,0>
<backcolor=#0000FF>

</backcolor>

Specifies the background color.

<size=value>
Examples:
<size=10>
<size=+4>
<size=-4>

</size>

Icon-yes

Specifies the font size.

<b>

</b>

Icon-yes

Defines bold text.

<i>

</i>

Icon-yes

Defines italic text.

<r>

</r>

Defines regular text. This resets any bold, italic, underlined and strikethrough formats specified with tags or applied in the control’s appearance settings.

<s>

</s>

Icon-yes

Defines strikethrough text.

<u>

</u>

Icon-yes

Defines underlined text.

<sub>
Example:
Double subscript: 2<sub>2<sub>2</sub></sub>

</sub>

Defines that the text is smaller and displayed lower than the previous character.

<sup>
Example:
Double superscript: 2<sup>2<sup>2</sup></sup>

</sup>

Defines that the text is smaller and displayed higher than the previous character.

<font>
Example:
<font=’Times New Roman’ size=15 color=red>Times New Roman</font>

</font>

Icon-yes

Specifies the font family. You can combine it with the color and size settings within a single tag.

<image=value>
Examples:
<image=UpArrow.png>
<image=DownArrow.png;size=20,20>

-

Inserts an image from the report’s named image collection. Supports both raster images and SVG images.
Use the report’s ImageResources property to provide images and reference them by their Id.

The image tag’s size attribute sets the image display pixel size. If the specified width/height exceeds the label’s width/height, it is reduced to display the entire image.

Specify the size attribute after the tag’s value followed by the “;” character.

<href=value>
Example:
<href=www.devexpress.com>Our web site</href>

</href>

Displays a hyperlink. The value string specifies the hyperlink source, and the string between the opening and closing tags is the text to display.

Note that hyperlinks are not clickable in the documents exported to the E-Mail / HTML format, because the label’s markup text is exported as an image. Use the XRRichText control to create an E-Mail / HTML document with clickable hyperlinks.

Limitations

If the AllowMarkupText property is set to True, the following limitations apply:

Example

The following code demonstrates how to enable HTML-like markup in a cross-tab column named “rowTotal”:

using DevExpress.XtraReports.UI;
// ...
XRCrossTabCell cell = crossTab.Cells["rowTotal"] as XRCrossTabCell;
cell.AllowMarkupText = true;
cell.TextFormatString = "<b>Row Total:</b> {0}";
See Also