Back to Devexpress

NavigateToReportAction Class

xtrareports-devexpress-dot-xtrareports-dot-interactivity.md

latest4.0 KB
Original Source

NavigateToReportAction Class

Contains settings that allows you to implement a drill-through report.

Namespace : DevExpress.XtraReports.Interactivity

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
public class NavigateToReportAction :
    XRAction,
    IXtraSupportDeserializeCollectionItem,
    IXtraSupportCreateContentPropertyValue
vb
Public Class NavigateToReportAction
    Inherits XRAction
    Implements IXtraSupportDeserializeCollectionItem,
               IXtraSupportCreateContentPropertyValue

Remarks

A drill-through report allows you to click on a report element and navigate to a detail report within the same print preview window.

To create drill-through reports, use the Action property of report controls (XRControl descendants). The property provides access to NavigateToReportAction. NavigateToReportAction allows you to specify the detail report instance or URL to define a master-detail relationship and obtain a collection of detail report parameter bindings.

The following code snippet shows how to define master-detail relationships between Category and Product reports within a single project:

csharp
using DevExpress.XtraReports.Interactivity;
using DevExpress.XtraReports.UI;

namespace Drill_through_example {
    public partial class XtraReportCategories : DevExpress.XtraReports.UI.XtraReport {
        public XtraReportCategories(){
            InitializeComponent();

            // Create a NavigateToReportAction instance and specify its settings
            NavigateToReportAction cellAction = new NavigateToReportAction();
            cellAction.ReportSource = new XtraReportProducts();

            // Assign the NavigateToReportAction object to the control’s Action property
            tableCell6.Action = cellAction;

        }
    }
}
vb
Imports DevExpress.XtraReports.Interactivity
Imports DevExpress.XtraReports.UI

Namespace Drill_through_example
    Partial Public Class XtraReportCategories
        Inherits DevExpress.XtraReports.UI.XtraReport

        Public Sub New()
            InitializeComponent()

            ' Create a NavigateToReportAction instance and specify its settings
            Dim cellAction As New NavigateToReportAction()
            cellAction.ReportSource = New XtraReportProducts()

            ' Assign the NavigateToReportAction object to the control’s Action property
            tableCell6.Action = cellAction

        End Sub
    End Class
End Namespace

When you switch to the preview, you can now click on the Category value in the table and navigate to the detail report that contains Product values.

A Breadcrumb control automatically appears below the Document Viewer toolbar and allows you to navigate back to the original report.

Review the following tutorial for more information on how to implement drill-through functionality in the UI: Create Drill-Through Reports.

Inheritance

Object XRAction NavigateToReportAction

See Also

NavigateToReportAction Members

DevExpress.XtraReports.Interactivity Namespace