public string BuildCellset(string Server, string Database, string Mdx, string TaskId, string TaskTag)
        {
            if (Mdx == null || Mdx.Trim() == "")
            {
                throw new Exception("Mdx is empty");
            }

            OlapServices.QueryProcessor processor = OlapServices.ProcessorPool.Instance.GetAvailableFromPool(Server, Database, TaskId);
            try
            {
                processor.TaskTag = TaskTag;
                string ret = processor.BuildCellset(Mdx);
                return(ret);
            }
            finally
            {
                processor.Release(TaskId, false);
            }
        }
        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);
            }
        }