Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
40
Problem with the connection with local Analysis Services in C#
posted

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://es.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.aspx

I 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
     }
}