Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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();
            }
        }