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

Connection to RadPivotGrid

6 Answers 117 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Kalyani
Top achievements
Rank 1
Kalyani asked on 10 Mar 2014, 09:27 PM
I am trying to connect to a cube using C#.    When I connect it through my aspx page it works without any issues.  But I would like to do it using code. I tried this code - but I am not able to do it.   Please let me know what I should fix..

 This is my aspx page 

 <tlrk:RadPivotGrid AllowFiltering="true" AllowSorting="true" ID="RadPivotGrid1"  Width="100%" 
       RowTableLayout="Tabular" FieldsPopupSettings-AggregateFieldsMinCount="2" AllowPaging="true"
       PageSize="20" runat="server" EnableConfigurationPanel="true" EnableZoneContextMenu="true"
       AggregatesPosition="Rows"  EnableToolTips ="true" Skin="Vista">
    <PagerStyle AlwaysVisible="true" />
    <OlapSettings ProviderType="Adomd"> </OlapSettings>      
    <RowHeaderCellStyle Width="100%" />
    <ConfigurationPanelSettings Position="left" LayoutType="Stacked" DefaultDeferedLayoutUpdate="true"  />
    <ClientSettings EnableFieldsDragDrop="true"><Scrolling AllowVerticalScroll="false" ScrollHeight="1000px" /> </ClientSettings>
   </tlrk:RadPivotGrid>

And in my c# I did this  - 

protected void Page_Load(object sender, System.EventArgs e)
 {
   SetupAdomdConnection();
 }
private void SetupAdomdConnection()
 {
  AdomdDataProvider provider = new AdomdDataProvider();
  AdomdConnectionSettings settings = new AdomdConnectionSettings();
  settings.Cube = "cubeName";
  settings.Database = "DBName";
  settings.ConnectionString = "Provider=MSOLAP;Data Source=XXXXX;Initial Catalog=DBName;";
  provider.ConnectionSettings = settings;
 }




6 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 13 Mar 2014, 02:47 PM
Hello Kalyani,

Note that setting the OLAP settings programmatically should be preformed in Page_Init event and also should be applied to RadPivotGrid1.OlapSettings.AdomdConnectionSettings for example:
protected void Page_Init(object sender, EventArgs e)
{
    RadPivotGrid1.OlapSettings.AdomdConnectionSettings.Cube = "cubeName";
    RadPivotGrid1.OlapSettings.AdomdConnectionSettings.DataBase = "DBName";
    RadPivotGrid1.OlapSettings.AdomdConnectionSettings.ConnectionString = "Provider=MSOLAP;Data Source=XXXXX;Initial Catalog=DBName;";
        
}

I hope this helps.

Regards,
Maria Ilieva
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
0
Kalyani
Top achievements
Rank 1
answered on 13 Mar 2014, 04:55 PM
Thanks.. Was able to get it to work..
0
Diyan
Top achievements
Rank 1
answered on 27 Aug 2014, 01:27 PM
Hi
I will use this thread because it is similar to my problem.
My scenario is that I need to use specific user for connection.
According to this links http://www.telerik.com/help/aspnet-ajax/pivotgrid-olap-support.html and http://demos.telerik.com/aspnet-ajax/pivotgrid/examples/olap/defaultcs.aspx there is a property Credentials but I can't find in. 

This is my example 
RadPivotGrid1.OlapSettings.AdomdConnectionSettings.ConnectionString = ConfigurationManager.AppSettings["BIConnectionString"];
RadPivotGrid1.OlapSettings.AdomdConnectionSettings.Cube = ConfigurationManager.AppSettings["BICube"];
RadPivotGrid1.OlapSettings.AdomdConnectionSettings.DataBase = ConfigurationManager.AppSettings["BIDataBase"];
Thanks


0
Maria Ilieva
Telerik team
answered on 28 Aug 2014, 01:42 PM
Hi Diyan,

The credentials could be set in case the ConnectionString is in the following format:

ConnectionString="Provider=MSOLAP.5;Data Source=ServerName;Initial Catalog=Adventure Works DW 2008R2;User Id=domain\user;Password=myPassword;">

I hope this helps.

Regards,
Maria Ilieva
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Diyan
Top achievements
Rank 1
answered on 01 Sep 2014, 06:14 AM
Hi Maria,
Unfortunately this doesn't work. What I try to achieve is to use Adomd as olapsetting provider (RadPivotGrid1.OlapSettings.ProviderType = PivotGridOlapProviderType.Adomd) and keep ApplicationPoolIdentity as identity of my application pool. Also I forgot to mention that analytics server is on different machine but in same domain. 

So my goal is with adomd provider running on build-in applicationpoolidentity connect to this analytics server using some specific domain account.
Thanks
0
Kostadin
Telerik team
answered on 03 Sep 2014, 12:04 PM
Hello Diyan,

I am afraid you could not use the ApplicationPoolIdentity to login to the cube. Generally you could use the identity to prevent opening a web page or load a different data in the cube, but you could not use it to connect to the OLAP data source. For this purpose you need to use the id and the password of the cube as Maria's suggestion.

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
PivotGrid
Asked by
Kalyani
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Kalyani
Top achievements
Rank 1
Diyan
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or