Skip to main content

HierarchyPrintOptions Class

Specifies hierarchy print settings.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.1.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

public class HierarchyPrintOptions :
    IHierarchyDataOptions

Remarks

Set the HierarchyPrintOptions class properties to print the Detail band‘s data in tree mode.

HierarchicalReport-Result

Specify the properties that define one of two supported data structure types:

  • Recursive data
    Set the ChildListFieldName property to the name of the collection field that your data exposes.

  • Data with ID-ParentID related fields
    Set the KeyFieldName and ParentFieldName properties to the names of the ID and ParentID fields that your data exposes.

Use the Indent property to specify the child level node offset in report units.

You may encounter two cases when hierarchically printed data does not fit within a page:

  • The child rows do not fit the page’s width
    Anchor the data-bound controls to the right edge of the Detail band (their container). For this, set the controls’ AnchorHorizontal property to Right or Both.
Left/None Anchor Right and Both Anchor
HierarchicalReport-LeftAnchor HierarchicalReport-RightAnchor
  • The child rows do not fit the page’s height
    Set the KeepTogetherWithFirstChild property to true to make sure that a parent node is not separated from its first child by a page break.
KeepTogetherWithFirstChild = true KeepTogetherWithFirstChild = false
HierarchicalReport-KeetTogetherWithFirstChild-True HierarchicalReport-KeetTogetherWithFirstChild-True

Hierarchical print mode supports expand/collapse modes. For this, specify the Detail band’s DrillDownControl property. You can assign any control that is located in the Detail band to this property. For instance, you can add the XRCheckBox control to the Detail band and use it as a drill-down control.

HierarchicalReport-DrillDownControl

You can use the CurrentRowHierarchyLevel variable in expressions to get the current hierarchy level’s index. For example, you can use this variable to highlight hierarchy levels.

HierarchicalReport-DrillDownControl

Sort fields are supported in hierarchical print mode. You can sort data on each hierarchy level.

HierarchicalReport-DrillDownControl

Note

You cannot use HierarchyPrintOptions if you use MultiColumn options.

Refer to the Create a Hierarchical Report in the Visual Studio Report Designer topic for instructions on how to create a hierarchical report.

View Example: How to Create a Hierarchical Report in Code

Inheritance

Object
HierarchyPrintOptions
See Also