Using a view container
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.
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.
Go to the Explore window and drag Dashboard1 onto the empty view container. Dashboard1 will be embedded within 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.
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.
Go to Properties and you'll see that the view container has been created automatically.
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:
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.