Bookmark from a variable

Stimulsoft Reports.NET discussion
Post Reply
Markus Weiß

Bookmark from a variable

Post by Markus Weiß »

Hi,

i want to set the bookmark of a databand or a group header to the value of a variable. The variable is declared in the dictionary and will be set in the BeforePrint Event and cleared in the AfterPrint Event.

Setting the Interaction.Bookmark property of the databand to {MyVariable} leads to an empty bookmark.

How am i have to do this?

Markus
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Bookmark from a variable

Post by HighAley »

Hello.

What component do you set variable value in?
Please. send us a sample report template with data which reproduces the issue for analysis.

Thank you.
Markus Weiß

Re: Bookmark from a variable

Post by Markus Weiß »

In this sample report the variable "MappedPath" will be filled in the "BeforePrintEvent" event of the DataBand3 and cleared in the "AfterPrintEvent" event of DataBand3. The same applies to the "GroupHeaderBand1" with the same variable.

The value of the variable is displayed correctly in a TextBox in the DataBand3 or GroupHeaderBand1.

But the defined bookmarks on DataBand3 and GroupHeaderBand1 using the Expression {MappedPath} are not working.

I'm using StimulReports.Net 2012.2

Cheers,

Markus
Attachments
BookmarksFromVariable.zip
Sample Report with Bookmarks from Variables
(13.95 KiB) Downloaded 206 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Bookmark from a variable

Post by HighAley »

Hello.

Please, remove code from After Print events. And set the bookmark property of the Text component instead of the Band.

Thank you.
Markus Weiß

Re: Bookmark from a variable

Post by Markus Weiß »

I will do so, but just to be curious. The Bookmark on the databand / groupheader band worked at the time i was using {DataSourceName.Column} syntax instead of the variable.

Do you have a document where i find an explanation of the order in which the events that are available get fired?

Thanks for the help.

Markus
Markus Weiß

Re: Bookmark from a variable

Post by Markus Weiß »

With these changes the Bookmark structure is not as it was intended.

I need the following structure (according to the Report):

Host \ Root resource \ Child resource

Your Change gave me:

Host \ Mix of root resource and child resource

Markus
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Bookmark from a variable

Post by HighAley »

Hello.

Unfortunately, we have no documentation about firing of the events.
But there is a Get Bookmark event where you could set the bookmart of the component with next code:

Code: Select all

e.Value = YourBookmarkValueOrExpression;
Thank you.
Markus Weiß

Re: Bookmark from a variable

Post by Markus Weiß »

Hi Aleksey,

thanks you so much for your help. It worked now after using your event code at the DataBand and GroupHeaderBand.

By the way, i would love to see such an event firing order documentation. That would help to solve a lot of problems during the report design. Often it is like searching the right option / event in your overwhelming set of functions.

Keep up the good work!

Markus Weiss-Ehlers
Markus Weiß

Re: Bookmark from a variable

Post by Markus Weiß »

Correction, i thought it worked, but after carefull inspection i realized that i got a bookmark structure like

Host \ Root Resource \ Child Resource

but it is literally a mix of Root Resource and Child Resource in level 2 and level 3 of the bookmark structure.

Any other ideas?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Bookmark from a variable

Post by HighAley »

Hello.

We are working on the event documentation now.

As I can see in our report the Get Bookmark event fires before Before Print event. So try to avoid using the MappedPath variable and move your code from Before Print Event to Get Bookmark event.

If there will be any problems, please, send us your modified report template for analysis.

Thank you.
Post Reply