Tuesday, September 13, 2005

Displaying only selected page items or parameters in the title

You may find at times that you do not want to display all page-items in your worksheet title, or all parameters, but only some selected ones. The standard list of meta-tokens available in a title does not seem to offer what you need in this case. But, there is a 'hidden' (or undocumented) way of achieving this.

Let's see with an example.

In my worksheet title, I have added these two meta-tokens: &PageItems and &Parameters.
When I run this worksheet, all page items - Year and Department, and all parameters selected - 1999 and 2000 for year, and 'Video Rental' and 'Game Rental' are displayed in the title.
If you see below, the names I have given to the two parameters in my worksheet are "YearParam" for the year based parameter and "DeptParam" for the Department based parameter.
I now edit my worksheet title, and add these two meta-tokens: &Year and &DeptParam, see what happens now. To make it easier to see the difference between the &PageItems, &Parameters standard meta-tokens on the one hand, and between the &Year and &DeptParam meta-tokens on the other, I have kept all of them in the title, and formatted the new meta-tokens differently.Instead of seeing ALL page-items, only the selected value for the Year page-item is displayed, while in the case of the new parameter meta-token, only the selected values for the 'DeptParam' parameter are displayed.