Knowledgebase
RadarCube ASP.NET Direct. Getting started
Posted by Ivan Pashkov on 24 April 2007 12:37 PM

This article applies to:

  • RadarCube ASP.NET Direct

Here's a short guide how to start a new ASP.NET web application using RadarCube ASP.NET Direct components.

Once you have installed the library you have at least two web controls in the Toolbox window of Visual Studio - TOLAPCube and TOLAPGrid.

TOLAPCube allows you to use all the functions of the multidimensional cube core, and TOLAPGrid to render the results on a web page. Place TOLAPCube component and then TOLAPGrid ("TOLAPGrid1") in the web form. For the TOLAPGrid component set the CubeID property to the ID of the newly placed TOLAPCube.

If your cube contains only a single fact table, not many related ones, the whole thing will be quite easy. Without any additional preparation you can start assigning DataSourceID property - just select menu item in the drop-down list of DataSourceID cube property. This will open the standard Visual Studio's "Data Source Configuration Wizard" dialog window, where you can specify any table, view or your custom query as a data source. In this case Visual Studio will automatically create a SqlDataSource object, and bind it to the cube. That's all. Now just set the cube's Active property to True, and here you are - you can run your project.

In most cases however, you will want your whole database with all of its tables to serve as a data source. To begin tuning the cube in this case you must provide it with a data source, which will most likely be your first step.

Preparing a Data Source

TOLAPCube component requires either DataSet object or a class name of a typed dataset as a data source. If you provide the cube with a dataset type, not with an object, a dataset object will be created automatically so you don't need to create it yourself.

First of all create a typed dataset in your Visual Studio project, and name it as you like. The picture below shows one named "Northwind.xs".

After that you'll get the dataset constructor, where you can define the data schema for your cube. In the "Server Explorer" window create your database connection (or use the existing one), and then move the tables (views) from within that connection to the dataset's working space.

Note1: Only the tables you need in your cube should be defined that way.

Note2: When you move the tables into your data schema make sure they are related to each other. If not, you’ll have to create relations manually (see the picture below), otherwise your cube will not be able to process your data schema.

When everything is done, your final data schema should look like this:

Note that in the picture above "Order Details" is a fact table, while other tables are dimension tables.

Now you're ready to construct the cube with the "Cube Editor".

Constructing the Cube

To get down to constructing the cube you have to specify its DataSourceID property. To see how it should be done select in your project your example dataset named "Northwind", from the drop down list:

Now click the hyperlink at the bottom of the Property Editor or double click the TOLAPCube1 component in the form - the "Cube Editor" window will show up displaying the data schema of your dataset:

Now you have to define measures and dimensions for your cube. To do so, select the field which stores the measure values and move it to the "Measures" item on the left pane. On the picture above we choose the "Order Details"."Quantity" field to be a measure field. In the same way you can define dimension fields. For more information on constructing a cube see "Using Cube Editor to Construct a Cube".

After you have defined all the measures and dimensions you need in your cube, the only thing left to do is setting the TOLAPCube1.Active property to True. You can do it either in design time, or in run time. In run time the best place for this code would be the Page_Load event handler of your application:

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
TOLAPCube1.Active = true;
...


}
}

Note that you only need to activate the cube on the first page request and ignore postbacks, so you have to check the page's IsPostBack property like in the example above.

(1185 vote(s))
This article was helpful
This article was not helpful

Help Desk Software by Kayako Resolve