ActiveReports 6 Online Help
Add Bookmarks
Show AllShow All
Hide AllHide All

ActiveReports can display bookmarks and nested bookmarks in the viewer's table of contents for fields, groups, subreports. You can also add special bookmarks at run time.

To set up basic bookmarks

This code uses the same controls used in the Basic Data Bound Reports walkthrough

  1. Double-click on the detail section of the report. This creates an event-handling method for the report's Detail Format event.
  2. Add code to the handler to set up bookmarks.

The following example shows what the code for the method looks like.

To write the code in Visual Basic.NET

To write the code in C#


To set up leveled or nested bookmarks

This code uses fields from the Group On Unbound Fields walkthrough.

  1. Double-click on the detail section of the report. This creates an event-handling method for the report's Detail Format event.
  2. Add code to the handler to set up bookmarks.

The following example shows what the code to set up leveled or nested Bookmarks looks like.

To write the code in Visual Basic.NET

To write the code in C#


To nest grandchild bookmarks and use bookmarks in grouping

  1. Double-click in the Detail section of the report. This creates an event-handling method for the report's Detail_Format event.
  2. Add code to the handler to set up a bookmark for each city and nest city bookmarks within each country, and company bookmarks in each city.

The following example shows what the code for the detail section looks like.

To write the code in Visual Basic.NET

To write the code in C#

  1. Double-click in the Group Header section of the report. This creates an event-handling method for the report's Group Header Format event.
  2. Add code to the handler to set up a bookmark for each instance of the country group.

The following example shows what the code for the group header looks like.

To write the code in Visual Basic.NET

To write the code in C#


To combine parent report and subreport bookmarks

This code uses the same controls as those found in the Subreports with Run-Time Data Sources walkthrough.

  1. Double-click in the Detail section of the main report to create an event-handling method for the report's Detail Format event.
  2. Add code to the handler to create a bookmark for each instance of the CategoryName field in the main report.

The following example shows what the code for the method looks like for the main report.

To write the code in Visual Basic.NET

To write the code in C#

  1. Double-click in the Detail section of the subreport to create an event-handling method for the report's Detail Format event.
  2. Add code to the handler to create a bookmark for each instance of the CategoryName field in the subreport.

The following example shows what the code for the method looks like for the subreport.

To write the code in Visual Basic.NET

To write the code in C#


To preview the report and Bookmarks Collection in the designer

  1. Click the Preview tab at the bottom of the designer.
  2. Click the Table of Contents icon to view the Bookmarks collection.


To view a report's bookmarks in the viewer

  1. Add the ActiveReports viewer control to your Windows form.
  2. Add code to display the report document in the viewer. See Viewing Reports for help.
  3. Press F5 to run the report.
  4. Click the Table of Contents icon to view the Bookmarks collection.


To add special bookmarks at run time

To create and add special bookmarks to the bookmarks collection at run time, add the bookmarks to the report document's pages collection.

Caution: Keep in mind that the pages collection does not exist until after the report runs, so use this code in the ReportEnd event or in form code after the report has run.

To write the code in Visual Basic.NET

To write the code in C#

See Also

Getting Started

Related Sections