问题
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??
回答1:
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.
Process Cube dynamically in 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);
来源:https://stackoverflow.com/questions/24575563/process-ssas-cube-through-c-sharp-code