示例#1
0
        private void LoadSavedReports(Guid idUser)
        {
            string directoryNameSavedReports = Path.Combine(
                HttpContext.Current.Request.PhysicalApplicationPath,
                "Fileadmin",
                "SavedReports",
                this.Node.Owner.Core.ClientName,
                idUser.ToString()
                );

            if (!Directory.Exists(directoryNameSavedReports))
            {
                return;
            }

            // Get the user's saved reports.
            string[] savedReports = Directory.GetDirectories(directoryNameSavedReports);

            // Run through all saved reports of the user.
            foreach (string savedReport in savedReports)
            {
                Guid guidOutput = Guid.Empty;
                //check is report directory is guid or no.
                if (!Guid.TryParse(Path.GetFileName(savedReport), out guidOutput))
                {
                    continue;
                }

                ReportDefinitionInfo info = new ReportDefinitionInfo(Path.Combine(
                                                                         savedReport,
                                                                         "Info.xml"
                                                                         ));

                if (info.GetReports(this.Node.Owner.Core, this.Node.Owner.IdUser.Value).Count == 0)
                {
                    continue;
                }

                // Create a new recent use item by the saved report.
                RecentUsedItem item = new RecentUsedItem();

                item.LatestUse = info.LatestAccess;
                item.Name      = info.Name;
                item.Type      = RecentUsedItemType.Report;
                item.OnClick   = string.Format(
                    "window.location='/Pages/LinkReporter/Crosstabs.aspx?SavedReport={0}{1}';",
                    idUser,
                    new FileInfo(savedReport).Name
                    );
                item.Identity = new DirectoryInfo(directoryNameSavedReports).Name +
                                new DirectoryInfo(savedReport).Name;

                this.Items.Add(item);
            }
        }
示例#2
0
        private void LoadDashboards(Guid idUser)
        {
            string directoryName = Path.Combine(
                HttpContext.Current.Request.PhysicalApplicationPath,
                "Fileadmin",
                "DashboardItems",
                ((DatabaseCore.Core)HttpContext.Current.Session["Core"]).ClientName
                );

            if (!Directory.Exists(directoryName))
            {
                return;
            }

            // Get the client's saved linkBi definitions.
            string[] dashboardItems = Directory.GetFiles(directoryName);

            // Run through all saved linkBI reports of the client.
            foreach (string dashboardItem in dashboardItems)
            {
                DashboardItem info = new DashboardItem(dashboardItem);

                // Create a new recent use item by the saved report.
                RecentUsedItem item = new RecentUsedItem();

                DateTime latestUse = new DateTime();

                if (info.LatestUses.ContainsKey(idUser))
                {
                    latestUse = info.LatestUses[idUser];
                }

                item.LatestUse = latestUse;
                item.Name      = info.Name;
                item.Type      = RecentUsedItemType.Dashboard;
                item.OnClick   = string.Format(
                    "window.location = '/Pages/Dashboards.aspx?IdDashboardItem={0}';",
                    info.Id
                    );

                this.Items.Add(item);
            }
        }
示例#3
0
        private void LoadLinkBiReports(Guid idUser)
        {
            string directoryName = Path.Combine(
                HttpContext.Current.Request.PhysicalApplicationPath,
                "Fileadmin",
                "SavedLinkBiDefinitions",
                ((DatabaseCore.Core)HttpContext.Current.Session["Core"]).ClientName
                );

            if (!Directory.Exists(directoryName))
            {
                return;
            }

            // Get the client's saved linkBi definitions.
            string[] savedLinkBIDefinitions = Directory.GetFiles(directoryName);

            // Run through all saved linkBI reports of the client.
            foreach (string savedLinkBIDefinition in savedLinkBIDefinitions)
            {
                LinkBiDefinitionInfo info = new LinkBiDefinitionInfo(savedLinkBIDefinition);

                // Create a new recent use item by the saved report.
                RecentUsedItem item = new RecentUsedItem();

                DateTime latestUse = new DateTime();

                if (info.LatestUses.ContainsKey(idUser))
                {
                    latestUse = info.LatestUses[idUser];
                }

                item.LatestUse = latestUse;
                item.Name      = info.ReportName;
                item.Type      = RecentUsedItemType.LinkBi;
                item.OnClick   = "_AjaxRequest('/Handlers/LinkBi.ashx', 'SetActiveLinkBiDefinition', 'FileName=" +
                                 savedLinkBIDefinition.Replace("\\", "/") + "', function (response) { window.location = '/Pages/LinkBi/LinkBi.aspx'; });";

                this.Items.Add(item);
            }
        }