Getting started with the .NET API

Contents[Hide]

1. Overview

The goal of this support article is to explain the necessary steps 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
  • Dundas BI Application Data folder
  • Dundas BI Admin privileges

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. Build the Engine

  • Referring to the Dundas .NET API Documentation we can see how to start up the Dundas BI Engine
  • Here is some sample code to get you started:
    EngineManager.CreateEngine(
    	// Connection string for the application database. Type: System.String
    	appDbConnectionString,
    	// Path to the application's data folder. Type: System.String
    	appDataPath,
    	// Used to uniquely identify the engine instance. Type: System.String
    	hostIdentifier, 
    	// The caller context service, or null. Type: Dundas.BI.Services.CallerContextService
    	callerContextService
    );
    
    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 sessions for the logon to succeed. Type: System.Boolean
    	deleteOtherSessions, 
    	// Culture to associate with the session, or null. Type: System.Globalization.CultureInfo
    	explicitCulture 
    );
    
    Engine.Current.GetService<ICallerContextService>().CurrentContext.SetCurrentSessionId(
    	logOnResult.Session.Id
    );
    
    
  • You can now start using the .NET Dundas BI Engine

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