Skip to main content
All docs
V26.1
  • XRControl.AccessibleRole Property

    Specifies the control’s accessible role in the exported PDF document. This value is used by assistive technologies.

    Namespace: DevExpress.XtraReports.UI

    Assembly: DevExpress.XtraReports.v26.1.dll

    Declaration

    [DefaultValue(XRAccessibleRole.Default)]
    [SRCategory(ReportStringId.CatData)]
    public virtual XRAccessibleRole AccessibleRole { get; set; }

    Property Value

    Type Default Description
    XRAccessibleRole Default

    The value that defines the control’s role.

    Remarks

    Use this table to map report controls to accessibility structure roles in exported PDF files.

    The table describes the following:

    • How each control behaves when the AccessibleRole property is set to Default.
    • Roles you can assign to ensure that screen readers correctly identify the element’s purpose in the exported PDF document.
    • Properties that specify these roles.

    Tip

    Decorative role means an element is treated as an artifact (outside the tag tree). Use this role only for non-informative visual elements. The AccessibleDescription property is not in effect for artifacts.

    Element(s) Default behavior when AccessibleRole = Default Role you can specify How to set the role (API)
    XRLabel Treated as a paragraph (P). Heading XRControl.AccessibleRole
    XRTable No semantic role; treated as a Div. Table XRControl.AccessibleRole
    XRTableRow No semantic role; treated as a Div. Table Header Row XRControl.AccessibleRole
    XRTableCell Treated as a paragraph (P). Header Cell XRControl.AccessibleRole
    XRWatermark (an image watermark) Treated as an artifact; excluded from the PDF logical structure. Figure XRWatermark.ImageAccessibleRole
    XRWatermark (a text watermark) Treated as an artifact; excluded from the PDF logical structure. Paragraph XRWatermark.TextAccessibleRole
    XRPictureBox, XRShape, XRBarCode, XRZipCode Treated as a Figure. Decorative (Artifact) XRControl.AccessibleRole
    XRPageInfo Treated as an artifact; excluded from the PDF logical structure. Paragraph XRControl.AccessibleRole
    XRPanel No semantic role; treated as a Div. Decorative (Artifact) XRControl.AccessibleRole

    XRBarCode

    Use the AccessibleRole property to specify how screen readers treat the XRBarCode control in exported PDF documents. You can change the value to Decorative or keep the default value of Figure.

    Property Grid XRBarCode AccessibleRole set

    Before you export your report, set the PdfExportOptions.PdfUACompatibility property to PdfUA1 or PdfUA2 to ensure the document is PDF/UA compatible.

    The image below shows the result. AccessibleRole is set to Decorative, and the screen reader treats XRBarCode as an artifact in the exported document:

    XRBarCode exported as artifact

    XRLabel

    Set the control’s AccessibleRole property to Heading1 - Heading6 before you export a report.

    XRLabel heading role in grid

    Set the PdfExportOptions.PdfUACompatibility property to PdfUA1 or PdfUA2 to conform the exported PDF document to PDF/UA specifications. Then, export the report to a PDF format.

    The image below shows the result. AccessibleRole is set to Heading2, and the screen reader treats XRLabel as a “level two” heading in the exported document:

    XRLabel announced as heading 2

    XRTableCell

    Before you export a report, set the XRTable‘s AccessibleRole property to Table to define a control as a table. Then, specify the AccessibleRole property:

    XRTableCell set to header cell

    Note

    AccessibleRole is not in effect for cells merged with the XRTableCell.RowSpan property.

    Set the PdfExportOptions.PdfUACompatibility property to PdfUA1 or PdfUA2 to conform the exported PDF document to PDF/UA specifications. Then, export the report as a PDF.

    The image below shows the result. AccessibleRole is set to TableHeaderCell, and the screen reader treats XRTableCell with “Bill to:” text as a header cell in the exported document:

    Bill to announced header cell

    XRPageInfo

    Use the AccessibleRole property to specify how screen readers interpret XRPageInfo in exported PDF documents. You can change the value to Paragraph or keep the default Artifact value.

    If XRPageInfo conveys meaning and you want to include it to PDF document logical structure, set AccessibleRole to Paragraph when you create or edit XRPageInfo:

    XRPageInfo set to paragraph

    Before you export your report, set the PdfExportOptions.PdfUACompatibility property to PdfUA1 or PdfUA2 to make the document PDF/UA compatible.

    The image below shows the result. AccessibleRole is set to Paragraph, and the screen reader treats XRPageInfo as a paragraph in the exported document:

    XRPageInfo included as paragraph

    Use the AccessibleDescription property to specify the description of the resulting element:

    XRPageInfo AccessibleDescription in grid

    XRPictureBox

    Use the AccessibleRole property to specify how screen readers treat the XRPictureBox control in exported PDF documents. You can change the value to Decorative or keep the default value of Figure.

    XRPictureBox AccessibleRole in grid

    Before you export your report, set the PdfExportOptions.PdfUACompatibility property to PdfUA1 or PdfUA2 to ensure that the document is PDF/UA compatible.

    The image below shows the result. AccessibleRole is set to Decorative, and the screen reader treats XRPictureBox as an artifact in the exported document:

    XRPictureBox exported as artifact

    XRShape

    Use the AccessibleRole property to specify how screen readers treat the XRShape control in exported PDF documents. You can change the value to Decorative or keep the default value of Figure.

    XRShape AccessibleRole in grid

    Before you export your report, set the PdfExportOptions.PdfUACompatibility property to PdfUA1 or PdfUA2 to ensure the document is PDF/UA compatible.

    The image below shows the result. AccessibleRole is set to Decorative, and the screen reader treats XRShape as an artifact in the exported document:

    XRShape exported as artifact

    XRTable

    You can specify how XRTable should be treated by screen readers in the exported PDF document. For this, set the control’s AccessibleRole property to Table before you export a report.

    XRTable set to table role

    Set the PdfExportOptions.PdfUACompatibility property to PdfUA1 or PdfUA2 to conform the exported PDF document to PDF/UA specifications. Then, export the report as a PDF.

    The image below shows the result. AccessibleRole is set to Table, and the screen reader treats XRTable as a table in the exported document:

    XRTable announced as table

    You can also use AccessibleRole to specify header cells and rows in the table.

    XRTableRow

    You can specify how XRTableRow should be treated by screen readers in the exported PDF document.

    Before you export a report, set the XRTable‘s AccessibleRole property to Table to define a control as a table. Then, specify AccessibleRole:

    XRTableRow set to header row

    Set the PdfExportOptions.PdfUACompatibility property to PdfUA1 or PdfUA2 to conform the exported PDF document to PDF/UA specifications. Then, export the report as a PDF.

    The image below shows the result. AccessibleRole is set to TableHeaderRow, and the screen reader treats XRTableRow as a header row of the table in the exported document:

    XRTableRow announced as header row

    XRZipCode

    Use the AccessibleRole property to specify how screen readers treat the XRZipCode control in exported PDF documents. You can change the value to Decorative or keep the default value of Figure.

    XRZipCode AccessibleRole in grid

    Before you export your report, set the PdfExportOptions.PdfUACompatibility property to PdfUA1 or PdfUA2 to ensure the document is PDF/UA compatible.

    The image below shows the result. AccessibleRole is set to Decorative, and the screen reader treats XRZipCode as an artifact in the exported document:

    XRZipCode exported as artifact

    XRPanel

    Use the AccessibleRole property to specify how screen readers treat the XRPanel control in exported PDF documents. By default, XRPanel is exported as a Div. You can keep this default value or change it to Decorative.

    XRPanel AccessibleRole in grid

    Before you export your report, set the PdfExportOptions.PdfUACompatibility property to PdfUA1 or PdfUA2 to ensure the document is PDF/UA compatible.

    The image below shows the result. AccessibleRole is set to Decorative, and the screen reader treats XRPanel as an artifact in the exported document:

    XRPanel exported as artifact

    See Also