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.v24.2.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
[Browsable(true)]
[DefaultValue(null)]
[SRCategory(ReportStringId.CatNavigation)]
public XRControl BookmarkParent { get; set; }
Property Value
Type | Default | Description |
---|---|---|
XRControl | null | 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:
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();
The result is shown below:
See Also