Sun 31 May 2009
A new desire came from one of our customers. The request was to have the ability to search in Panorama Crosstab. The first solution I thought of was searching the grid in iterative way and it worked fine using the Panorama SDK. After that, my friend Boris came with another simple and elegant solution: We can use Parameter in the Panorama view and highlight the number which was defined in the parameter. In this post I’ll explain how to implement this.
1. Create a new view using Panorama NovaView Desktop and make sure you see the grid in the view.
2. Define a new parameter: Click on View -> Paramaters, and click on the “Manage Parameters” button. Click on Add. The default type is Number and this is exactly what wee need (for now). In the name, type Highlight and in the Default Value type a number that you see in the grid (this is the number that will be highlighted later). Let’s take 0 for example. Click on OK twice and close the little Parameters window.
3. Create a new Exception: Click on Data -> Exceptions -> Exceptions… -> Add. Click on Next and then choose “Custom Exception”. Click on “Edit Exception” and there write the following formula: [Measures].CurrentMember = [[Highlight]]
This will simply select all the cells with the number that we defined earlier in the Highlight parameter. Click on OK and click Next. In this step, define the style of the highlighted cells. I picked red color and Bold font style. You can click on Finish now and then click OK. Open the small Parameters window (right click in the crosstab’s corner and choose Parameters) and click on “Apply Changes”. Now, you will see that all the cells with 0 are highlighted. If you don’t see it, check that you did all the steps correctly.
4. When we will show the view to the user, we don’t want to show him anything highlighed when the view is loaded. This is where a little trick takes place: open the small Parameters window (right click in the crosstab’s corner and choose Parameters), double click on the Highlight parameter. Choose String as the parameter type (on the right part) and in the Default value, enter abc. Click twice on OK and then on the apply button and you’ll see that now the highlighed cells are regular ones.
5. In the dashboards page, or in the web page you created using the Panorama SDK, create a button that will call the function searchGrid. Just add the button the property onclick=”searchGrid(’master’)”, where master is the applet’s name. this is the code of the searchGrid function:
function searchGrid (applet) {
var reply = prompt(’Please enter the number to search’,”);
eval(applet + ‘.CallUpdateParametersEx(”P|~|Highlight|~|’ + reply + ‘|~~|”)’);
}
Another tweaks I implemented and I didn’t write in this post in order to make it simple (for advanced developers only):
- You can search all the views in the current web/dashboard page. Just call the function for every applet, but make it in Batch mode.
- You can search all the grid even if the user doesn’t see all the rows. You can tell him if the number he searched for is in there or not.
That’s all. Test your new page and enjoy. For every question about this and anything else, you can leave a comment or write my mail.








