This is a migrated thread and some comments may be shown as answers.

RadPivotFieldList - changing cube at runtime

11 Answers 116 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
chillfire
Top achievements
Rank 1
chillfire asked on 13 May 2014, 03:44 PM
Hi,

I am building a cube/analytics viewer for a client and the RadPivotGrid and RadPivotFieldList combination works really well until we try to swap the connection string and point the RadPivotFieldList  control at the new cube.

However when we change the cube in the connection string the RadPivotGrid reloads with the new report, however the  RadPivotFieldList does not refresh it's field list, so we are stuck with the same fields as the first cube.
Both cubes work as we can load either of them first, just never change it.

I am doing this in codebehind and viewmodel (long story) and storing the serialised data provider in SQL, (this all works beautifully).

My latest code looks like this;

private Telerik.Pivot.Adomd.AdomdDataProvider _provider { get; set; }


 var x = _viewModel.DataProvider;
_provider = new AdomdDataProvider();
_provider = (Telerik.Pivot.Adomd.AdomdDataProvider)x;

var url = _viewModel.Analytics.GetOrDefault("AnalyticsURL");
var database = _viewModel.SelectedCube.Catalog;  
var cube = _viewModel.SelectedCube.Cube;  

var ConnectionSettings = new Telerik.Pivot.Adomd.AdomdConnectionSettings()
{
    Cube = cube,
    Database = database,                   
    ConnectionString = String.Format("Data Source={0}", url)
};
_provider.ConnectionSettings = ConnectionSettings;
 
_provider.BeginInit();
 
radPivotGrid.DataProvider = _provider;
radPivotFieldList.DataProvider = _provider;

_provider.EndInit();


The 'Cube' is the only bit that changes in the connection string.
I have looked online and cannot find any links to switching the cube at runtime, is there anyway to do this?

thanks for the help.
craig

11 Answers, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 13 May 2014, 11:22 PM
Hi Craig,

It looks like you have missed to set Initial Catalog value in your Connection string. As shown in our documentation here, you have to set Initial Catalog value to your database name.

Could you try adding Initial Catalog value in your connection string and inform us if everything is working fine on your side?

I'm looking forward to hearing from you.

Regards,
Rosen Vladimirov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
chillfire
Top achievements
Rank 1
answered on 14 May 2014, 07:51 AM
Hi Rosen,

Thanks for the reply, I have tried adding the initial catalog into the connection string:  

   var ConnectionSettings = new Telerik.Pivot.Adomd.AdomdConnectionSettings()
                {
                    Cube = cube,
                    Database = database,
                    ConnectionString = String.Format("Provider=MSOLAP.5;Persist Security Info=True;Data Source={0};Initial Catalog={1};", url,  database)
                };

Which gives me the same outcome as before that is, the PivotGrid will load and switch data but FieldList stays the same.
Does the type of datasource make any difference, we have to use the msmdpump type -  http://[server]/xxxxx_OLAP/msmdpump.dll

cheers
craig
0
Rosen Vladimirov
Telerik team
answered on 15 May 2014, 06:37 AM
Hello Craig,

There's no need to use http protocol (msmdpump.dll format) in order to use AdomdDataProvider. I've prepared a sample project to demonstrate the required approach. You have to modify the connections strings in order to get it work. I've also recorded a short video which demonstrates how the project works on our side (I've used connections to our internal OLAP cubes).

Hope this helps.

Regards,
Rosen Vladimirov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
chillfire
Top achievements
Rank 1
answered on 20 May 2014, 01:06 PM
Hi Rosen,

Unfortunately due to server setup, the only access we have to the cube is via the msmdpump protocols.
Which in theory takes and gives in the same was as a direct connection?

Is there any way to accomplish this cube change using the msmdpump?

cheers
craig
0
Rosen Vladimirov
Telerik team
answered on 21 May 2014, 09:14 AM
Hi Craig,

We haven't noticed any issues with changing the connection string at runtime, no matter if the connection was made through http (msmdpump.dll format) or directly. Have you tried the project I've sent you with your cubes?

As you have configured the http access, you can try using our XmlaDataProvider and see if it will work in this case. XmlaDataProvider is designed to work with msmdpump.dll, so you should be able to integrate it easily in your project.

I'm looking forward to hearing from you.

Regards,
Rosen Vladimirov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
chillfire
Top achievements
Rank 1
answered on 04 Jun 2014, 12:42 PM
Hi,

Unfortunately changing the provider is a last resort (we are serialising the AdomdDataProvider into our DB).
I have upgraded the telerik controls hoping that there might be a fix, but had no luck.

The attached image is a shot as I step through each of the connection providers. the cube is definitely changing each time and the RadPivotGrid is updating its UI correctly, but the RadPivotFieldList is not.
The full ode I have now is below.
The only thing I can see that is different between the two Rad controls in question is that the DataProviders are classified differently in intellisense?
The grid says "Gets or sets the data provider"
The FieldList says "Gets or Sets the Telerik.Windows.Controls.RadPivotFieldList.DataProvider associated with this control. This is a dependency property."

Does this mean we need to 'do' something different to the FieldList control to force refresh?

//My code
var x = _viewModel.DataProvider; // from view model
            if (x != null && _viewModel.SelectedReport != null) // from view model
            {
                var url = _viewModel.Analytics.GetOrDefault("AnalyticsURL"); // from view model
                var database = _viewModel.SelectedCube.Catalog;

                _provider = new AdomdDataProvider(); 
                _provider = (Telerik.Pivot.Adomd.AdomdDataProvider)x; 
                _provider.ConnectionSettings = new Telerik.Pivot.Adomd.AdomdConnectionSettings()
                                                    { 
                                                        Cube = _viewModel.SelectedCube.Cube, // from view model
                                                        Database = database,
                                                        ConnectionString = String.Format("Provider=MSOLAP.5;Persist Security Info=True;Data Source={0};Initial Catalog={1};", url, database)
                                                    };

                _provider.BeginInit();

                radPivotGrid.DataProvider = _provider; // screen shot taken here
               radPivotFieldList.DataProvider = _provider;
          
                _provider.EndInit();
 
            }
            else
            {

            }


Any help is much appreciated.
cheers
craig
0
chillfire
Top achievements
Rank 1
answered on 04 Jun 2014, 03:05 PM
I have found a solution and its probably a cleaner option anyway.
Code is now (code behind):

var layout = _viewModel.DataProvider;
           if (layout != null && _viewModel.SelectedReport != null)
           {            
                layout.BeginInit();
                radPivotGrid.DataProvider = layout;
                radPivotFieldList.DataProvider = layout;
                layout.EndInit();
                _provider = layout;                              
           }
           else
           {
           }

In my viewModel:

AdomdProviderSerializer provider = new AdomdProviderSerializer();
           try
           {

               var url = this.Analytics.GetOrDefault("AnalyticsURL");
               var database = this.SelectedCube.Catalog;

               DataProvider = new AdomdDataProvider();
               var p =   provider.Deserialize(DataProvider, xml.ToString());            
           
               DataProvider.ConnectionSettings = new Telerik.Pivot.Adomd.AdomdConnectionSettings()
               { 
                   Cube = this.SelectedCube.Cube,
                   Database = database,
                   ConnectionString = String.Format("Provider=MSOLAP.5;Persist Security Info=True;Data Source={0};Initial Catalog={1};", url, database)
               };

           }

For some reason splitting the logic up in this way allows the DataProvider to refresh when the connection is changed.

Hope it helps someone else out there.
0
Kalin
Telerik team
answered on 05 Jun 2014, 07:02 AM
Hi Craig,

We are glad you have managed to achieve the desired. If you have any other questions, do not hesitate to contact us.

Regards,
Kalin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
chillfire
Top achievements
Rank 1
answered on 07 Jul 2014, 08:33 AM
Hi,

All was going well until I updated to the latest build of the WPF controls v.2014.2.617.40 and now the loading indicators on both grid and fieldList are visible even after the data has loaded?

Is there a known bug/workaround for this as it was working on the 2013.3.xxx version?

cheers
craig
0
Rosen Vladimirov
Telerik team
answered on 07 Jul 2014, 11:53 AM
Hello Craig,

As I've answered in the support ticket, you've sent us, we are not aware of such issue and we were unable to reproduce it on our side. I've sent you our test project (its almost the same as the one that I've sent you before in this thread), so you could take a look at it and see if we are not missing something. I'll be waiting for your reply in the support ticket and I'll take care to update this thread once we have a solution of the issue.

I'm looking forward to hearing from you.

Regards,
Rosen Vladimirov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Rosen Vladimirov
Telerik team
answered on 10 Jul 2014, 12:09 PM
Hi,

As I've promised, I'm updating this thread with the solution of the problem. It turned out the problem is related to some styles, after removing them and using StyleManager.ApplicationTheme in order to set Windows8Theme, everything is working as expected.

Regards,
Rosen Vladimirov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
PivotGrid
Asked by
chillfire
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
chillfire
Top achievements
Rank 1
Kalin
Telerik team
Share this question
or