Getting started with the .NET API

Contents[Hide]

1. Overview

This article demonstrates how to use the Dundas BI .NET API in a new or existing Visual Studio project.

2. Prerequisites

  • Microsoft Visual Studio Microsoft .NET Framework 4.5
  • You must be a member of the System Administrators group in Dundas BI

3. Setup

  1. Open a new or existing Visual Studio project
  2. In the Solution Explorer, right click on References and Add Reference
  3. Select Browse on the Reference Manager
  4. Locate the Dundas BI sdk bin folder here:
    \Program Files\Dundas Data Visualization Inc\Dundas BI\Instances\[instance name]\sdk\bin
  5. Select all three files found here and Add them to the Reference folder

Files required to use the .NET API
Files required to use the .NET API

4. Start the engine

We can start up the Dundas BI Engine using the .NET API as demonstrated with the sample code below.

The AppDataPath property must be set to the path to the App_Data folder of the Dundas BI web application. The article List of installed folders provides more details.

// Create the CreateEngineOptions object.
CreateEngineOptions createEngineOptions = new CreateEngineOptions();
// Path to the application's data folder. Type: System.String
createEngineOptions.AppDataPath = appDataPath;

EngineManager.CreateEngine(createEngineOptions);

EngineManager.StartEngine();

Engine.Current.GetService<ICallerContextService>().CreateAndSetCurrentContext(null);

LogOnResult logOnResult = Engine.Current.GetService<ILogOnService>().LogOn(
	// The account name. Type: System.String
	accountName, 
	// The password. Type: System.String
	password, 
	// Delete other logon sessions for the logon to succeed. Type: System.Boolean
	deleteOtherSessions, 
	// Culture to associate with the logon session, or null. Type: System.Globalization.CultureInfo
	explicitCulture 
);

Engine.Current.GetService<ICallerContextService>().CurrentContext.SetCurrentSessionId(
	logOnResult.Session.Id
);

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