示例#1
0
 public bool CanClose()
 {
     ActivePageDesigner.PageDeactivated();
     if (Designer.AskSave && !SaveCurrentFile())
     {
         ActivePageDesigner.PageActivated();
         return(false);
     }
     return(true);
 }
示例#2
0
        internal void SetModified(object sender, string action, string objName)
        {
            FModified          = true;
            FReport.ScriptText = Script;
            FUndoRedo.AddUndo(action, objName);
            FUndoRedo.ClearRedo();
            bool resetSelection = action == "Delete" ? true : false;

            ActivePageDesigner.FillObjects(resetSelection);
            InitPages(ActivePageIndex);
        }
示例#3
0
        public void Preview()
        {
            ActivePageDesigner.CancelPaste();
            int i = ActivePageIndex;

            Report.ScriptText = Script;
            Designer.MessagesWindow.ClearMessages();
            UndoRedo.AddUndo("Preview", "Report");
            Designer.Lock();

            bool saveProgress = Config.ReportSettings.ShowProgress;

            Config.ReportSettings.ShowProgress = true;
            ParameterCollection saveParams = new ParameterCollection(null);

            saveParams.Assign(Report.Parameters);

            try
            {
                if (Report.Prepare())
                {
                    Config.DesignerSettings.OnCustomPreviewReport(Report, EventArgs.Empty);
                }
            }
#if !DEBUG
            catch (Exception e)
            {
                if (!(e is CompilerException))
                {
                    using (ExceptionForm form = new ExceptionForm(e))
                    {
                        form.ShowDialog();
                    }
                }
                else
                {
                    Designer.MessagesWindow.Show();
                }
            }
#endif
            finally
            {
                Config.ReportSettings.ShowProgress = saveProgress;

                Image previewPicture = null;
                if (Report.ReportInfo.SavePreviewPicture)
                {
                    previewPicture            = Report.ReportInfo.Picture;
                    Report.ReportInfo.Picture = null;
                }
                UndoRedo.GetUndo(1);
                UndoRedo.ClearRedo();
                if (Report.ReportInfo.SavePreviewPicture)
                {
                    Report.ReportInfo.Picture = previewPicture;
                }
                Report.Parameters.Assign(saveParams);

                InitPages(i);
                Designer.Unlock();
            }
        }
示例#4
0
 internal void ReportDeactivated()
 {
     ActivePageDesigner.PageDeactivated();
 }
示例#5
0
 internal void ReportActivated()
 {
     ActivePageDesigner.FillObjects(true);
     ActivePageDesigner.PageActivated();
     UpdateCaption();
 }