Bookmark from a variable
Bookmark from a variable
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
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
Re: Bookmark from a variable
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.
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.
Re: Bookmark from a variable
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
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
Re: Bookmark from a variable
Hello.
Please, remove code from After Print events. And set the bookmark property of the Text component instead of the Band.
Thank you.
Please, remove code from After Print events. And set the bookmark property of the Text component instead of the Band.
Thank you.
Re: Bookmark from a variable
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
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
Re: Bookmark from a variable
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
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
Re: Bookmark from a variable
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:
Thank you.
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;
Re: Bookmark from a variable
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
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
Re: Bookmark from a variable
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?
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?
Re: Bookmark from a variable
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.
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.