ActiveReports 9 > ActiveReports User Guide > Samples and Walkthroughs > Samples > Section Report > Preview > Hyperlinks and DrillThrough |
The Hyperlinks and DrillThrough sample consists of three reports and a ViewerForm. The reports use the Hyperlink event of the Viewer control to pass a value from the Hyperlink property of a TextBox control to a Parameter value in a more detailed report.
Sample Location
Visual Basic.NET
<User Folder>\ComponentOne Samples\ActiveReports 9\Section Reports\Preview\Hyperlinks and DrillThrough\VB.NET
C#
<User Folder>\ComponentOne Samples\ActiveReports 9\Section Reports\Preview\Hyperlinks and DrillThrough\C#
Runtime Features
When you run this sample, a report displaying bound fields with a link created on CustomerID is displayed in a Viewer control. DrillThrough feature allows users to navigate to another report containing detailed data. Clicking the CustomerID hyperlink takes you to the second report which displays detailed information of the selected CustomerID. On further clicking the OrderID hyperlink the third report displaying the details of the selected order is opened in the Viewer. This feature enables the users to systematically go through the detailed data of the desired CustomerID.
Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents folder]\ComponentOne Samples\ActiveReports 9\Data\NWIND.mdb. If you are unable to access the data files in the sample, create the Data folder and place all the data files to this folder, or change the reference path to the data files within the folder according to your environment. |
Project Details
ViewerForm
DrillThroughMain Report
The main report that is loaded in the ViewerForm by default uses the PageHeader and Detail sections.
PageHeader section
Detail section
Right click on the form, select View code to see the Connection String and SQL Query that provide data for the bound fields.
The Detail section has three bound TextBox controls that display a list of customer information. Select CustomerID and you will see that the HyperLink property is not set in the Properties window. To see the code that assigns the data from the TextBox to its HyperLink property, right-click the report and select View Code. The HyperLink property is set in the Detail BeforePrint event.
Note: This hyperlink does not work in Preview mode, because it relies on code in the ViewerForm to pass the value to DrillThrough1 report's parameter. |
PageFooter Section
DrillThrough1 Report
This report looks similar to the DrillThroughMain report, but the main difference is that it has a CustomerID parameter in its SQL Query.
GroupHeader section
Detail section
GroupFooter section
DrillThrough2 Report
Like DrillThrough1, this report has a parameter in a SQL Query, but unlike the other two reports, this one has no hyperlink. It displays order details for the OrderID value passed into it from the clicked hyperlink in DrillThroguh1.
GroupHeader section
Detail section