private void EditExportSetup_Click(object sender, EventArgs e) { DialogResult dr; string exportFormat = ExportFileFormat.Text; if (Lex.Eq(exportFormat, "None")) { MessageBoxMx.Show("You must select a format first", UmlautMobius.String); return; } bool useExistingOptionValues = true; if (ExportParms == null) { ExportParms = new ResultsFormat(); useExistingOptionValues = false; } ExportParms.RunInBackground = true; // alerts are always run in the background if (Lex.Eq(exportFormat, "CSV / Text File")) { dr = SetupTextFile.ShowDialog(ExportParms, useExistingOptionValues); } else if (Lex.Eq(exportFormat, "Excel Worksheet")) { dr = SetupExcel.ShowDialog(ExportParms, useExistingOptionValues); } else if (Lex.Eq(exportFormat, "MS Word Table")) { dr = SetupWord.ShowDialog(ExportParms, useExistingOptionValues); } else if (Lex.Eq(exportFormat, "SDFile")) { dr = SetupSdFile.ShowDialog(ExportParms, useExistingOptionValues); } else if (Lex.StartsWith(exportFormat, "Mobius")) { MessageBoxMx.Show( // just give a message "When a full result set is exported in the Native Mobius Format\n" + "the exported data will be automatically displayed when the\n" + "associated query is opened. There is no need to supply any\n" + "additional export parameters."); } ExportParms.RunInBackground = true; // reset in case cleared in dialog return; }
/// <summary> /// Setup & show the dialog /// </summary> /// <param name="rf"></param> public new static DialogResult ShowDialog( ResultsFormat rf, bool useExistingOptionValues, bool alertExport = false) { if (Instance == null) { Instance = new SetupExcel(); } return(Instance.ShowDialog2(rf, useExistingOptionValues, alertExport)); }
/// <summary> /// Save default export parameters for user /// </summary> /// <param name="rf"></param> void SaveDefaultExportParameters(ResultsFormat rf) { string txt = ((int)rf.StructureFlags).ToString() + '\t' + QnfSplitControl.SerializeQualifiedNumberSplit(rf.QualifiedNumberSplit) + '\t' + rf.DuplicateKeyTableValues + '\t' + rf.AllowExtraLengthFieldNames + '\t' + rf.RunInBackground; Preferences.Set("SdFileExportDefaults", txt); if (SaveAsDefaultFolderOption.Checked) { SetupExcel.SaveDefaultFolder(rf.OutputFileName); } return; }