Navigation:  Contents > Navigation >

StimulReport.Net User Manual

Print this Topic Previous pageReturn to chapter overviewNext page

Bookmarks creation using a code

Using the Bookmark property you can create rather complicated structure of bookmarks in a report. But sometimes you need more properties for your work. For example, you want to add nodes in a tree of bookmarks without the Bookmark. Or else you want to add a node on another nesting level. StimulReport.Net offers you the ManualBookmark property. This invisible property of a report is available only from the report code. It is very simple to use this property. For example, if you want to add a bookmark of the fist nesting level you may use the following code:

 

 

ManualBookmark.Add("My Bookmark");

 

 

This code will create such a bookmark in the tree of bookmarks:

 

A bookmark created from the code.

 

For example, if you want to add a bookmark of the second nesting level you may use the following code:

 

 

ManualBookmark["My Bookmark"].Add("Bookmark Level2");

 

 

Two bookmarks of different nesting levels created from the code.

 

The same can be said about the third nesting level creation:

 

 

ManualBookmark["My Bookmark"]["Level2"].Add("Bookmark Level3");

 

 

Three bookmarks of different nesting levels created from the code.

 

If you want to create three bookmarks at once you should use the last example of this chapter. StimulReport.Net will automatically check whether all bookmarks are in the tree and will add all missed ones.

Notice. When you use the Manual Build property you cannot use the Bookmark property to add bookmarks into the tree of bookmarks.

Using bookmarks you may need to make navigation. If you want the report generator could find all components you should use the Bookmark property of these components. At that the Bookmark property value should concur with the name of a new bookmark. For example, you want to add a bookmark. Do it as follows:

 

 

ManualBookmark.Add(Customers.CompanyName);

 

 

In accordance with it the Bookmark property of the component you should write as follows:

 

 

{Customers.CompanyName}

 

 

As a result all components will be marked as bookmarks with a company name. In the tree of bookmarks these names of companies will be added. And when you select nodes of the tree of bookmarks all components will be found.