Giter Club home page Giter Club logo

reporting-winforms-create-hierarchical-report-in-code's Introduction

Reporting for WinForms - How to create a Hierarchical Report in Code

Hierarchical Report

Implementation Details

Do the following to create a hierarchical report in code:

Bind Report to Data

You can print a report in tree mode if it is bound to recursive data or data with ID-ParentID related fields. In this example, data records are defined by the CountryData class.

Specify Hierarchy Print Options

Specify either the HierarchyPrintOptions.ChildListFieldName property (for recursive data) or the HierarchyPrintOptions.KeyFieldName-HierarchyPrintOptions.ParentFieldName property pair (for ID-ParentID related data fields, like in this example) to print the report's DetailBand.

Specify the HierarchyPrintOptions.Indent property to set the child node offset, in report units.

Align Tree Nodes

In this example, the AnchorHorizontal property of the DetailBand's labels is set to Both. This allows the labels to fit the page. See the HierarchyPrintOptions class description for details.

Add a Control to Expand/Collapse Tree Nodes

Do the following to allow end users to expand and collapse tree nodes:

  1. Add the XRCheckBox control to the DetailBand at the left-most position. In this example, the checkbox' GlyphOptions property is used to specify custom glyphs for the checked and unchecked states.

  2. Set the DetailBand's DrillDownControl property to the added XRCheckBox control.

  3. Set the XRCheckBox's CheckState property to the following expression: [ReportItems].[Detail].[DrillDownExpanded]

Sort Report Data

In this example, the DetailBand's SortFields property is specified to sort data on each hierarchy level.

Highlight Root Nodes

When the CurrentRowHierarchyLevel variable in expressions to get a row's zero-based level in the tree. In this example, this variable is used in the DetailBand's expression to set the background color for the top-level nodes.

Files to Review

Documentation

reporting-winforms-create-hierarchical-report-in-code's People

Contributors

alepikhov avatar andreylepikhov avatar pollyndos avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.