ActiveReports 18 .NET Edition
Samples / Samples / Advanced / Section Report / Custom Drill Through
In This Topic
    Custom Drill Through
    In This Topic

    The Custom Drill Through 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.

    Custom drill-through report

    Sample Location

    Visual Basic.NET

    https://github.com/activereports/Samples18/tree/main/Advanced/Section/CustomDrillThrough/VB.NET

    C#

    https://github.com/activereports/Samples18/tree/main/Advanced/Section/CustomDrillThrough/C#

    Details

    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 Nwind.db downloaded from GitHub in ..\Samples18\Data\NWIND.db.

    The sample consists of:

    ViewerForm: This form contains only the Viewer control. Right-click the form and select View Code to see the code that allows multiple ViewerForms to display for the reports, and see the Form Load event for the code that loads the main report into the viewer. See the Viewer Hyperlink event for the code that collects a string value from the Hyperlink property of the clicked TextBox on the main report and passes it into the customerID Parameter of the report DrillThrough1, or collects a numeric value and passes it to the orderID Parameter of the report DrillThrough2. This code then runs the report with the parameter value and displays it in another instance of the ViewerForm.

    DrillThroughMainReport: The main report that is loaded in the ViewerForm by default uses the PageHeader and Detail sections.

    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.

    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 DrillThrough1.