I’m trying to reproduce this example in my local Analysis Services and it doesn’t work. I have SQL Server 2012 and Visual Studio 2015.Visual Studio returns an exception:
Exception.Message: "Se produjo una excepción en el destino de la invocación."
Exception.InnerException:
{"The 'GetCatalogsAsync' method cannot be invoked because the data source has not yet been initialized."} Data: {System.Collections.ListDictionaryInternal} HResult: -2146233088 HelpLink: null InnerException: null Message: "The 'GetCatalogsAsync' method cannot be invoked because the data source has not yet been initialized." Source: "Infragistics4.Olap.DataSource.v15.1" StackTrace: " en Infragistics.Olap.OlapDataSource.VerifyMethodCallOK(String methodName, Boolean verifyInitialized)\r\n en Infragistics.Olap.Mdx.MdxDataSource.GetCatalogsAsync(Control control)\r\n en Infragistics.Win.UltraWinPivotGrid.DataSelector.MdxDataSelector.GetCatalogsAsync(Control control)\r\n en Infragistics.Win.UltraWinPivotGrid.DataSelector.OlapDataSelector.StartAsyncMethod(AsyncMethod method, Object[] args)\r\n en Infragistics.Olap.OlapDataSource.OnInitializeAsyncCompleted(InitializeAsyncCompletedEventArgs e)\r\n en Infragistics.Olap.OlapDataSource.RaiseInitializeAsyncEvent(Object unused, InitializeAsyncCompletedEventArgs args)" TargetSite: {Void VerifyMethodCallOK(System.String, Boolean)}
I have configured my Analysis Services with the information that I have found in the topic:http://ko.infragistics.com/community/blogs/atanas_dyulgerov/archive/2010/01/27/how-to-set-up-xmla-http-access-for-sql-server-analysis-service-2008-and-access-the-adventure-works-2008-from-an-infragistics-pivotgrid-application.aspxI don’t know which is the problem.
The C# code in form is:using System;using System.Collections.Generic;using System.Drawing;using System.IO;using System.Reflection;using System.Text;using System.Windows.Forms;using Infragistics.Olap.Adomd;using Infragistics.Olap.Xmla;namespace CubeManagement{ public partial class frmTest : Form { #region Default Constructor public frmTest() { InitializeComponent(); InitializeForm_XMLA(); //InitializeForm_ADOMD(); } #endregion #region InitializeForm_XMLA public void InitializeForm_XMLA() { // Bind the pivot grid to Infragistics sample data. XmlaInitialSettings settings = new XmlaInitialSettings { ServerUrl = "http://localhost/olap/msmdpump.dll", Catalog = "Adventure Works DW 2012", Cube = "Tutorial de Analysis Services", Rows = "[Product].[Product Line]", Columns = "[Ship Date].[Date Key]", Measures = "[Measures].[Sales Amount]" //ServerUrl = "http://sampledata.infragistics.com/olap/msmdpump.dll", //Catalog = "Adventure Works DW Standard Edition", //Cube = "Adventure Works", //Rows = "[Date].[Calendar]", //Columns = "[Product].[Category]", //Measures = "[Measures].[Reseller Sales Amount]" }; // Create an instance of XMLADataSource passing the same initial settings as in XmlaDataSource xmlaDs = new XmlaDataSource(settings); ultraPivotGrid1.DataSource = xmlaDs; // Bind the DataSelector to the same datasource as the pivot grid mdxDataSelector1.DataSource = xmlaDs; } #endregion }}
You can connect to sql server using multiple protocol libraries, check this: Sql Server Connection
Hi Albert,
With the information given I doubt if there's something wrong with the data source.Since you are using the SQL server can you try binding the PivotGrid using ADOMD data Source/Provider.
Below is a link to our help demonstrating using PivotGrid with an ADOMD datasourcehttp://help.infragistics.com/doc/WinForms?page=WinPivotGrid_Using_ADOMD.html
Let me know if that works for you,Josheela
Hello!
This example runs ok. The problem is when I atack my local Analysis Services.
When I atack my local Analysis Services, then the exception appears.
Thanks!
I found that you are following a Silverlight thread.
To make it simple please try the below code in the Form Load.
private void Form1_Load(object sender, EventArgs e) { var settings = new XmlaInitialSettings { ServerUrl = "http://sampledata.infragistics.com/olap/msmdpump.dll", Catalog = "Adventure Works DW Standard Edition", Cube = "Adventure Works", Rows = "[Date].[Calendar]", Columns = "[Product].[Category]", Measures = "[Measures].[Reseller Sales Amount]" };
// Create an instance of XMLADataSource passing the same initial settings as in pivit grid. var dataSource = new XmlaDataSource(settings); ultraPivotGrid1.DataSource = dataSource;
// Bind the DataSelector to the same datasource as the pivot grid. mdxDataSelector1.DataSource = dataSource;
}
I can also suggest you a YouTube Video on 'How to create a PivotGrid in Windows Forms', https://www.youtube.com/watch?v=X0gl8dQy_EM.
Please let me know if you still have issues with it.
Thanks,Josheela