In a Section report, bookmark links take you to a location where the bookmark is set on your report. Bookmarks and nested bookmarks appear in the document map for fields, groups, and subreports. You can also add special bookmarks at run-time.
Bookmarks are supported when you preview a report in the Viewer, or export a report in HTML and PDF formats. See Document map for more information. The following sections show setting up bookmarks in some scenarios in XML-based Section reports. Note that the same scripts are equally applicable to Code-based Section reports with cautious use of casing.
Visual Basic.NET code. Paste INSIDE the Detail Format event. |
Copy Code
|
---|---|
Detail.AddBookmark(TextBox1.text) |
C# code. Paste INSIDE the Detail Format event. |
Copy Code
|
---|---|
Detail.AddBookmark(TextBox1.Text); |
Bookmarks can be nested to reflect a hierarchical structure; this is sometimes called a parent-child relationship.
Connection String |
Copy Code
|
---|---|
method=POST;headers={"Content-Type":"application/json"};body={ "query": "{employees{country, city, superior{firstName,lastName,title}}}" };jsondoc=https://demodata.mescius.io/northwind/graphql |
JSONPath |
Copy Code
|
---|---|
$.data.employees[*] |
Visual Basic.NET code. Paste INSIDE the Detail Format event. |
Copy Code
|
---|---|
Detail.AddBookmark(txtcountry1.Text + "\\" + txtcity1.Text)
|
C# code. Paste INSIDE the Detail Format event. |
Copy Code
|
---|---|
Detail.AddBookmark(txtcountry1.Text + "\\" + txtcity1.Text);
|
Visual Basic.NET code. Paste INSIDE the Detail_Format event. |
Copy Code
|
---|---|
Detail.AddBookmark(txtcountry1.Text + "\\" + txtcity1.Text + "\\" + txtsuperior_title1.Text) |
C# code. Paste INSIDE the Detail_Format event. |
Copy Code
|
---|---|
Detail.AddBookmark(txtcountry1.Text + "\\" + txtcity1.Text + "\\" + txtsuperior_title1.Text); |
Visual Basic.NET code. Paste INSIDE the Group Header Format event. |
Copy Code
|
---|---|
GroupHeader1.AddBookmark(txtcountry1.Text) |
C# code. Paste INSIDE the Group Header Format event. |
Copy Code
|
---|---|
GroupHeader1.AddBookmark(txtcountry1.Text); |
To create and add special bookmarks to the bookmarks collection at run time, add the bookmarks to the report document's page collection.
Visual Basic.NET code. Paste INSIDE the ReportEnd event. |
Copy Code
|
---|---|
rpt.Document.Pages(0).AddBookmark("Page1", 1) rpt.Document.Pages(1).AddBookmark("Page2", 2) rpt.Document.Pages(2).AddBookmark("Page3", 3) |
C# code. Paste INSIDE the ReportEnd event. |
Copy Code
|
---|---|
rpt.Document.Pages[0].AddBookmark("Page1", 1); rpt.Document.Pages[1].AddBookmark("Page2", 2); rpt.Document.Pages[2].AddBookmark("Page3", 3); |
Visual Basic.NET code. Paste INSIDE the Detail Format event of the main report. |
Copy Code
|
---|---|
Private _subRpt As GrapeCity.ActiveReports.SectionReport Public Sub Detail_Format() SubReport1.Report = _subRpt Detail.AddBookmark(txtcountry1.Text) End Sub Public Sub ActiveReport_ReportStart() _subRpt = New GrapeCity.ActiveReports.SectionReport() _subRpt.LoadLayout(System.IO.Path.GetFullPath("..\..\..\SubReport1.rpx")) End Sub |
C# code. Paste INSIDE the Detail Format event of the main report. |
Copy Code
|
---|---|
GrapeCity.ActiveReports.SectionReport _subRpt; public void Detail_Format() { SubReport1.Report = _subRpt; Detail.AddBookmark(txtcountry1.Text); } public void ActiveReport_ReportStart() { _subRpt = new GrapeCity.ActiveReports.SectionReport(); _subRpt.LoadLayout(System.IO.Path.GetFullPath(@"..\..\..\SubReport1.rpx")); } |
Visual Basic.NET code. Paste INSIDE the Detail Format event of the subreport. |
Copy Code
|
---|---|
Detail.AddBookmark(CType(rpt.ParentReport.Sections("Detail").Controls("txtcountry1"), TextBox).Text + "\" + txtcity1.Text) |
C# code. Paste INSIDE the Detail Format event of the subreport. |
Copy Code
|
---|---|
Detail.AddBookmark(((TextBox) (rpt.ParentReport.Sections["Detail"].Controls["txtcountry1"])).Text + "\\" + txtcity1.Text); |