Skip to main content
A newer version of this page is available. .

HierarchyPrintOptions Class

Specifies hierarchy print settings.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v20.2.dll

NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.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 face two cases when hierarchically printed data do not fit 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 print a parent level with at least the first child row at the page’s end or print them on the next page.
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 Hierarchical Reports topic for instructions on how to create a hierarchical report.

Inheritance

Object
HierarchyPrintOptions
See Also