Skip to content

Drill through Reports

Peter Gill edited this page Jun 8, 2026 · 1 revision

Drill-through Reports

A drill-through action lets a user click a value in one report to open a second, more detailed report filtered to that value. For example, clicking a customer name in a summary report opens a detail report showing only that customer's orders.

Setting up a drill-through action in the designer

  1. Open the parent (summary) report in the designer.
  2. Select the Textbox or field that should be clickable.
  3. Right-click → PropertiesAction tab.
  4. Set Action type to Drill-through report.
  5. In the Report field, enter the path to the child .rdl file (relative to the parent report's folder).
  6. Under Parameters, map parent field values to child report parameters:
    • Parameter name — the parameter name as defined in the child report
    • Value — an expression from the parent dataset, e.g. ={CustomerId}

Child report setup

The child report must define a Report Parameter matching the name you mapped in step 6. The parameter filters the child report's dataset query:

-- Child report dataset SQL
SELECT OrderId, Amount, OrderDate
FROM Orders
WHERE CustomerId = @CustomerId

Handling drill-through in the WinForms viewer

The WinForms viewer raises the HyperlinkAction event when any action link is clicked, including drill-through. Wire up the event to load the child report in a new window or panel:

rdlView.HyperlinkAction += async (sender, e) =>
{
    if (e.Hyperlink.StartsWith("report://", StringComparison.OrdinalIgnoreCase))
    {
        // Parse the drill-through URL to extract report path and parameters
        var uri = new Uri(e.Hyperlink);
        var childPath = uri.LocalPath;
        var query = System.Web.HttpUtility.ParseQueryString(uri.Query);

        var childViewer = new RdlViewerForm(childPath, query);
        childViewer.Show();
        e.Handled = true;
    }
};

See Hyperlink Custom Action for the full event API.

Handling drill-through in the Avalonia viewer

ReportViewer.HyperlinkClicked += async (sender, e) =>
{
    // Open child report in a new Avalonia window
    var childWindow = new ReportWindow(e.Hyperlink);
    await childWindow.ShowDialog(this);
};

Drill-through in server-side / no-GUI output

Drill-through is an interactive feature for viewers. In PDF, Excel, and TIFF output the links are rendered as static hyperlinks pointing to the raw action URL. In HTML output the links are rendered as <a href> elements.

For ASP.NET Core, intercept the link URL server-side and render the child report on demand, returning it as a new HTTP response.

Drill-through vs sub-reports

Drill-through Sub-report
Triggered by User click at run time Always rendered inline
Child report visible Only when user navigates Embedded in parent output
PDF output Link in PDF (navigates if PDF viewer supports it) Rendered inline in the same PDF
Use case Interactive exploration, detail-on-demand Fixed composite reports

Use sub-reports when the child content must always appear in the output. Use drill-through when the detail is optional and driven by user interaction.

Passing multiple parameters

Map as many parameters as needed in the Action dialog. Common patterns:

  • Pass a surrogate key (CustomerId, OrderId) — the child filters by ID.
  • Pass a date range — the child shows data for the clicked period.
  • Pass the parent's connection string override — the child queries the same dynamic database.

Clone this wiki locally