通过 C# 代码处理 SSAS 多维数据集 [英] Process SSAS cube through c# code

查看:47
本文介绍了通过 C# 代码处理 SSAS 多维数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 SSAS 多维数据集从 Dynamics AX 获取数据并将数据传递到 wpf Devexpress PivotGrid.我在 AX 中使用以下顺序来创建多维数据集:透视图-->视图-->查询(带参数)现在,当我每次必须手动处理多维数据集并呈现数据时更改查询参数时.我希望通过 c# 代码自动完成该过程.我试过下面的代码

I want to use SSAS cube to get data from Dynamics AX and Pass data to wpf Devexpress PivotGrid. I am using following order in AX to create cube: Perspective-->View-->Query(with arguments) Now when I change the arguments of query everytime I have to Process the cube manually and render the data. I want that process to be done through c# code automatically. i had tried below code

Server server = new Server();
server.Connect(cubeConnectionString);

Database database = server.Databases.FindByName(databaseName);
Cube cube = database.Cubes.FindByName(cubeName);

cube.Process(ProcessType.ProcessFull);

但它不起作用.有人可以帮忙吗??

but it is not working. Can anyone help??

推荐答案

我不知道您遇到了什么错误.要从 C# 处理多维数据集,您使用的代码似乎是正确的,但您可能遗漏了连接字符串中的某些内容.作为参考,您可以将此链接中提供的示例项目下载到我的博客:

I am not knowing what the error you are getting. To process cube from C# the code you have used seems correct but might you have missed something in connection string. For Reference you can download sample project provided in this link to my blog:

进程C#中的动态多维数据集

我用来处理我的多维数据集数据库的代码如下...

Code which I had used to process my cube database is like below...

 Server server = new Server();

 server.Connect("Data source=YourSSASServerName;Timeout=7200000;Integrated Security=SSPI");

 Database database = server.Databases.FindByName("YourCubeDBName");

 database.Process(ProcessType.ProcessFull);

这篇关于通过 C# 代码处理 SSAS 多维数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆