Using a view container


1. Overview

This article shows you how to use a view container component to embed another dashboard, report, or scorecard within your current view.

You can simply drag the view from the Explore panel, or you can add and set up a Container component.

Related video: Dashboard Components

2. Add a view container component

For this example, create a new dashboard (Dashboard1) using the Blank template. Add a chart (metric set) to the dashboard and resize the dashboard smaller so it just fits the chart. This small dashboard will be embedded into another dashboard using a view container.

A small dashboard for embedding
A small dashboard for embedding

Create a second dashboard (Dashboard2) also using the Blank template. Go to the toolbar, click Components, and then click Container. This will add an empty view container to the canvas.

Add an empty view container
Add an empty view container

Go to the Explore window and drag Dashboard1 onto the empty view container. Dashboard1 will be embedded within the view container.

Drag Dashboard1 to the view container
Drag Dashboard1 to the view container

Switch to View mode and right-click over the embedded dashboard/chart. You'll see a context menu with a limited set of options such as Drill Down, Drill Up, Change Level, and Re-Visualize. Note that other context menu options that you normally see such as Annotate, Share, Edit, and Data Binding Panel are not applicable for an embedded view and will not appear.

Right-click menu for an embedded dashboard
Right-click menu for an embedded dashboard

3. Drag a view onto the canvas

Instead of adding an empty view container to the canvas first, you can simply drag a view (dashboard, report, or scorecard) from the Explore window directly to the canvas. A view container will be created automatically and used to contain the dragged view.

For example, drag a scorecard from Explore to the canvas.

Drag scorecard directly to canvas
Drag scorecard directly to canvas

Go to Properties and you'll see that the view container has been created automatically.

View container properties
View container properties

4. Sub-canvas view container

Unless you are using a view container originally created using Dundas BI 2.5 or older, most uses of dundas.context.* refer to the context of the top-level canvas instead of the embedded one. If you call this within an embedded canvas (i.e., inner or sub-canvas), the dashboard/report/scorecard of the top-level canvas will be returned, which is likely not what you want.

Certain features not directly related to a specific dashboard or view are safe to access using dundas.context, such as:

  • dundas.context.currentDialogShown
  • dundas.context.originalQueryString
  • dundas.context.currentProjectId
  • dundas.context.currentSession
  • dundas.context.currentSessionId

Otherwise, references to dundas.context should be replaced with properties and methods of 'this'. For example: this.getService("BaseViewService").

For convenience, in most cases you can call this.baseViewService to get the BaseViewService, or this.parentView to get the Dashboard or other view (or simply this in one of the events of the dashboard or view, such as Ready).

In Dundas BI version 2.5 or earlier, view containers were based on IFrames, but new view containers created afterward do not use IFrames anymore. You can check which kind of view container you have by going to its Properties:

  • If the Name of the view container is viewContainer1 or similar, you are likely using the old IFrame-based view container.
  • If the Name of the view container is subCanvasViewContainer1, you are using the new IFrame-less or 'sub-canvas' view container.

5. See also

Dundas Data Visualization, Inc.
500-250 Ferrand Drive
Toronto, ON, Canada
M3C 3G8

North America: 1.800.463.1492
International: 1.416.467.5100

Dundas Support Hours:
Phone: 9am-6pm, ET, Mon-Fri
Email: 7am-6pm, ET, Mon-Fri