Flexmonster Accelerator can be integrated into your website back end as a separate ASP.NET controller. The main benefits of referencing the Accelerator as a DLL directly from the ASP.NET project are:
If Flexmonster is not yet embedded, set up an empty component in your web page:
Complete the Quick start guide. Your code should look similar to the following example:
var pivot = new Flexmonster({
container: "pivotContainer",
toolbar: true
});
Complete the Integration with Angular guide. Your code should look similar to the following example:
<fm-pivot
[toolbar]="true">
</fm-pivot>
Complete the Integration with React guide. Your code should look similar to the following example:
<FlexmonsterReact.Pivot
toolbar={true}
/>
Complete the Integration with Vue guide. Your code should look similar to the following example:
<Pivot
ref="pivot"
toolbar>
</Pivot>
Choose one of the following options:
To integrate Flexmonster Accelerator into an existing project, follow these steps:
FlexmonsterConfig
class with information about the connection: ConnectionString
– a connection string for Microsoft Analysis Services. Example: Data Source=localhost;
.CacheManager.MemoryLimit
– the maximum memory size available for caching (in bytes).CacheManager.Enabled
– indicates whether the cache is enabled.Your code should look similar to the following: public class FlexmonsterConfig {In our project, this file is located in the
public static void Register() {
// Replace with actual data source
// Example: Data Source=localhost
Flexmonster.Accelerator.Controllers.FlexmonsterProxyController
.ConnectionString = "Data Source=localhost";
Flexmonster.Accelerator.Utils.CacheManager
.MemoryLimit = 10 * 1024 * 1024; // MB to bytes
Flexmonster.Accelerator.Utils.CacheManager.Enabled = true;
}
}
Flexmonster Accelerator MVC/App_Start/
folder. FlexmonsterConfig
inside the Application_Start
method of the Global.asax.cs
file: FlexmonsterConfig.Register();
AcceleratorController
class that extends FlexmonsterProxyController
. This class will handle the requests to the Accelerator: public class AcceleratorController :In our project, this file is located in the
Flexmonster.Accelerator.Controllers.FlexmonsterProxyController {
public override void OnRequest(BaseArgs args) {
base.OnRequest(args);
}
}
Flexmonster Accelerator MVC/Controllers/
folder.Now it’s time to configure the client – Flexmonster Pivot Table and Charts. Let’s create a minimal configuration using the JavaScript API (replace proxyUrl
, catalog
and cube
parameters with your specific values):
var pivot = new Flexmonster({
container: "pivotContainer",
toolbar: true,
report: {
dataSource: {
type: "microsoft analysis services",
/* URL to Flexmonster Accelerator */
proxyUrl: "http://localhost:50005",
/* Catalog name */
catalog: "Adventure Works DW Standard Edition",
/* Cube name */
cube: "Adventure Works",
// Flag to use the Accelerator instead of XMLA protocol binary
binary: true
}
}
});
var pivot = new Flexmonster({
container: "pivotContainer",
toolbar: true,
report: {
dataSource: {
type: "microsoft analysis services",
/* URL to Flexmonster Accelerator */
proxyUrl: "http://localhost:50005",
/* Database name */
catalog: "Adventure Works DW Standard Edition",
/* Model name */
cube: "Adventure Works",
// Flag to use the Accelerator instead of XMLA protocol binary
binary: true
}
}
});
Launch the web page from a browser — there you go! A pivot table is embedded into your project.
You may be interested in the following articles: