I have a document with a lot of bookmarks. LOTS of bookmarks.
The reason for this is that there are about 12 sets of filtering that the client needs to apply for reports but they also need to have those reports for each of N branches as well as the entire organisation.
While I realise that I can just present the organisation-wide bookmarks and then ask that the users select the branch as a filter, that's not what's been requested. They want to select a BM and have the answer for Branch X in a single step so, at the moment, they have to scroll the list of bookmarks and go past Branch A, Branch B, Branch C... until they get to Branch X.
Now then, my thought is this... I can hold a list of User IDs and Branches. I can hold a list of BM IDs and Branches.
In a macro, triggered on first activation of the document, I can iterate through those lists and use the User ID to see which Branch reports they are interested in, then hide each of the bookmarks that they aren't interested in. (Or I might hide all by default and reveal the appropriate ones.)
The thing that's eluding me at the moment is some way of programmatically hiding a BM in a macro. What I'm after is a function;
function HideBookmarkByID ( BMID )
'* Insert magic here
Alternatively a 'UnHideBM' function would also suffice.
This needs to work on V11, documents are on the server, and I'm using the IE plugin.
Thanks in advance.
Yes - I know I can disable bookmarks the document 'by hand' by hiding them using the screen in Bookmarks/More, but is the action that I want to perform automatically for some bookmarks.
Imagine I've 10 kinds of reports. Imagine I've 10 departments. I need 10X10 bookmarks for each combination, then another 10 where I don't include the department as they are "Company Wide" reports. When Mr Smith in London logs on, I want to hide all of the bookmarks except the 10 where they reference the London department and the 10 where they are group wide. The reason - so that Mr Smith doesn't have to scroll through 110 bookmarks to find the ones he's after.
(The reality is worse and I have 200+ bookmarks and that's a lot of scrolling!)
I could upload 10 versions of the QV document, one for each department and containing only the relevant bookmarks, but that's a really cruddy idea and would make releasing and document access an absolute nightmare.
Please - if someone has any good ideas how I can achieve this, with or without that macro I want to implement, I'd really like to know!
At first I would look if the bookmarkbox could be adjusted in this way. If not I would use a listbox (additionally data-table within the background or with expressions) and limit the bookmarks to osuser() and/or do some categorizing (in another addditionally fields) for the bookmarks and then trigger the bookmark with a selection-action.
Thanks Marcus. There seems to be no option to customise the Bookmark Box to restrict the BMs displayed. (Groan...)
The populated list + an on-select trigger has some potential, but the users are accustomed to selecting their BMs from the list available to them in the drop-down at the top of the browser window when accessing reports via the server. In most cases the documents don't have a Bookmark Box on the sheets at all as I've relied upon the tool-bar in the browser window because I want to dedicate as much of the sheet area as possible to presenting results.
I have a plan though, and when I get access to the server again (someone pressed the wrong button last week so I'm limited to P/E at the moment) I can try my exciting new idea. If it works I'll do a write-up as I can't be the first person in the world needing to restrict users' views of bookmarks to only those pertinent to their role/department.
I wrote a blog article some time ago about another way to display bookmarks.
You could base your solution on this approach, but add a category field to group the bookmarks and then do initial selection on this field using section access rather than triggers and/or macros.
I know you don't want to use screen space for the bookmarks, but this method uses a compact list box which does not use a lot of screen space
Jonathon, Marcus, yep - thank you. I will have to go down the route of a list-box, a trigger or two, some string, a bent pin and some sticky tape.
QV support were unable to answer this one for me as well. Seems the API just isn't rich enough to go to this level. (What a shame!).
I implemented an alternate version where I stored no bookmarks in the document and loaded them on an 'on-open' trigger. That worked wonderfully; get the OSUser, look at some config data to work out which groups of BMs the users wants, and load the appropriate BM.XML files. Works great in desktop/PE but when it runs from the server, the API call to load the new BMs has a side effect of duplicating *ALL* existing BMs as well. (API ImportBookmarks - causing duplicates on server) This too was un-fixable by QV support.
List boxes for bookmarks? Gaaaahhhh..... If I have to.
Thanks for your help chaps!