Exemplo n.º 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);
        }
Exemplo n.º 2
0
        private string HierarchicalCatalogView(CrcReportFolder rootFolder, int level, string showFolder)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("<div class=\"folderBox\">");
            string scrollTo = "";
            if (PathMatch(showFolder, rootFolder.Path))
                scrollTo = " scrollToFolder";
            sb.AppendFormat("<div class=\"folderName{1}\">{0}</div>", rootFolder.FolderName, scrollTo);
            string show = "none";
            if (level == 0 || PathContains(showFolder, rootFolder.Path))
                show = "block";

            sb.AppendFormat("<div class=\"folderChildren\" style=\"display:{0}\">", show);

            foreach (CrcReportFolder subFolderLoop in rootFolder.SubFolders)
                sb.Append(HierarchicalCatalogView(subFolderLoop, level + 1, showFolder));

            foreach (CrcReportItem itemLoop in rootFolder.Reports)
            {

                sb.Append("<div class=\"reportRow\">");
                sb.AppendFormat("<a class=\"reportLink vanillaHover\" href=\"Report.aspx?path={0}\" >{1}</a>",
                    Server.UrlEncode(itemLoop.ReportPath), itemLoop.DisplayName);
                if (!string.IsNullOrEmpty(itemLoop.ShortDescription))
                    sb.AppendFormat("<div class=\"reportInfo\">{0}</div>", itemLoop.ShortDescription);
                sb.Append("<div class=\"clear\"></div></div>");

            }

            sb.Append("</div></div>");
            return sb.ToString();
        }
Exemplo n.º 3
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;
        }