public DateTime GetCubeLastProcessed(string Server, string Database, string Cube, bool throwExc) { string taskId = Guid.NewGuid().ToString(); OlapServices.QueryProcessor processor = OlapServices.ProcessorPool.Instance.GetAvailableFromPool(Server, Database, taskId); DateTime ret = DateTime.MinValue; try { // get cube processing time if (Cube != null && Cube != "") { ret = processor.GetCubeLastProcessed(Cube); } } catch (Exception exc) { if (throwExc) { throw exc; } } finally { processor.Release(taskId, false); } return(ret); }
public string BuildCellset(string Server, string Database, string Cube, string Mdx, string TaskId, string TaskDescrition, string ReportType, decimal ReportId) { if (Mdx == null || Mdx.Trim() == "") { throw new Exception("Mdx is empty"); } OlapServices.QueryProcessor processor = OlapServices.ProcessorPool.Instance.GetAvailableFromPool(Server, Database, TaskId); try { // execute processor.TaskDescription = TaskDescrition; string ret = processor.BuildCellset(Mdx); // save as report if (ReportId >= 0) { if (string.Compare(ReportType, "Olap", true) == 0) { // get cube processing time DateTime cubeProcessedOn = DateTime.MinValue; if (Cube != null && Cube != "") { cubeProcessedOn = processor.GetCubeLastProcessed(Cube); } OlapReports rpt = new OlapReports(); rpt.UpdateReportCache(ReportId, Server, Database, Cube, Mdx, TaskId, ret, cubeProcessedOn); } } // return return(ret); } finally { processor.Release(TaskId, false); } }