Beispiel #1
0
        internal void DeleteReport(Report report, bool DenyShared)
        {
            report.Validate(true);

            if (report.State == Report.StateEnum.Executing)
            {
                try
                {
                    report.CancelExecute();
                }
                catch
                {
                    // do nothing
                }
            }

            if (BeforeDeleteReport != null)
            {
                BeforeDeleteReport(report, EventArgs.Empty);
            }

            DeleteSharedReports(report);
            report._DeleteStates();
            report._Delete(DenyShared);

            report = null;
        }
Beispiel #2
0
        public void DeleteSharedReport(Report parentReport, Report childReport)
        {
            System.Type reportType = childReport.GetType();

            if (parentReport.GetType() != reportType)
            {
                throw new Exception("Parent and child report type mismatch");
            }

            short maxSurscriberSharing = 0;

            // delete child report states
            childReport._DeleteStates();


            // ----------------------------------------
            if (reportType == typeof(OlapReport))
            {
                FI.Common.DataAccess.IOlapReportsDA dacObj = DataAccessFactory.Instance.GetOlapReportsDA();
                dacObj.DeleteSharedReport(parentReport.ID, childReport.ID, ref maxSurscriberSharing);
            }
            else if (reportType == typeof(StorecheckReport))
            {
                FI.Common.DataAccess.IStorecheckReportsDA dacObj = DataAccessFactory.Instance.GetStorecheckReportsDA();
                dacObj.DeleteSharedReport(parentReport.ID, childReport.ID, ref maxSurscriberSharing);
            }
            else if (reportType == typeof(CustomSqlReport))
            {
                FI.Common.DataAccess.ICustomSqlReportsDA dacObj = DataAccessFactory.Instance.GetCustomSqlReportsDA();
                dacObj.DeleteSharedReport(parentReport.ID, childReport.ID, ref maxSurscriberSharing);
            }
            else if (reportType == typeof(CustomMdxReport))
            {
                FI.Common.DataAccess.ICustomMdxReportsDA dacObj = DataAccessFactory.Instance.GetCustomMdxReportsDA();
                dacObj.DeleteSharedReport(parentReport.ID, childReport.ID, ref maxSurscriberSharing);
            }
            else
            {
                throw new NotSupportedException();
            }
            // ----------------------------------------

            childReport._sharing = Report.SharingEnum.None;
            parentReport._maxSubscriberSharing = (Report.SharingEnum)maxSurscriberSharing;
        }