logo
small logo
  • Products
  • Buy
  • Support
  • Articles
  • Customer panel Support
    • en
    • pt
    • es
    • de
    • pl
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • How to make a simple FastCube .NET cube editor
  • How to use FastCube .NET in ASP .NET Core application

    May 6, 2021

    1. About FastCube Report generator FastReport .NET covers nearly all requirements of users in report making.

    read more
  • FastCube - High-Speed OLAP Cube Engine and Pivot Grid

    February 29, 2020

    It is difficult to imagine data analysis without OLAP (On-Line Analytical Processing) technology. Although there

    read more
  • Connect datasource to OLAP pivot cube (FastCube .NET)

    April 3, 2018

    FastCube .NET is powerful OLAP Engine which adds Business Intelligence to your application. Let's look

    read more
  • How to use FastCube .NET in the SPA application Knockout.js

    July 21, 2021

    To output the data cube, we will create a SPA application by means of Knockout.js

    read more
  • How to use FastCube .NET in Vue SPA application

    April 14, 2021

    The Vue.js framework is currently very popular and stands in line with Angular. We have

    read more

How to make a simple FastCube .NET cube editor

April 3, 2018

To view and edit cubes and slices from FastCube .NET, you need a special application that you need first create. Since FastCube .NET comes in the form of a library and components, we can easily embed the cubes editor into your existing WinForms application, or create a separate one, specially for it.

In this article, we'll look at the way how to create a simple cubes and slices editor in two ways: using controls or from program code.

1)      The first way - visual controls

Create a Windows Form Application.

We add a tabControl component with three tabs: Slice, Cube and Chart.

As you could already guess, on the first tab we will display the slice of the OLAP cube, on the second one - the data from the cube, on the third - the diagram on the slice.

It is necessary to connect libraries to the project: FastReport.Olap and FastReport.Bars.

In the Toolbox, we have a set of controls for the FastCube:

 

Drag the Cube control to our form. We have 4 types of data source for the cube in the DataSource property:

DataSource - data from the database;

File - data from the cube file;

Stream - data from the stream;

Manual - manual filling.

In our example, we use the cube file containing the data (File Type).

You can download the cube file from the application code. For example, in the OnLoad event:

cube1.Load("C:/Program Files (x86)/FastReports/FastCube.Net Professional/Demos/Data/Cubes/2_0_sample_en1.mdc");

Now add the Slice component to the form. In its properties we only need to choose a cube:

 

Now, you need to display the cube and slice. On the Slice tab, place the SliceGrid control.

All we need is to set the Slice property for it. Choose the value of slice1.

Add the CubeGrid control to the Cube tab. In its Cube property choose cube1.

 

On the third tab - Chart - we add the Chart control:

In the properties of the added control, find Slice and select the value of slice1.

If we run the application right now, we'll see the loaded cube, the slice and the diagram, but we will not be able to load another cube, or save the changes in the current one. You need to add toolbars for each component: SliceGrid, CubeGrid, and Chart.

To do this, drag the following components onto the form from the toolbox: SliceGridToolbar, CubeGridToolbar, ChartToolbar.

The components will appear below the form:

In the chartToolbar properties, find Chart and select the value chart1.

For cubeGridToolbar, set the Grid property to cubeGrid1.

In the sliceGridToolbar properties for the Grid field select sliceGrid1.

Now we need to bind these toolbars to the corresponding tabs. Add three lines of code to the load event of the OnLoad form:

sliceGridToolbar1.Parent = tabPage1;

cubeGridToolbar1.Parent = tabPage2;

chartToolbar1.Parent = tabPage3;

Now let’s run the application:

SliceGridToolbar is located at the top. A slice is a sample of data from a cube for specified dimensions and measures.

Here all the data from the cube are displayed.

The graph is based on the data from the slice. There is also a toolbar.

 2)      The second way is in the code of the program

 All that we added to the form with the mouse, you can manually write in the application code.

In the reference, add the following libraries: FastReport.Olap, FastReport.Bars, System.Windows.Forms.DataVisualization;

On the form, add a TabControl control with three tabs. Open the form code.

In the using section, we need libraries:

1
2
3
4
using System;
using System.Windows.Forms;
using FastReport.Olap.Controls;
using FastReport.Olap.Chart;

 We place all the code for creating and configuring components, for example, in the class constructor:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
public Form1()
 {
 InitializeComponent();
 
 
 FastReport.Olap.Cube.Cube cube = new FastReport.Olap.Cube.Cube();
 FastReport.Olap.Slice.Slice slice1 = new FastReport.Olap.Slice.Slice();
 slice1.Cube = cube;
 
 
 SliceGrid sliceGrid = new SliceGrid();
 sliceGrid.Dock = DockStyle.Fill;
 sliceGrid.Parent = tabPage1;
 sliceGrid.Slice = slice1;
 
 
 SliceGridToolbar sliceGridToolbar = new SliceGridToolbar();
 sliceGridToolbar.Dock = DockStyle.Top;
 sliceGridToolbar.Parent = tabPage1;
 sliceGridToolbar.Grid = sliceGrid;
 
 
 CubeGrid cubeGrid = new CubeGrid();
 cubeGrid.Dock = DockStyle.Fill;
 cubeGrid.Parent = tabPage2;
 cubeGrid.Cube = cube;
 
 
 CubeGridToolbar cubeGridToolbar = new CubeGridToolbar();
 cubeGridToolbar.Dock = DockStyle.Top;
 cubeGridToolbar.Parent = tabPage2;
 cubeGridToolbar.Grid = cubeGrid;
 
 
 Chart chart = new Chart();
 chart.Dock = DockStyle.Fill;
 chart.Parent = tabPage3;
 chart.Slice = slice1;
 
 
 ChartToolbar chartToolbar = new ChartToolbar();
 chartToolbar.Dock = DockStyle.Top;
 chartToolbar.Parent = tabPage3;
 chartToolbar.Chart = chart;
 
 
 cube.Load("J:\\Program Files (x86)\\FastReports\\FastCube.Net Professional\\Demos\\Data\\Cubes\\2_0_sample_en1.mdc");
 }

 That's all. The application is ready. Drag and drop controls with the mouse, or create them in the code –  you choice.

about product download buy
avatar
Dmitriy Fedyashov
Technical Writer
Fast Reports Team: Dmitriy Fedyashov - Technical Writer at Fast Reports
.NET FastCube

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Buy
  • Download
  • Documentation
  • Testimonials
  • How to uninstall
  • Ticket system
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Contact us

© 1998-2022 by Fast Reports Inc.

  • Privacy Policy