private void LoadReportPanel()
        {
            // load table
            _reportProxy.LoadHeader();
            FI.Common.Data.FIDataTable rptTable = new FI.Common.Data.FIDataTable();
            rptTable.Columns.Add("name", typeof(string));
            rptTable.Columns.Add("description", typeof(string));
            rptTable.Rows.Add(new object[] { _reportProxy.Name, _reportProxy.Description });

            //loading grid control
            _rptGr                    = (FI.UI.Web.Controls.FIDataTableGrid)Page.LoadControl("Controls/FIDataTableGrid.ascx");
            _rptGr.ID                 = "RptGrid";
            _rptGr.InMemory           = true;
            _rptGr.DataSource         = rptTable;
            _rptGr.ColumnNameArray    = new string[] { "name", "description" };
            _rptGr.ColumnCaptionArray = new string[] { "Report Name", "Description" };
            _rptGr.ColumnWidthArray   = new int[] { 200, 400 };
            _rptGr.EnableSort         = false;
            _rptGr.EnableFilter       = false;
            _rptGr.EnableCheckBoxes   = false;
            _rptGr.EnablePages        = false;
            ReportPanel.Controls.Add(_rptGr);


            //load values into text fields
            string name = ((string)rptTable.Rows[0]["name"]).Trim();

            name                = (name.Length > 42?name.Substring(0, 42):name);
            txtName.Text        = "Copy of " + name;
            txtDescription.Text = ((string)rptTable.Rows[0]["description"]).Trim();
        }
Beispiel #2
0
        public decimal CreateAsSharedFrom(Report parentReport, Report.SharingEnum subscriberSharing)
        {
            if (this.Owner == parentReport.Owner)
            {
                throw new Exception("Cannot share to same user");
            }

            parentReport.LoadHeader();

            if (subscriberSharing == Report.SharingEnum.None)
            {
                throw new Exception("Wrong sharing option");
            }

            if (parentReport.SharingStatus != Report.SharingEnum.None)
            {
                throw new Exception("Shared report cannot be source of other shared report");
            }


            decimal newReportId = 0;

            System.Type reportType = parentReport.GetType();
            // ----------------------------------------
            if (reportType == typeof(OlapReport))
            {
                FI.Common.DataAccess.IOlapReportsDA dacObj = DataAccessFactory.Instance.GetOlapReportsDA();
                newReportId = dacObj.CreateSharedReport(parentReport.ID, this.Owner.ID, (int)subscriberSharing);
            }
            else if (reportType == typeof(StorecheckReport))
            {
                FI.Common.DataAccess.IStorecheckReportsDA dacObj = DataAccessFactory.Instance.GetStorecheckReportsDA();
                newReportId = dacObj.CreateSharedReport(parentReport.ID, this.Owner.ID, (int)subscriberSharing);
            }
            else if (reportType == typeof(CustomSqlReport))
            {
                FI.Common.DataAccess.ICustomSqlReportsDA dacObj = DataAccessFactory.Instance.GetCustomSqlReportsDA();
                newReportId = dacObj.CreateSharedReport(parentReport.ID, this.Owner.ID, (int)subscriberSharing);
            }
            else if (reportType == typeof(CustomMdxReport))
            {
                FI.Common.DataAccess.ICustomMdxReportsDA dacObj = DataAccessFactory.Instance.GetCustomMdxReportsDA();
                newReportId = dacObj.CreateSharedReport(parentReport.ID, this.Owner.ID, (int)subscriberSharing);
            }
            // ----------------------------------------


            // update max
            if (((int)parentReport._maxSubscriberSharing) < ((int)subscriberSharing))
            {
                parentReport._maxSubscriberSharing = subscriberSharing;
            }

            return(newReportId);
        }
Beispiel #3
0
        private void LoadReportPanel()
        {
            // load table
            _report.LoadHeader();
            FI.Common.Data.FIDataTable rptTable = new FI.Common.Data.FIDataTable();
            rptTable.Columns.Add("name", typeof(string));
            rptTable.Columns.Add("description", typeof(string));
            rptTable.Rows.Add(new object[] { _report.Name, _report.Description });

            //loading grid control
            _rptGr                    = (FI.UI.Web.Controls.FIDataTableGrid)Page.LoadControl("Controls/FIDataTableGrid.ascx");
            _rptGr.ID                 = "RptGrid";
            _rptGr.InMemory           = true;
            _rptGr.DataSource         = rptTable;
            _rptGr.ColumnNameArray    = new string[] { "name", "description" };
            _rptGr.ColumnCaptionArray = new string[] { "Report Name", "Description" };
            _rptGr.ColumnWidthArray   = new int[] { 200, 400 };
            _rptGr.EnableSort         = false;
            _rptGr.EnableFilter       = false;
            _rptGr.EnableCheckBoxes   = false;
            _rptGr.EnablePages        = false;
            ReportPanel.Controls.Add(_rptGr);
        }