Dundas BI Viewer Integration Sample


1. Overview

This article shows how to build and run the Dundas BI Viewer Integration Sample (for Visual Studio 2013 or above). The sample demonstrates how to integrate the viewer into an existing application. This sample makes use of a POST /LogOn/Token/ call in the Dundas BI REST API.

The sample demonstrates how to use an iframe to embed the viewer. The sample demonstrates how to use an embedded viewer. This sample demonstrates how to use an integrated viewer. This sample demonstrates how to insert an integrated viewer.

In version 4 and above, the Dundas BI embed library can streamline many of the steps in this sample. We recommend using the Dundas BI embed library rather than dealing with the iframe tag directly. For more information about using the Dundas BI embed library, click here.

2. Download

To download the Viewer Integration Sample solution click here.

3. Setup

3.1. Prerequisites

The following prerequisites must be installed on your computer:

  • Visual Studio 2013, or higher.
  • Microsoft .NET Framework 4.5
  • IIS web server running ASP.NET 2.0 or greater
  • Dundas BI Server

3.2. Add a local user account

In order for the sample to work, it needs to log in to your Dundas BI server via a specific local user account that has privileges to view dashboards. The sample code is actually hard-coded with an expected local user name and password. You can change these credentials in the code (as will be shown later), or log in to Dundas BI as an administrator and create the expected local user account as follows:

  • Username: viewer
  • Password: 1234
  • Seat Type: Standard user with option "Is seat reserved" selected.

See the article on Add an Account for more details.

3.3. Obtain the ID of a dashboard for viewing

To obtain a dashboard ID do the following:

  1. Login to your Dundas BI Server, and click on the Admin button.
    Dundas BI Admin button
    Dundas BI Admin button
  2. Find the dashboard that you wish to use, right click, then select properties.
    Dashboard Properties
    Dashboard Properties
  3. Find the ID in the Properties Panel.
    Getting Dashboard ID
    Getting Dashboard ID

3.4. Sample solution

Attached to this article is the DundasBIViewerIntegrationSamples.zip. Download this file, and extract to a directory of your choosing. In this directory, find the file named DundasBIViewerIntegrationSamples.sln and double-click.

Make sure the user account has the appropriate permissions to access this folder.

Within Visual Studio, you can see that the solution consists of one project:

  • NetViewerIntegrationSample

Viewer Integration Sample Solution
Viewer Integration Sample Solution

3.5. Update Constants.cs

In the NetViewerIntegrationSample project, edit the Constants.cs file. There are five constants which may need to be updated:

  • DundasBIServerUri - The URI of the Dundas BI server.
  • DundasBIViewerUsername - The username to use when logging in to Dundas BI (e.g. viewer).
  • DundasBIViewerPassword - The password corresponding to the username (e.g. 1234).
  • DundasBIDashboardId - The ID of the default dashboard to show (e.g. 7bcebd59-d425-4f29-9ea4-73033d50d515).
  • ViewOptions - The view options are listed below:
    • none
    • viewonly
    • menuonly
    • menutoolbar
    • menutoolbartaskbar


4. Publish and Test Sample

You can now build and publish the NetViewerIntegrationSample project to your IIS server. For example, you may want to publish it to the default web site under a web application name such as: NetViewerIntegrationSample.

After publishing, test the sample by opening a new browser window and navigating to the URL for the sample. For example:


5. Notes

6. 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: 7am-6pm, ET, Mon-Fri