private void LoadPivot() { try { //Create a Windows Forms Host to host a form WindowsFormsHost host = new WindowsFormsHost(); host.HorizontalAlignment = HorizontalAlignment.Stretch; host.VerticalAlignment = VerticalAlignment.Stretch; pivotView.Width = 1000; pivotView.Height = 570; pivotView.AppearanceSettings.SchemaVisible = true; pivotView.AppearanceSettings.ExpandGlyphs = ExpandGlyphsStyle.On; pivotView.AutoRefreshGrid = true; pivotView.CardLayout.DisplayPanels = false; RdDataSource dataSource = new RdDataSource(); pivotView.DataSource = dataSource; string qString = Util.GetConfigOption("CNNSTR"); dataSource.ConnectionString = qString; //dataSource.ConnectionString = "Data Source=CRMES;Initial Catalog=WMS30;User Id=sa;Password=2289"; dataSource.ConnectionType = DataDynamics.Analysis.DataSources.ConnectionType.Sql; dataSource.CustomSchemaFile = "receiving.schema"; dataSource.QueryString = "SELECT * FROM dbo.vwReceivingProcess"; dataSource.Connect(); LoadPivotLayout(); host.Child = pivotView; gridP.Children.Add(host); pivotView.Run(); } catch (Exception ex) { Util.ShowMessage("Problem loading the cube. " + ex.Message); return; } }