416.467.9100 | Dundas Data Visualization | Login
Welcome Guest
Dashboard v5.0

This site makes extensive use of JavaScript.

Please enable JavaScript in your web browser and reload the page before proceeding.

Using the Viewer Integration Sample

Hide navigation
RSS
Modified on Wed, 05 Mar 2014 06:06 PM Categorized as Troubleshooting, Viewer
Click to return to: Documentation | Using the Dashboard Viewer in Your Applications


Overview

This article shows how to build and run the Viewer Integration Sample (for Visual Studio 2010) which is included when you install Dundas Dashboard. The sample demonstrates two ways to integrate the viewer:


Setup

Prerequisites

The following prerequisites must be installed on your computer:


Add a local user account

In order for the sample to work, it needs to log in to your Dundas Dashboard 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 Dashboard as an administrator and create the expected local user account as follows:

  • Username: viewer
  • Password: 1234
  • Role: Viewer with option “Reserve a viewer license for this user” selected.

See the article on Managing Users for more details.

Obtain the GUID of a dashboard for viewing

The sample essentially loads an existing dashboard into the Silverlight/ASP.NET sample app. The code is hard-coded with an example dashboard GUID which you must replace (as will be shown later).

For now, simply log in and obtain the GUID of any existing dashboard on your Dundas Dashboard server. Save the GUID value in Notepad for later use.

See the example from this article which shows how to obtain the GUID of the Sonatica Executive dashboard (e.g. 7bcebd59-d425-4f29-9ea4-73033d50d515).

Sample location

The viewer integration sample is located in the following folder on your Dundas Dashboard server by default:

  • C:\Program Files\Dundas Data Visualization Inc\Dundas Dashboard\{InstanceName}\SDK\samples\ViewerIntegrationSample

Folder location of the viewer integration sample.

Folder location of the viewer integration sample.


Sample solution and projects

Go to the folder location of the viewer integration sample and double-click on the Visual Studio 2010 solution file: IntegrationSamples.sln.

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

Within Visual Studio, you can see that the solution consists of two projects:

  • ViewerIntegration.Web
  • ViewerIntegrationSilverlightApp

Make sure that you set ViewerIntegration.Web as the StartUp Project.

Visual Studio 2010 solution and projects.

Visual Studio 2010 solution and projects.


Update Constants.cs

In the ViewerIntegration.Web project, edit the Constants.cs file. There are four constants which may need to be updated:

  • DashboardServerUri - The URI of the Dundas Dashboard server. Should already be set by the installation.
  • DashboardViewerUsername - The username to use when logging in to Dundas Dashboard (e.g. viewer).
  • DashboardViewerPassword - The password corresponding to the username (e.g. 1234).
  • SampleDashboardId - The ID of the default dashboard to show (e.g. 7bcebd59-d425-4f29-9ea4-73033d50d515).

Tip: If you followed all of the previous steps, you should only have to replace the SampleDashboardId with the GUID value which you obtained earlier.

Updating the Constants.cs file.

Updating the Constants.cs file.


Cross-domain security

The sample needs to be properly configured for cross-domain access. For detailed information on why this is required, see here: http://msdn.microsoft.com/en-us/library/cc645032%28VS.95%29.aspx.

If you are not concerned about cross-domain security (e.g. if you are only evaluating) you can use the cross-domain policy file provided with this sample, as follows:

  1. Locate the folder on your hard drive which corresponds with the ROOT of the web server where the Dundas Dashbard server is running. For example, if the Dundas Dashboard server is accessible from http://mycomputer.example.com/DundasDashboard/, find the folder that corresponds to http://mycomputer.example.com/.
  2. Copy the clientaccesspolicy.xml file, which is located in the ViewerIntegrationSample folder, into the folder you located in step 1.
  3. Verify that the file is accessible by trying to load it in your web browser. For example, try browsing to http://mycomputer.example.com/clientaccesspolicy.xml.

Publish and test the sample

You can now build and publish the ViewerIntegration.Web 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: ViewerIntegrationSample.

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

http://dashsvr/ViewerIntegrationSample/Default.aspx

Start page for the viewer integration sample.

Start page for the viewer integration sample.


Silverlight integration sample. Click to enlarge.

Silverlight integration sample. Click to enlarge.


ASP.NET integration sample. Click to enlarge.

ASP.NET integration sample. Click to enlarge.


Troubleshooting

Q: When I try to run the ViewerInWebPageSample.aspx page, I don't see anything in the lower part of the page. Shouldn't there be a dashboard there? There don't seem to be any JavaScript errors to indicate what might be the problem.

A: On some systems Silverlight will refuse to load its application if it comes from a different web server running on localhost. You can solve this problem by debugging the sample using IIS instead of the Visual Studio ASP.NET Development Web Server.

To switch to using IIS, follow the steps outlined here.

Related topics


Click to return to: Documentation | Using the Dashboard Viewer in Your Applications

About Dundas | Contact Us Follow us on Twitter! | Privacy Statement | Report Site Issues

Copyright © 2009-2014 Dundas Data Visualization, Inc.