A Simple OLAP Application

To create the simplest OLAP for LightSwitch application, start by creating a new LightSwitch application, and then add a data source and  an OLAP Screen.

Create an OLAP for LightSwitch project

To create a new OLAP for LightSwitch project, complete the following steps:

  1. In Visual Studio, select File | New | Project.
  2. Under Installed Templates, select LightSwitch. The .NET Framework 4 must be selected in order to create a LightSwitch application.
  3. Choose LightSwitch Application for the preferred language, enter a name for the application, and click OK. Your LightSwitch project is created. Notice that it contains the Data Sources and Screens folders.
  4. In the Solution Explorer, right-click the project node and select Properties.
  5. In the Properties window, select the Extensions tab and make sure the Microsoft LightSwitch Extensions and OLAP for LightSwitch items are selected and have the Use in new projects fields selected.

Add a Data Source

To add an existing data source to the project, follow these steps:

  1. In the designer, click Attach to external data source. You can also right-click the Data Sources folder in the Solution Explorer and select Add Data Source.
  2. In the Attach Data Source Wizard, select Database and click Next.
  3. Choose Microsoft SQL Server and click Continue.
  4. Enter a server name, select the database name, and click OK.
  5. Select the Tables check box and click Finish

Add an OLAP Screen

  1. In the Designer, click the Screen button or right-click the Screens folder in the Solution Explorer and choose Add Screen. The Add New Screen window opens.
  2. Select OLAP Screen.
  3. Under Provide screen information, select a database table from the Screen Data drop-down list. The Screen Name is updated based on the data chosen. The C1OlapPage control is automatically added to the screen and bound to the selected data.

The screen template has a layout that is appropriate for a LightSwitch collection control. For this reason, there is a child element of type C1RowPlaceholder, which is analogous to a row template in an editable grid screen. Although the row placeholder is not visible at run time, it must be present at design time. The row placeholder also provides an interface for specifying which fields are to be shown to end users in the C1OlapPanel. For more information, see Excluding Fields from the View.

Run the application and you will see an interface similar to the one in Microsoft Excel.

In debug mode, you can click the Design Screen button to customize the page. If you select the C1OlapPage from the left-side menu at run time, you can customize various properties, including options specific to ComponentOne's product. Check the box labeled Show Raw Data to display an additional tab containing the underlying data to be analyzed. Check the Show Favorites checkbox to display the Add and Remove Favorites buttons and Favorites List. Click the Load View Definition link to load a view definition (*.olapx) file containing field settings and other options saved at run time using the C1OlapPage toolbar.

In release mode, the Design Screen button is not available. However, the Show Raw Data and Load View Definition elements are present in the main screen designer. For more information on view definition files, see Saving and Loading the View Definition.

The following sections describe the functionality provided by default, without writing any code.

 

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback