- 4 Minutes to read
- Print
- DarkLight
- PDF
Technical guide Stimulsoft
- 4 Minutes to read
- Print
- DarkLight
- PDF
Stimulsoft implementation technical guide
Introduction
This document explains the technical elements required to integrate and adapt Stimulsoft to create Dashboards in Xperience.
Integrate Stimulsoft
This is the link to integrate Stimulsoft in Xperience: Stimulsoft programme manual
Integrate Stimulsoft in Xperience
Add the NuGet Stimulsoft.Reports.Web
Implement Designer (HTML5 Designer) (~\WebApplication\Features\Analytics\DashboardDesigner\)
The controller DashboardDesignerController
This Controller contains all methods called by the Stimulsoft designer and the activation by the licence key.
The view Index.cshtml
The view (associated with the Index action) in which the designer will be rendered with the use of the line:
@Html.Stimulsoft().StiMvcDesigner(Model.Options)
The model Index.cs
The model that will be used in the view Index.cshtml with a property Options containing:
All Stimulsoft Designer page construction options,
The mapping of Actions called by Stimulsoft code:
Actions = new StiMvcDesignerOptions.ActionOptions
{
GetReport = nameof(DashboardDesignerController.Get),
SaveReport = nameof(DashboardDesignerController.Save),
DesignerEvent = nameof(DashboardDesignerController.DesignerEvent),
OpenReport = nameof(DashboardDesignerController.Import),
},
Setup of the Viewer (HTML5 Viewer) (~\WebApplication\Features\Analytics\DashboardViewer\)
The controller DashboardViewerController
The Controller containing all methods called by the Stimulsoft Viewer and the activation by the licence key.
The view Index.cshtml
The view (associated with the Index action) in which the Viewer will be rendered by using the line:
@Html.Stimulsoft().StiMvcViewer(Model.Options)
The model Index.cs
The model that will be used in the view Index.cshtml with an Options property containing:
All Stimulsoft Viewer page construction options,
The mapping of Actions called by the code Stimulsoft:
Actions = new StiMvcViewerOptions.ActionOptions
{
DesignReport = nameof(DashboardViewerController.Design),
GetReport = nameof(DashboardViewerController.Get),
ViewerEvent = nameof(DashboardViewerController.ViewerEvent),
},
Data Adapter
Stimulsoft is not designed to create Dashboards using cubes. For this we use a Custom Data Adapter. Consult this example of using a Custom Data Adapter for PostgreSQL published by Stimulsoft.
https://www.stimulsoft.com/en/samples/reports-net/net-framework/using-a-custom-data-adapter
To integrate a custom Data Adapter for cubes, create 3 classes as in the example here: ~\WebApplication\Features\Analytics\DataSource\Stimulsoft\
StiCubeDataAdapterService
Used pour retrieve les data d’une DataSource à partir des filtres mis dans les components ainsi que les dimensions demandées.
The method ConnectDataSourceToData
This method is called for each data source if it is est used in a component (Viewer and Designer).
Each time the method is called, it creates a CubeInfoModel from filters and page component dimensions then executes a request on the cube associated with the Data Source that converts the data to the DataTable and completes the DataTable property of the StiDataSource object.
The basic class is StiCubeSource.
In the designer page, the results for a data source are limited to 1000 lines.
The method GetColumnsFromData
Called from the designer page when editing a data source to retrieve the list of data source columns.
StiCubeDatabase
Converts cubes into a schema understandable by Stimulsoft and instancier and ajouter les data sources.
The method GetDatabaseInformation
Returns the converted cube schema to the DataTables. It is called on retrieving all available cubes with columns.
The method ApplyDatabaseInformation
Called after the selection of cubes to add as data sources. Enables the creation of data sources from selected cubes.
The method RegData
Called when editing a data source on retrieving columns. This method adds a StiData (DataTable cube) in the DataStore for internal Stimulsoft code calls the method GetColumnsFromData from the object StiCubeDataAdapterService.
To counter performance issues, the list of columns returned for a data source are the properties without joins and the external join key with other created cubes. Other join properties with tables are not taken into account. You can add the property in the data source edit view.
StiCubeSource
The Data Source objects that represents a cube. Each DataSource has a unique key with the format ( $"{cubeMetaId}{StimulsoftExtensions.KeySepartor}{Guid.NewGuid()}" ).
In the designer, add StiOptions, StiCubeDatabase and StiCubeDataAdapterService in the constructor of the DashboardDesignerController.
In the viewer, only add StiCubeDataAdapterService in the constructor of the DashboardViewerController if this does not exist.
Limitations
Several improvements have been made to boost the performance of the Dashboards and data integrity:
Do not display the list of cubes as a data source on opening the designer and leave the administrator to add the cubes and columns they need. This enables a more fluid display of the designer page.
In the popup there is a new data source. Cubes are displayed but without the total list of columns for each cube, only the cube columns and external join keys with other cubes are displayed. The other joint columns are not displayed given the volume of the list which causes a performance issue when retrieving the list of cubes: https://dev.azure.com/syfadis/Syfadis%20Experience/_workitems/edit/48635.
Tables can be problematic for Dashboard display performance if you want to display data with several columns for a large database.
Functions
Stimulsoft functions enable you to add additional processing on data returned by the cubes.
Add a function in Stimulsoft
Add a static method in the static class such as the class and method with the attribute StiDescription.
The class attribute defines the function group. This is a folder that will be created in Stimulsoft when there is only one function in a group.
In a class you can add one or more functions of the same group.
Add the type of class in the list “functionGroupTypes” in the file StiCustomFunctionsHelper.cs.
Example: