Ejemplo n.º 1
0
        private void LoadTabs()
        {
            int id = 0, id1 = 0;

            id = this.CreateRootTabs(_tabView, _user.Name, _user.IsLoggedIn, true, PageBase.RootTabsEnum.Olap_Reports);

            _tabView.AddTab(id, "  List  ", Request.ApplicationPath + "/ReportList.aspx?content=List&rpttype=" + _report.GetTypeCode().ToString(), false, false);


            FI.Common.Data.FIDataTable rptTable = _user.ReportSystem.GetReportHeaders(_report.GetType());
            foreach (System.Data.DataRow row in rptTable.Rows)
            {
                decimal rptId       = decimal.Parse(row["id"].ToString());
                bool    rptSelected = (bool)row["is_selected"];
                bool    rptOpen     = (_report != null && rptId == _report.ID?true:false);
                string  rptName     = (string)row["name"];
                FI.BusinessObjects.Report.SharingEnum rptSharingStatus = (FI.BusinessObjects.Report.SharingEnum) int.Parse(row["sharing_status"].ToString());
                FI.BusinessObjects.Report.SharingEnum rptMaxSubscriberSharingStatus = (FI.BusinessObjects.Report.SharingEnum) int.Parse(row["max_subscriber_sharing_status"].ToString());

                if (rptSelected)
                {
                    int reportType = _report.GetTypeCode();
                    id1 = _tabView.AddTab(id, rptName, Request.ApplicationPath + "/ReportList.aspx?content=Load&action=Open&rptid=" + rptId + "&rpttype=" + reportType.ToString(), rptOpen, false);


                    if (rptSharingStatus == FI.BusinessObjects.Report.SharingEnum.SnapshotSubscriber)
                    {
                        _tabView.AddImage(id1, "images/share.gif");
                    }
                    else if (rptSharingStatus == FI.BusinessObjects.Report.SharingEnum.InheriteSubscriber)
                    {
                        _tabView.AddImage(id1, "images/share_change.gif");
                    }
                    else if (rptMaxSubscriberSharingStatus == FI.BusinessObjects.Report.SharingEnum.SnapshotSubscriber)
                    {
                        _tabView.AddImage(id1, "images/distr.gif");
                    }
                    else if (rptMaxSubscriberSharingStatus == FI.BusinessObjects.Report.SharingEnum.InheriteSubscriber)
                    {
                        _tabView.AddImage(id1, "images/distr_change.gif");
                    }
                }
            }

            _tabView.AddTab(id1, "  Table  ", Request.ApplicationPath + "/OlapReport/Table.aspx", true, false);
            _tabView.AddTab(id1, "  Graph  ", Request.ApplicationPath + "/OlapReport/Graph.aspx", false, false);
            _tabView.AddTab(id1, "  Design  ", Request.ApplicationPath + "/OlapReport/Design.aspx", false, false);
            _tabView.AddTab(id1, "  Format  ", Request.ApplicationPath + "/OlapReport/Format.aspx", false, false);
        }
        protected override void CreateTableCell(TableCell cell, string ColumnName, int RowIndex, DataRow Row)
        {
            if (ColumnName == "sharing_status")
            {
                FI.BusinessObjects.Report.SharingEnum rptSharingStatus = (FI.BusinessObjects.Report.SharingEnum)(byte) Row["sharing_status"];
                FI.BusinessObjects.Report.SharingEnum rptMaxSubscriberSharingStatus = (FI.BusinessObjects.Report.SharingEnum)(byte) Row["max_subscriber_sharing_status"];

                System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
                if (rptSharingStatus == FI.BusinessObjects.Report.SharingEnum.SnapshotSubscriber)
                {
                    img.ImageUrl = "images/share.gif";
                    cell.Controls.Add(img);
                }
                else if (rptSharingStatus == FI.BusinessObjects.Report.SharingEnum.InheriteSubscriber)
                {
                    img.ImageUrl = "images/share_change.gif";
                    cell.Controls.Add(img);
                }
                else if (rptMaxSubscriberSharingStatus == FI.BusinessObjects.Report.SharingEnum.SnapshotSubscriber)
                {
                    img.ImageUrl = "images/distr.gif";
                    cell.Controls.Add(img);
                }
                else if (rptMaxSubscriberSharingStatus == FI.BusinessObjects.Report.SharingEnum.InheriteSubscriber)
                {
                    img.ImageUrl = "images/distr_change.gif";
                    cell.Controls.Add(img);
                }

                if (Row["is_in_distribution"].ToString() == "1")
                {
                    System.Web.UI.WebControls.Image img1 = new System.Web.UI.WebControls.Image();
                    img1.ImageUrl = "images/envelope.gif";
                    cell.Controls.Add(img1);
                }
            }
            else if (ColumnName == "name")
            {
                HyperLink href = new HyperLink();
                href.Text        = Row[ColumnName].ToString();
                href.CssClass    = "tbl1_href_item";
                href.NavigateUrl = Request.ApplicationPath + "/ReportList.aspx?content=Load&action=Open&rptid=" + Row["id"].ToString() + "&rpttype=" + _reportsType.ToString();
                cell.Controls.Add(href);
            }
            else
            {
                base.CreateTableCell(cell, ColumnName, RowIndex, Row);
            }
        }
Ejemplo n.º 3
0
        public void CreateReportTabs(FI.UI.Web.Controls.Tabs.TabView tv, string contentType)
        {
            int reportTabId = 0;
            int rootTabId   = this.CreateRootTabs(tv, _user.Name, _user.IsLoggedIn, true, PageBase.RootTabsEnum.Storecheck_Reports);

            tv.AddTab(rootTabId, "  List  ", Request.ApplicationPath + "/ReportList.aspx?content=List&rpttype=" + _report.GetTypeCode().ToString(), false, false);


            FI.Common.Data.FIDataTable rptTable = _user.ReportSystem.GetReportHeaders(_report.GetType());
            foreach (System.Data.DataRow row in rptTable.Rows)
            {
                decimal rptId       = decimal.Parse(row["id"].ToString());
                bool    rptSelected = (bool)row["is_selected"];
                bool    rptOpen     = (_report != null && rptId == _report.ID?true:false);
                string  rptName     = (string)row["name"];
                FI.BusinessObjects.Report.SharingEnum rptSharingStatus = (FI.BusinessObjects.Report.SharingEnum) int.Parse(row["sharing_status"].ToString());
                FI.BusinessObjects.Report.SharingEnum rptMaxSubscriberSharingStatus = (FI.BusinessObjects.Report.SharingEnum) int.Parse(row["max_subscriber_sharing_status"].ToString());

                if (rptSelected)
                {
                    int reportType = _report.GetTypeCode();
                    reportTabId = tv.AddTab(rootTabId, rptName, Request.ApplicationPath + "/ReportList.aspx?content=Load&action=Open&rptid=" + rptId + "&rpttype=" + reportType.ToString(), rptOpen, false);

                    if (rptSharingStatus == FI.BusinessObjects.Report.SharingEnum.SnapshotSubscriber)
                    {
                        tv.AddImage(reportTabId, "images/share.gif");
                    }
                    else if (rptSharingStatus == FI.BusinessObjects.Report.SharingEnum.InheriteSubscriber)
                    {
                        tv.AddImage(reportTabId, "images/share_change.gif");
                    }
                    else if (rptMaxSubscriberSharingStatus == FI.BusinessObjects.Report.SharingEnum.SnapshotSubscriber)
                    {
                        tv.AddImage(reportTabId, "images/distr.gif");
                    }
                    else if (rptMaxSubscriberSharingStatus == FI.BusinessObjects.Report.SharingEnum.InheriteSubscriber)
                    {
                        tv.AddImage(reportTabId, "images/distr_change.gif");
                    }
                }
            }

            this.AddNotDeliveredTab(tv, reportTabId, (contentType == "NotDelivered"?true:false));
            this.AddNeverDeliveredTab(tv, reportTabId, (contentType == "NeverDelivered"?true:false));
            this.AddDeliveredTab(tv, reportTabId, (contentType == "Delivered"?true:false));
            this.AddDesignTab(tv, reportTabId, (contentType == "" || contentType == null?true:false));
        }
        private void LoadTabs()
        {
            int id = 0, id1 = 0;

            FI.UI.Web.Controls.Tabs.TabView tv = (FI.UI.Web.Controls.Tabs.TabView) this.FindControl("TabView1");


            if (_reportsType == _user.ReportSystem.GetReportTypeCode(typeof(BusinessObjects.OlapReport)))
            {
                id = this.CreateRootTabs(tv, _user.Name, _user.IsLoggedIn, true, PageBase.RootTabsEnum.Olap_Reports);

                tv.AddTab(id, "  List  ", "", true, false);
            }
            else if (_reportsType == _user.ReportSystem.GetReportTypeCode(typeof(BusinessObjects.StorecheckReport)))
            {
                id = this.CreateRootTabs(tv, _user.Name, _user.IsLoggedIn, true, PageBase.RootTabsEnum.Storecheck_Reports);

                tv.AddTab(id, "  List  ", "", true, false);
            }
            else if (_reportsType == _user.ReportSystem.GetReportTypeCode(typeof(BusinessObjects.CustomSqlReport)))
            {
                id = this.CreateRootTabs(tv, _user.Name, _user.IsLoggedIn, true, PageBase.RootTabsEnum.Custom_SQL_Reports);

                tv.AddTab(id, "  List  ", "", true, false);
            }
            else if (_reportsType == _user.ReportSystem.GetReportTypeCode(typeof(BusinessObjects.CustomMdxReport)))
            {
                id = this.CreateRootTabs(tv, _user.Name, _user.IsLoggedIn, true, PageBase.RootTabsEnum.Custom_MDX_Reports);

                tv.AddTab(id, "  List  ", "", true, false);
            }


            FI.Common.Data.FIDataTable rptTable = _user.ReportSystem.GetReportHeaders(_user.ReportSystem.GetReportType(_reportsType));
            foreach (System.Data.DataRow row in rptTable.Rows)
            {
                decimal rptId       = decimal.Parse(row["id"].ToString());
                bool    rptSelected = (bool)row["is_selected"];
                string  rptName     = (string)row["name"];
                FI.BusinessObjects.Report.SharingEnum rptSharingStatus = (FI.BusinessObjects.Report.SharingEnum) int.Parse(row["sharing_status"].ToString());
                FI.BusinessObjects.Report.SharingEnum rptMaxSubscriberSharingStatus = (FI.BusinessObjects.Report.SharingEnum) int.Parse(row["max_subscriber_sharing_status"].ToString());

                if (rptSelected)
                {
                    id1 = tv.AddTab(id, rptName, Request.ApplicationPath + "/ReportList.aspx?content=Load&action=Open&rptid=" + rptId + "&rpttype=" + _reportsType.ToString(), false, false);

                    if (rptSharingStatus == FI.BusinessObjects.Report.SharingEnum.SnapshotSubscriber)
                    {
                        tv.AddImage(id1, "images/share.gif");
                    }
                    else if (rptSharingStatus == FI.BusinessObjects.Report.SharingEnum.InheriteSubscriber)
                    {
                        tv.AddImage(id1, "images/share_change.gif");
                    }
                    else if (rptMaxSubscriberSharingStatus == FI.BusinessObjects.Report.SharingEnum.SnapshotSubscriber)
                    {
                        tv.AddImage(id1, "images/distr.gif");
                    }
                    else if (rptMaxSubscriberSharingStatus == FI.BusinessObjects.Report.SharingEnum.InheriteSubscriber)
                    {
                        tv.AddImage(id1, "images/distr_change.gif");
                    }
                }
            }
        }