Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have the following problem:
I have a .qvw with a lot of Personal-Server-Bookmarks. So in the List of Server-Elements I have to scroll and scroll and scroll.
Is there any way to get the name of the Personal-Server-Bookmarks and show them in a Listbox? So that I can search for the name in the Listbox and call the bookmark from the Listbox.
Thanks for your regards.
Christian
Hi,
Create a list box by using a variable before that set something as variable value.
List box expression should be $(vVaribale)
Then have a macro like below
sub bookmark
bookmarks = ActiveDocument.GetDocBookmarkNames
dim BM
for i = lbound(bookmarks) to ubound(bookmarks)
if(i=0) then
BM="'"&bookmarks(i)&"'"
else
BM=BM&",'"&bookmarks(i)&"'"
end if
next
set v = ActiveDocument.GetVariable("vVariable")
v.SetContent "ValueList("&BM&")",true
end sub
Call the above macro on document open trigger.
You can see the list of bookmark names here but you cannot select it.
If your need is to apply the bookmark values based on selection.you need to go with adding the bookmarks and there corresponding ID's in inline.
Celambarasan
Hi wunderch,
You can achieve solution for your problem using the following Link.
Hope this link will give good idea / solution .
http://yahqblog.blogspot.in/2011/01/novel-bookmark-display.html#comments
Regards
Ashok
Hi,
Create a list box by using a variable before that set something as variable value.
List box expression should be $(vVaribale)
Then have a macro like below
sub bookmark
bookmarks = ActiveDocument.GetDocBookmarkNames
dim BM
for i = lbound(bookmarks) to ubound(bookmarks)
if(i=0) then
BM="'"&bookmarks(i)&"'"
else
BM=BM&",'"&bookmarks(i)&"'"
end if
next
set v = ActiveDocument.GetVariable("vVariable")
v.SetContent "ValueList("&BM&")",true
end sub
Call the above macro on document open trigger.
You can see the list of bookmark names here but you cannot select it.
If your need is to apply the bookmark values based on selection.you need to go with adding the bookmarks and there corresponding ID's in inline.
Celambarasan
Hi Celambarasan,
thank you so much for your solution. It works great.
There is only one problem left:
When I select one bookmark in the listbox "bookmark" the bookmark is not "selected displayed" in green.
So that I dont know what bookmark is selected at the moment.
In the example I selected the bookmark "Chris".
Please can you help me again!
Thanks
Christian
hi,
For this you can use the bookmark object in your application to select and display the selected bookmark
Regards
Ashok
Hi Christian,
I got the problem what is happening in your example. If you select a bookmark from your list box it will automatically select ValueSequence which will trigger 'Apply Bookmark' action and in your bookmark like BM01 etc you don't have value of 'Bookmark' list box selected. So it apply the bookmark BM01 selection and remove your 'Bookmark' list box selection.
See John example in the below thread in which the list box selection created by variable persist and showed in green color.
http://community.qlik.com/message/165406#165406
I currently don't have any solution but may be through vb script we need to make the listbox 'Bookmark' selection visible (green)
Hope this help,
Anosh