Example #1
0
        public bool ShowSaveAsDialog(ref string recordName, IReportDesignerUI designer)
        {
            StorageEditorForm form = CreateForm();

            form.Owner = Window.GetWindow(designer as DependencyObject);
            form.listBox1.IsEnabled = true;
            form.textBox1.IsEnabled = true;
            bool?result = form.ShowDialog();

            recordName = form.textBox1.Text;
            return(result.Value);
        }
Example #2
0
        public string Open(IReportDesignerUI designer)
        {
            StorageEditorForm form = CreateForm();

            form.Owner = Window.GetWindow(designer as DependencyObject);
            form.textBox1.IsEnabled = false;
            bool?result = form.ShowDialog();

            if (result.HasValue && result.Value)
            {
                return((string)form.textBox1.Tag);
            }
            else
            {
                return(string.Empty);
            }
        }
Example #3
0
        public string ShowSaveDialog(string filePath, string reportTitle, IReportDesignerUI designer)
        {
            StorageEditorForm form = CreateForm();

            form.textBox1.Text      = reportTitle;
            form.listBox1.IsEnabled = false;
            bool?result = form.ShowDialog();

            if (result.HasValue && result.Value)
            {
                string title = form.textBox1.Text;
                if (!string.IsNullOrEmpty(title))
                {
                    return(title);
                }
                else
                {
                    MessageBox.Show("Incorrect report name", "Error", MessageBoxButton.OKCancel, MessageBoxImage.Error);
                }
            }
            return(string.Empty);
        }
Example #4
0
        public string Save(string reportID, IReportProvider reportProvider, bool saveAs, string reportTitle, IReportDesignerUI designer)
        {
            XtraReport report = reportProvider.GetReport();

            if (reportID == null)
            {
                reportID = Guid.NewGuid().ToString();
                saveAs   = true;
            }
            if (!saveAs)
            {
                SetData(reportID, reportTitle, report);
            }
            else
            {
                if (ShowSaveAsDialog(ref reportTitle, designer))
                {
                    SetData(reportID, reportTitle, report);
                }
                else
                {
                    return(null);
                }
            }

            return(reportID);
        }