Selecting different views within a report using the OLAP metadata hierarchy

View information, in a single report, from all the database aliases, cubes and dimensions to which you have access.

This example uses the Best Practices sample database supplied with Application Studio (Connecting to the sample database). It lets you get values from any database alias and cube to which you have access, in a single report.

  1. Create a report with combo boxes in cells B3, B5, and B7. From these, users will select the combination of database alias, cube and dimension to view.
  2. Drag the OLAP Server Metadata hierarchy from the Accessories pane onto each combo box.
    At this stage, the contents of each combo box are the same. We will now define the contents of each combo box and make each dependent on the others.
  3. Name the first combo box Alias, the second Cube and the third, Dimension.
  4. Select the Alias combo box. In the List Designer open Structure Selection and select Best Practices Templates in the Children of list. Save the changes to the list.
  5. Select the Cube combo box. In Structure Selection select <Edit Formula> from the Children of list. The Edit Custom MDX dialog box is displayed. Click Variables. Double-click Alias in the ListViews list.
    This alias is displayed in the pane at the right: =ReportObjects.Alias.text
  6. Select the Dimension combo box. Make it dependent on the Cube combo box by selecting Cube from the ListViews list in the Edit Custom MDX dialog. See previous step.
  7. Now, the first combo box contains only the database alias Best Practices Templates. The second contains the cubes. The third contains the dimensions of the cube selected in the Cube combo box.
  8. Create a hyperblock in cell B9 of the report by dragging a dimension from the Sales cube into the report.
    We will use the hyperblock to display the elements from whichever combination of database alias, cube and dimension is selected in the combo boxes. So, we need to make the hyperblock dependent on the combo boxes.
  9. Select the hyperblock and open the Advanced pane in the List Designer. Here, under General, the Alias is Best Practices Templates. Change this to the name of the first combo box. To do this, click Best Practices Templates to make it editable. Then specify =Alias.attribute.
  10. In the same way, change the cube name so that it refers to the attribute of the Cube combo box. Replace Sales with =cube.attribute.
  11. Now replace both the dimension and hierarchy with references to the attribute of the Dimension combo box (=dimension.attribute).
  12. In View Mode, select Best Practices Templates from the first combo box and Sales from the second. Select any dimension from the third combo box to see its content displayed in the report.