XRCharacterComb Class

A Character Comb control that displays text so that each character is printed in an individual cell.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.1.dll

Syntax

[DefaultBindableProperty("Text")]
[XRToolboxSubcategory(0, 8)]
public class XRCharacterComb :
    XRLabel,
    IXRSerializable,
    IEnumerable,
    IBrickOwner,
    IScriptable,
    IXtraSupportDeserializeCollectionItem,
    IXtraSerializable,
    IDisplayNamePropertyContainer,
    IEditOptionsContainer

The XRCharacterComb control displays text so that each character is printed in an individual cell.

cellular-label-report-control

To add this control to the report, drag the XRCharacterComb item from the DX:18.1: Report Controls Toolbox tab and drop it onto the report.

drop-control-cellular-label-toolbox

When exporting this control to third-party formats, consider the following

  • When a report is exported to an XLS or XLSX file, the cells of the Character Comb correspond to the cells of a resulting Excel sheet.
  • When a report is exported to a CSV (or TXT) file, the content of individual cells is separated (or spaced) by a specified TextExportOptionsBase.Separator character.

In most aspects, the Character Comb is similar to the XRLabel control from which it inherits most of its properties and its basic behavior. For general information about binding these controls to data and display summary function results, see the following topic: Label. To learn about Character Comb specifics, see Character Comb.

Examples

This example illustrates how to create a Character Comb and specify its main options in code.

using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
// ...

public XRCharacterComb CreateCharacterComb() {
    // Create a Character Comb instance.
    XRCharacterComb characterComb = new XRCharacterComb();

    // Make every cell have borders on each side.
    characterComb.Borders = BorderSide.All;

    // Specify the spacing between cells (measured in report units).        
    characterComb.CellHorizontalSpacing = 2;
    characterComb.CellVerticalSpacing = 2;

    // Make the cell height depend on the current font size, 
    // and the cell width having a fixed value (measured in report units).
    characterComb.CellSizeMode = SizeMode.AutoHeight;
    characterComb.CellWidth = 25;

    // Adjust the control's dimensions to its content.
    characterComb.AutoWidth = true;
    characterComb.CanShrink = true;

    // Set its Multiline property to true.
    characterComb.Multiline = true;

    // Set its static text. This property is bindable, 
    // meaning that this text can be supplied from a data source.
    characterComb.Text = "Line1\r\nLine2";

    return characterComb;
}

Inheritance

Implements

DevExpress.Utils.Serializing.Helpers.IXtraSupportDeserializeCollectionItem
DevExpress.Utils.Serializing.IXtraSerializable

Inherited Members

See Also