Back to Devexpress

SubreportBase.BookmarkParent Property

xtrareports-devexpress-dot-xtrareports-dot-ui-dot-subreportbase-2e784e4e.md

latest3.9 KB
Original Source

SubreportBase.BookmarkParent Property

Specifies the control in the main report whose bookmark is the parent node for the subreport’s table of contents.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
[Browsable(true)]
[DefaultValue(null)]
[SRCategory(ReportStringId.CatNavigation)]
public XRControl BookmarkParent { get; set; }
vb
<SRCategory(ReportStringId.CatNavigation)>
<Browsable(True)>
<DefaultValue(Nothing)>
Public Property BookmarkParent As XRControl

Property Value

TypeDefaultDescription
XRControlnull

A control whose bookmark is parent to the subreport’s bookmarks.

|

Remarks

The subreport’s bookmarks are merged with the main report’s bookmarks. The BookmarkParent property allows you to change the level at which the subreport’s TOC is inserted in the main report’s TOC.

If the subreport includes other subreports, the specified control becomes parent to their bookmarks.

Example

The following code combines TOCs for two subreports:

csharp
using DevExpress.XtraReports.UI;
// ...
    XtraReport rep = new XtraReport();
    rep.BeginUpdate();
    ReportHeaderBand headerBand = new ReportHeaderBand();
    XRLabel lbl1 = new XRLabel() { Bookmark = "Categories" };
    XRLabel lbl2 = new XRLabel()
    {
        Bookmark = "Orders",
        LocationF = new PointF(100, 0)
    };
    headerBand.Controls.Add(lbl1);
    headerBand.Controls.Add(lbl2);
    rep.Bands.Add(headerBand);
    DetailBand detail = new DetailBand();
    rep.Bands.Add(detail);
    detail.Controls.Add(new XRSubreport()
    {
        ReportSource = new XtraReport1(),
        BookmarkParent = lbl1,
        GenerateOwnPages = true
    });
    detail.Controls.Add(new XRSubreport()
    {
        ReportSource = new XtraReport2(),
        BookmarkParent = lbl2,
        GenerateOwnPages = true,
        LocationF = new PointF(0, 23)
    });
    rep.EndUpdate();

    rep.ShowPreviewDialog();
vb
Imports DevExpress.XtraReports.UI
' ...
    Dim rep As XtraReport = New XtraReport()
    rep.BeginUpdate()
    Dim headerBand As ReportHeaderBand = New ReportHeaderBand()
    Dim lbl1 As XRLabel = New XRLabel() With {
        .Bookmark = "Categories"
    }
    Dim lbl2 As XRLabel = New XRLabel() With {
        .Bookmark = "Orders",
        .LocationF = New PointF(100, 0)
    }
    headerBand.Controls.Add(lbl1)
    headerBand.Controls.Add(lbl2)
    rep.Bands.Add(headerBand)
    Dim detail As DetailBand = New DetailBand()
    rep.Bands.Add(detail)
    detail.Controls.Add(New XRSubreport() With {
        .ReportSource = New DXApplication1.XtraReport1(),
        .BookmarkParent = lbl1,
        .GenerateOwnPages = True
    })
    detail.Controls.Add(New XRSubreport() With {
        .ReportSource = New DXApplication1.XtraReport2(),
        .BookmarkParent = lbl2,
        .GenerateOwnPages = True,
        .LocationF = New PointF(0, 23)
    })
    rep.EndUpdate()

    rep.ShowPreviewDialog()

The result is shown below:

See Also

SubreportBase Class

SubreportBase Members

DevExpress.XtraReports.UI Namespace