private void DoReportInfo() { // get current report ReportItem ri = _reportList.SelectedItem; if (ri == null || ri.Report == null) { return; } // show form using (ReportInfoForm f = new ReportInfoForm()) { if (f.ShowDialog(ri.Report) == DialogResult.OK) { // apply new information to current report ri.Report.ReportInfo = f.ReportInfo.Clone(); // apply to all reports if (f.ApplyToAll && _reportList.Items.Count > 1) { // confirm first if (MessageForm.Ask(Strings.MainForm.ApplyToAllQ) == DialogResult.Yes) { foreach (ReportItem reportItem in _reportList.Items) { reportItem.Report.ReportInfo = f.ReportInfo.Clone(); } } } _flexDesigner.CreateFieldInfo = null; } } }
private bool DataSources_EditMain() { C1FlexReport report = _flexDesigner.Report; if (report == null) { return(false); } var ds = report.DataSource; if (ds == null) { if (MessageForm.Ask(Strings.MainForm.CreateMainDataSourceQ, MessageBoxButtons.YesNoCancel) != System.Windows.Forms.DialogResult.Yes) { return(false); } ds = DataSources_AddDataSource(); if (ds == null) { return(false); } report.DataSourceName = ds.Name; return(true); } else { return(DataSources_EditDataSource(ds)); } }
private bool DataSources_RemoveDataSource(DataSource ds) { if (ds == null) { return(false); } if (MessageForm.Ask(String.Format(Strings.MainForm.RemoveDataSourceFmt, ds.Name)) == DialogResult.No) { return(false); } var dss = ds.ParentReport.DataSources; dss.RemoveAt(dss.IndexOf(ds)); return(true); }
// handle buttons private void _btnOK_Click(object sender, System.EventArgs e) { // apply current style _btnApply_Click(sender, e); // save any changes to settings file if (_dirty) { DialogResult dr = MessageForm.Ask(Strings.ReportStyleForm.ConfirmSaveStyle, MessageBoxButtons.YesNoCancel); switch (dr) { // cancel and keep dialog open case DialogResult.Cancel: return; // save all custom styles into app settings file case DialogResult.Yes: // build new custom style list ArrayList al = new ArrayList(); foreach (ReportStyle s in _list.Items) { if (s.IsCustom) { al.Add(s.StyleDefinition); } } // save new list AppSettings.SaveList("customstyles", al, false, null); // done break; } } // done with dialog DialogResult = DialogResult.OK; }