![]() |
#5 |
Участник
|
Вот так код заработал:
X++: void CopyOfprocessCubeDimensions() { Microsoft.AnalysisServices.Server svr ; Microsoft.AnalysisServices.DatabaseCollection dbc; Microsoft.AnalysisServices.Database db ; Microsoft.AnalysisServices.DimensionCollection dimCollection ; Microsoft.AnalysisServices.Dimension dim ; Microsoft.AnalysisServices.DataSourceCollection dsc; Microsoft.AnalysisServices.DataSource ds; Microsoft.AnalysisServices.CubeCollection cubeCollection; Microsoft.AnalysisServices.Cube maCube; Microsoft.AnalysisServices.CubeDimensionCollection cubeDimCollection; Microsoft.AnalysisServices.CubeDimension cubeDim; System.Collections.IEnumerator ie; System.Exception ex; str excMsg; ; try { svr = new Microsoft.AnalysisServices.Server(); svr. Connect("Srv106"); svr.BeginTransaction(); if (svr !=null && svr.get_Connected()) { dbc = svr.get_Databases(); if (dbc) { db = dbc.Find("Axapta BAS dat"); dimCollection = db.get_Dimensions(); } } dsc = db.get_DataSources(); ds = dsc.FindByName("TestOLAPFunc"); cubeCollection = db.get_Cubes(); maCube = cubeCollection. FindByName("TestOLAPFunc"); cubeDimCollection = maCube.get_Dimensions(); ie = cubeDimCollection.GetEnumerator(); while (ie.MoveNext()) { cubeDim = ie.get_Current(); dim = cubeDim.get_Dimension(); dim.Process( Microsoft.AnalysisServices.ProcessType::ProcessUpdate ); } svr.CommitTransaction(); } catch (Exception::CLRError) { ex = ClrInterop::getLastException(); if (ex) { excMsg = ex.get_Message(); info(excMsg); } svr.RollbackTransaction(); } } |
|