Example #1
0
        public CrcReportFolder Create(ReportingService2005Soap rService, string path)
        {
            var ret = new CrcReportFolder();

            ret.Path       = path;
            ret.FolderName = CrcReportDefinition.ReportNameFromPath(path);

            var lcRequest = new ListChildrenRequest(path, false);

            var lcResponse = rService.ListChildren(lcRequest);

            foreach (CatalogItem itemLoop in lcResponse.CatalogItems)
            {
                if (itemLoop.Type == ItemTypeEnum.Folder)
                {
                    var sf = Create(rService, itemLoop.Path);
                    if (sf.Reports.Count() > 0 || sf.SubFolders.Count() > 0)
                    {
                        ret.SubFolders.Add(sf);
                    }
                }
                else if (itemLoop.Type == ItemTypeEnum.Report)
                {
                    if (!itemLoop.Hidden)
                    {
                        var repItem = new CrcReportItem();
                        repItem.ReportPath  = itemLoop.Path;
                        repItem.DisplayName = itemLoop.Name;
                        repItem.Description = itemLoop.Description;
                        ret.Reports.Add(repItem);
                    }
                }
            }
            return(ret);
        }
        public CrcReportFolder Create(ReportingService2005Soap rService, string path)
        {
            var ret = new CrcReportFolder();
            ret.Path = path;
            ret.FolderName = CrcReportDefinition.ReportNameFromPath(path);

            var lcRequest = new ListChildrenRequest(path, false);

            var lcResponse = rService.ListChildren(lcRequest);
            foreach (CatalogItem itemLoop in lcResponse.CatalogItems)
            {
                if (itemLoop.Type == ItemTypeEnum.Folder)
                {
                    var sf = Create(rService, itemLoop.Path);
                    if (sf.Reports.Count() > 0 || sf.SubFolders.Count() > 0)
                        ret.SubFolders.Add(sf);
                }
                else if (itemLoop.Type == ItemTypeEnum.Report)
                {
                    if (!itemLoop.Hidden)
                    {
                        var repItem = new CrcReportItem();
                        repItem.ReportPath = itemLoop.Path;
                        repItem.DisplayName = itemLoop.Name;
                        repItem.Description = itemLoop.Description;
                        ret.Reports.Add(repItem);
                    }
                }

            }
            return ret;
        }