i want to query different data sources to solve permission issues.
so i use mdx(ms sqls erver)to query data source,how to binding the data source to pivotgrid ?
Hello,
I am just checking if you need further assistance on this matter.
Hello ma shifei,
The igPivodGrid control present the result of multi-dimensional queries in an easy to comprehend manner. This control uses an instance of either igOlapFladDataSource or igOlapXmlaDataSource component as data source.
After you get your data, whether is with select statement or a remote JSON Web Service, you will need to create a XmlaDataSourceModel that will be pass to the view.
View:
remoteDataSource = new $.ig.OlapXmlaDataSource({ isRemote: true, serverUrl: '@Url.Action("remote-xmla-provider-endpoint")', catalog: 'Adventure Works DW Standard Edition', cube: 'Adventure Works', rows: '[Date].[Calendar]', columns: '[Product].[Product Categories]', measures: '[Measures].[Internet Order Count]'});
Controller:
[XmlaDataSourceAction][ActionName("remote-xmla-provider-endpoint")]public ActionResult RemoteXmlaProviderEndpoint(){ return View(new XmlaDataSourceModel { ServerUrl = "http://sampledata.infragistics.com/olap/msmdpump.dll" });}
In the code snippet above the data is get from remote URL.
Useful references:
http://ko.infragistics.com/community/blogs/mihail_mateev/archive/2013/05/17/how-to-integrate-ignite-ui-pivot-grid-in-asp-net-mvc-applications.aspx
http://igniteui.com/pivot-grid/remote-xmla-provider
http://igniteui.com/pivot-grid/using-the-asp-net-mvc-helper-with-flat-data-source
Looking forward to hearing from you.
thank u for your answer.
my data source use .net:
string conn = @"Provider=MSOLAP.4;User ID=test;Password=123456;Initial Catalog=多维数据分析;Data Source=192.168.3.68"; string cmd = @"SELECT {[Measures].[销售金额]} ON Columns, ({[时间].[销售日期].Members}, {[产品].[产品名称].Members}) ON Rows FROM [美好食品]";
using (AdomdConnection aconn = new AdomdConnection(conn)) { aconn.Open(); AdomdCommand acmd = new AdomdCommand(cmd, aconn); var obj = acmd.ExecuteXmlReader(); using (FileStream fs = File.Open(path, FileMode.OpenOrCreate, FileAccess.Write)) { string content = obj.ReadOuterXml(); fs.Write(Encoding.UTF8.GetBytes(content), 0, content.Length); } }
i want to this data source to binding the pivotgrid.
I'm just checking if you have other questions regarding the matter.
In this case you should use igOlapXmlaDataSource. Here you can find more information: http://help.infragistics.com/Help/Doc/jQuery/2013.2/CLR4.0/html/igOlapXmlaDataSource_Overview.html
And this is an online sample: http://igniteui.com/pivot-grid/binding-to-xmla-data-source
Please let me know if you have any questions.