ActiveReports 8 > ActiveReports User Guide > Samples and Walkthroughs > Walkthroughs > Page Report Walkthroughs > Preview > Reports with Bookmarks |
You can assign a bookmark ID to any report control and link a text box or image to it to allow users to easily navigate between items in the finished report. The bookmark link works like a hyperlink, except that clicking a bookmark link jumps to another page or area of the report instead of to a Web page.
This walkthrough explains the steps involved in setting up bookmarks and links.
The walkthrough is split up into the following activities:
Note: This walkthrough uses the Factbook sample database. By default, in ActiveReports, the Factbook.rdsx file is located at [User Documents folder]\ComponentOne Samples\ActiveReports 8\Data\Factbook.rdsx. |
Note: If you have already created the report outlined in the Reports with XML Data walkthrough, you can open that report and go directly to the Assigning a Bookmark ID section of this walkthrough. |
When you complete this walkthrough you get a layout that looks similar to the following at design time and at runtime.
To add an ActiveReport to a Visual Studio project
See Adding an ActiveReport to a Project for information on adding different report layouts.
To connect the report to a data source
To add a dataset
//country [@name != 'World']
Field Name | Type | Value |
---|---|---|
Name | Database Field | @name |
Currency | Database Field | ./ExchangeRates/Currency |
2004 | Database Field | ./ExchangeRates/VsUSD2004 |
2003 | Database Field | ./ExchangeRates/VsUSD2003 |
2002 | Database Field | ./ExchangeRates/VsUSD2002 |
2001 | Database Field | ./ExchangeRates/VsUSD2001 |
2000 | Database Field | ./ExchangeRates/VsUSD2000 |
To add controls to the report
Field Name | Property Name |
---|---|
Currency | Location: 1.125in, 0.5in Size: 2.25in, 0.25in |
2004 | Location: 4in, 0.875in Size: 1in, 0.25in |
2003 | Location: 4in, 1.25in Size: 1in, 0.25in |
2002 | Location: 4in, 1.625in Size: 1in, 0.25in |
2001 | Location: 4in, 2in Size: 1in, 0.25in |
2000 | Location: 4in, 2.375in Size: 1in, 0.25in |
Note: You will notice that the expressions created for these fields are different than usual. Because Visual Basic syntax does not allow an identifier that begins with a number, any numeric field names must be treated as strings in expressions. |
Property Name | Property Value |
---|---|
Location | 0.125in, 0.875in |
Size | 3.125in, 0.25in |
Value | ="Value of " & Fields!Currency.Value & " versus US$ for year:" |
Font | Normal, Arial, 10pt, Bold |
TextAlign | Right |
TextBox1
Property Name | Property Value |
---|---|
Location | 0.125in, 0.5in |
Size | 0.75in, 0.25in |
FontWeight | Bold |
Value | Currency: |
TextBox2
Property Name | Property Value |
---|---|
Location | 3.375in, 0.875in |
Size | 0.5in, 0.25in |
TextAlign | Right |
Value | 2004: |
TextBox3
Property Name | Property Value |
---|---|
Location | 3.375in, 1.25in |
Size | 0.5in, 0.25in |
TextAlign | Right |
Value | 2003: |
TextBox4
Property Name | Property Value |
---|---|
Location | 3.375in, 1.625in |
Size | 1in, 0.25in |
TextAlign | Right |
Value | 2002: |
TextBox5
Property Name | Property Value |
---|---|
Location | 3.375in, 2in |
Size | 0.5in, 0.25in |
TextAlign | Right |
Value | 2001: |
TextBox6
Property Name | Property Value |
---|---|
Location | 3.375in, 2.375in |
Size | 0.5in, 0.25in |
TextAlign | Right |
Value | 2000: |
To assign a bookmark ID to the report control
A bookmark ID marks any report control as something to which a bookmark link can navigate.
Note: Every bookmark ID in a report must be a unique string. If you have duplicates, a link to it will navigate only to the first one it finds. |
To add a bookmark link to the report control
A bookmark link is like a hyperlink that navigates to a report control marked with a bookmark ID instead of to a URL. We will add a text box below the list we already created to display at the bottom of the report. This text box will have a bookmark link to the bookmark ID we created in the last procedure.
Property Name | Property Value |
---|---|
Value | Back to Top |
Location | 0in, 3in |
Size | 6.5in, .5in |
TextAlign | Center |
To view the report
Open the report in the Viewer. See Using the Viewer for further information.