ActiveAnalysis helps you create a dashboard to represent your data. You can use the PivotView control to customize the look and feel of your data as per your requirement.
You will perform these procedures to implement the walkthrough:
- To add PivotView controls to a Web form
- To add data sources and load layouts (*.analysis files) into PivotView controls
- To hide cards, schema, and toolbars
This walkthrough requires the sample files that are installed with ActiveAnalysis on a default path like C:\Users\Public\Documents\GrapeCity\ActiveAnalysis\Layouts.
When you complete this walkthrough, you will have a dashboard that looks like this:
To add PivotView controls to a Web form
If you have not added the ActiveAnalysis controls to your toolbox, see Add Controls to Your Toolbox.
- In Visual Studio, go to the Design view of your Web form.
- In the ToolBox, expand the HTML tab and drag the HTML Table onto your Web form. This allows you to place your PivotView controls side-by-side.
- From the ToolBox, drag the PivotView control into the first cell of the table. PivotView1 is created.
- Drag another PivotView control into the second cell of the table. PivotView2 is created.
- Select and delete the unused cells from the table.
- Select PivotView1 in the Properties grid and change the following properties:
- Height 500px
- Width 450px
- Select PivotView2 in the Properties grid and change the same properties:
- Height 500px
- Width 450px
To add data sources and load layouts into the controls
- Drag the LocalCubeDataSource control from the toolbox onto the form below the table. LocalCubeDataSource1 is created.
- Drag another LocalCubeDataSource control onto the form below the table. LocalCubeDataSource2 is created.
- Right-click the Web form and select View Code.
- In the Page Load event stub, enter the following code:
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Page Load event. Copy Code
LocalCubeDataSource1.LocalCubeFile = "C:\Users\Public\Documents\GrapeCity\ActiveAnalysis\DataSources\Stocks\Stocks.ddacube" PivotView1.DataSourceID = "LocalCubeDataSource1" Dim myLayoutFile As New System.IO.FileInfo("C:\Users\Public\Documents\GrapeCity\ActiveAnalysis\Layouts\Stocks\AveragePriceBySector&Year 2.analysis") PivotView1.Read(myLayoutFile, GrapeCity.ActiveAnalysis.PersistSettings.Layout) LocalCubeDataSource2.LocalCubeFile = "C:\Users\Public\Documents\GrapeCity\ActiveAnalysis\DataSources\Stocks\Stocks.ddacube" PivotView2.DataSourceID = "LocalCubeDataSource2" Dim myOtherLayoutFile As New System.IO.FileInfo("C:\Users\Public\Documents\GrapeCity\ActiveAnalysis\Layouts\Stocks\Turnover by Sector & Date.analysis") PivotView2.Read(myOtherLayoutFile, GrapeCity.ActiveAnalysis.PersistSettings.Layout)
C# code. Paste INSIDE the Page Load event. Copy Code
LocalCubeDataSource1.LocalCubeFile = "C:\\Users\\Public\\Documents\\GrapeCity\\ActiveAnalysis\\DataSources\\Stocks\\Stocks.ddacube"; PivotView1.DataSourceID = "LocalCubeDataSource1"; System.IO.FileInfo myLayoutFile = new System.IO.FileInfo("C:\\Users\\Public\\Documents\\GrapeCity\\ActiveAnalysis\\Layouts\\Stocks\\AveragePriceBySector&Year 2.analysis"); PivotView1.Read(myLayoutFile, GrapeCity.ActiveAnalysis.PersistSettings.Layout); LocalCubeDataSource2.LocalCubeFile = "C:\\Users\\Public\\Documents\\GrapeCity\\ActiveAnalysis\\DataSources\\Stocks\\Stocks.ddacube"; PivotView2.DataSourceID = "LocalCubeDataSource2"; System.IO.FileInfo myOtherLayoutFile = new System.IO.FileInfo("C:\\Users\\Public\\Documents\\GrapeCity\\ActiveAnalysis\\Layouts\\Stocks\\Turnover by Sector & Date.analysis"); PivotView2.Read(myOtherLayoutFile, GrapeCity.ActiveAnalysis.PersistSettings.Layout);
To hide cards, schema, and toolbars
- Right-click the Web form and select View Code.
- In the Page Load event below the previous code, enter code like the following.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Page Load event. Copy Code
PivotView1.AppearanceSettings.SchemaVisible = False PivotView1.AppearanceSettings.ToolbarVisible = False PivotView1.CardLayout.DisplayPanels = False PivotView2.AppearanceSettings.SchemaVisible = False PivotView2.AppearanceSettings.ToolbarVisible = False PivotView2.CardLayout.DisplayPanels = False
C# code. Paste INSIDE the Page Load event. Copy Code
PivotView1.AppearanceSettings.SchemaVisible = false; PivotView1.AppearanceSettings.ToolbarVisible = false; PivotView1.CardLayout.DisplayPanels = false; PivotView2.AppearanceSettings.SchemaVisible = false; PivotView2.AppearanceSettings.ToolbarVisible = false; PivotView2.CardLayout.DisplayPanels = false;