Beispiel #1
0
    private bool ExpandNode(ReportTypeOld type, int valNodeToSelect)
    {
        RadTreeNode typeNode = reportTree.FindNodeByValue(((int)type).ToString());

        if (typeNode == null)
        {
            return(false);
        }
        else
        {
            Reports _reports = new Reports(UserSession.LoginUser);
            switch (type)
            {
            case ReportTypeOld.Standard:
                _reports.LoadStandard();
                break;

            case ReportTypeOld.Graphical:
                _reports.LoadGraphical(UserSession.CurrentUser.OrganizationID);
                break;

            case ReportTypeOld.Favorite:
                _reports.LoadFavorites();
                break;

            default:
                _reports.LoadCustom(UserSession.CurrentUser.OrganizationID);
                break;
            }

            foreach (Report rep in _reports)
            {
                RadTreeNode newNode = new RadTreeNode();
                newNode.Text  = rep.Name;
                newNode.Value = rep.ReportID.ToString();
                newNode.Attributes.Add("ExternalURL", rep.ExternalURL);

                if (newNode.Value == valNodeToSelect.ToString())
                {
                    newNode.Selected = true;
                }
                typeNode.Nodes.Add(newNode);
            }

            typeNode.Expanded   = true;
            typeNode.ExpandMode = TreeNodeExpandMode.WebService;

            return(true);
        }
    }
Beispiel #2
0
    protected void loadReport()
    {
        int    id     = GetReportID();
        Report report = (Report)Reports.GetReport(UserSession.LoginUser, id);

        if (report != null)
        {
            ReportTypeOld repType = (ReportTypeOld)Enum.Parse(typeof(ReportTypeOld), Settings.UserDB.ReadInt("SelectedReportTypeOldID").ToString());

            if (ExpandNode(repType, id))
            {
                string url = string.IsNullOrEmpty(report.ExternalURL) ? "../Report/ReportResults.aspx" : report.ExternalURL;
                frmReport.Attributes["src"] = url + "?ReportID=" + id.ToString();

                tbUser.Items[1].Enabled = UserSession.CurrentUser.IsSystemAdmin && report.OrganizationID != null && report.OrganizationID == UserSession.LoginUser.OrganizationID;
                tbUser.Items[2].Enabled = tbUser.Items[1].Enabled && repType != ReportTypeOld.Favorite;
                tbUser.Items[3].Enabled = true;
                tbUser.Items[5].Enabled = true;
                tbUser.Items[6].Enabled = true;

                tbUser.Items[6].Text = report.IsFavorite ? "Remove Favorite" : tbUser.Items[6].Text;
            }
        }
    }