Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Collapse]Snap
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamental Concepts
   [Collapse]Examples
     How to: Bind a Report to an MDB Database (Runtime Sample)
     How to: Bind a Report to Multiple MDB Data Sources (Runtime Sample)
     How to: Bind a Report to a Dataset Populated from an XML File (Runtime Sample)
     How to: Bind a Report to Multiple List Data Sources (Runtime Sample)
     How to: Bind a Report to an MS SQL Server Database
     How to: Calculate a Summary Function
     How to: Create a Calculated Field
     How to: Limit the Data Supplied During Document Editing
     How to: Create a Snap Template (Runtime Sample)
     How to: Sort Data (Runtime Sample)
     How to: Group Data (Runtime Sample)
     How to: Filter Data (Runtime Sample)
     How to: Format Data
     How to: Pass Parameters to a Report
     How to: Pass Parameters to a Report (Runtime Sample)
     How to: Create a Master-Detail Report
     How to: Create a Multi-Column Report
     How to: Create a Side-by-Side Report
     How to: Create a Report with a Chart
     How to: Save, Load, or Export a Report
     How to: Add a Table of Contents to a Report
     How to: Customize the Data Source Wizard
     How to: Programmatically Mark the Data Source as Use for Mail Merge
     How to: Create a Snap Chart Programmatically
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Add a Table of Contents to a Report

This tutorial describes how to provide a Snap report with an automatically generated hierarchical table of contents.

The tutorial consists of the following sections.

Expanded Create a Reporting Application

  1. To get started with this tutorial, create a master-detail Snap report that is bound to the Products and Categories tables of the sample Northwind database (the nwind.mdb file included in the XtraReports installation). Drag-and-drop the CategoryName and Description fields of the Categories data table from the Data Explorer to the body of the document, to create a master report.

  2. Drag-and-drop the ProductName, UnitPrice and UnitsInStock fields of the Categories.Products data table to create a detail report.

For general information on how to create a master-detail Snap report, refer to How to: Create a Master-Detail Report.

Expanded Add a Table of Contents to the Report

  1. To add a table of contents to the Snap document, place the text cursor in the position in the document where you wish to insert a table of contents, and click the Table of Contents button in the References tab of the Snap editor's ribbon toolbar. The newly added table of contents will contain no entries.

  2. Table of contents provide the ability to display document fields in different hierarchical levels. To show the document field that is bound to the CategoryName data field in level 1 of the table of contents, click the document field to highlight it.

    Then click the Add Text button in the References tab of the ribbon toolbar, and select Level 1 in the invoked drop-down menu.

  3. Next, click the Update Table button in the Table of Contents button group in the ribbon toolbar's References tab, to update the displayed content of the table of contents according to the changes made in the previous step.

  4. Show the document field in the same way. The document field is bound to the ProductName data field in level 2 of the table of contents.

Expanded View the Result

The Snap report with a table of contents is now ready. Click the Print Preview button in the File tab of the ribbon toolbar to view the preview.

How would you rate this topic?​​​​​​​