Complete the following steps to add data to Data Engine using SSAS service:
Step1: Create a new WebAPI application
- In Visual Studio, select File | New | Project to create a new Web API Service Project.
- Under installed templates, select C1 | Visual C# | Web | C1 Web API Application to create a new C1 Web API Service application.
- Set a Name and Location for your application, and then Click OK.
- In the ComponentOne ASP.NET Web API Application Wizard, select Data engine services option.
- Once you have selected the Services from the wizard, click OK to create a new C1 Web API Service application. In this new project, ComponentOne template adds the references C1.Web.Api.dll, C1.DataEngine.dll, and C1.WebApi.DataEngine.dll.
Configure Startup.cs file
- From the Solution Explorer, select and open Startup.cs file. Here we are setting up the SSAS service URL to access the cube data.
- In the Startup.cs file, add the following code inside the Startup class. In this step we are configuring the SSAS service URL for the application.
The following table describes the SSAS connection string.
Property |
Description |
Example |
Data Source |
Specifies the server instance. This property is required for all connections. Valid values include the network name or IP address of the server, local or localhost for local connections, or the name of a local cube (.cub) file. |
Data source=AW-SRV01.corp.Adventure-Works.com |
Initial Catalog or Catalog |
Specifies the name of the Analysis Services database to connect to. The database must be deployed on Analysis Services, and you must have permission to connect to it. |
Initial catalog=AdventureWorks2016 |
Provider |
Valid values include MSOLAP.<version>, where <version> is either 4, 5, 6 or 7. |
Provider=MSOLAP.7 is used for connections that require the SQL Server 2016 |
Startup.cs |
Copy Code
|
public class Startup
{
private readonly HttpConfiguration config = GlobalConfiguration.Configuration;
public void Configuration(IAppBuilder app)
{
app.UseDataEngineProviders()
.AddCube("cube", @"Data Source=http://ssrs.componentone.com/OLAP/msmdpump.dll;Provider=msolap;Initial Catalog=AdventureWorksDW2012Multidimensional", "Adventure Works");
// CORS supports
app.UseCors(CorsOptions.AllowAll);
// Web Api
RegisterRoutes(config);
app.UseWebApi(config);
}
|
Step 3: Build and Run the Project
- Click Build | Build Solution to build the project.
- Press F5 to run the project.
Back to Top