private void PrintGrid(TStandardFormPrint.TPrintUsing APrintApplication, bool APreviewMode) { TFormDataKeyDescriptionList recordList = new TFormDataKeyDescriptionList(); DataView FieldOrderView = new DataView(FMainDS.PDataLabelUse); FieldOrderView.RowFilter = String.Format("p_use_c = '{0}'", Context); recordList.Title = "Local Data Field Order For " + Context; String Key = Catalog.GetString("Name"); String Descr = Catalog.GetString("GroupHeading"); String Field3 = Catalog.GetString("Description"); recordList.KeyTitle = Key; recordList.DescriptionTitle = Descr; recordList.Field3Title = Field3; foreach (DataRowView FieldOrderViewRow in FieldOrderView) { TFormDataKeyDescription record = new TFormDataKeyDescription(); record.Key = FieldOrderViewRow[Key].ToString(); record.Description = FieldOrderViewRow[Descr].ToString(); record.Field3 = FieldOrderViewRow[Field3].ToString(); recordList.Add(record); } TStandardFormPrint.PrintRecordList(recordList, 3, APrintApplication, FieldOrderView.Count, FieldOrderView, "", APreviewMode); }
private void PrintGrid(TStandardFormPrint.TPrintUsing APrintApplication, bool APreviewMode) { PPartnerAttributeTypeTable typeTable = (PPartnerAttributeTypeTable)TDataCache.TMPartner. GetCacheablePartnerTable(TCacheablePartnerTablesEnum.ContactTypeList); DataView typeDataView = new DataView(typeTable); typeDataView.Sort = PPartnerAttributeTypeTable.GetCategoryCodeDBName(); TFormDataKeyDescriptionList recordList = new TFormDataKeyDescriptionList(); recordList.Title = "Contact Categories and Types"; recordList.KeyTitle = Catalog.GetString("Contact Category"); recordList.DescriptionTitle = Catalog.GetString("Contact Type"); recordList.Field3Title = Catalog.GetString("Description"); PPartnerAttributeTypeRow typeRow; foreach (DataRowView typeRowView in typeDataView) { TFormDataKeyDescription record = new TFormDataKeyDescription(); typeRow = (PPartnerAttributeTypeRow)typeRowView.Row; record.Key = typeRow.CategoryCode; record.Description = typeRow.AttributeType; record.Field3 = typeRow.Description; recordList.Add(record); } TStandardFormPrint.PrintRecordList(recordList, 3, APrintApplication, typeDataView.Count, typeDataView, "", APreviewMode); }
private void PrintGrid(TStandardFormPrint.TPrintUsing APrintApplication, bool APreviewMode) { DataView EsrDataView = new DataView(TRemote.MFinance.Gift.WebConnectors.GetEsrDefaults()); TFormDataKeyDescriptionList recordList = new TFormDataKeyDescriptionList(); recordList.Title = "ESR Defaults"; recordList.KeyTitle = Catalog.GetString("ESR Key"); recordList.DescriptionTitle = Catalog.GetString("Substitute"); recordList.Field3Title = Catalog.GetString("Motivation Group"); recordList.Field4Title = Catalog.GetString("Motivation Detail"); foreach (DataRowView typeRowView in EsrDataView) { TFormDataKeyDescription record = new TFormDataKeyDescription(); record.Key = typeRowView[0].ToString(); record.Description = typeRowView[1].ToString(); record.Field3 = typeRowView[2].ToString(); record.Field4 = typeRowView[3].ToString(); recordList.Add(record); } TStandardFormPrint.PrintRecordList(recordList, 4, APrintApplication, EsrDataView.Count, EsrDataView, "", APreviewMode); }
private void PrintGrid(TStandardFormPrint.TPrintUsing APrintApplication, bool APreviewMode) { TStandardFormPrint.PrintGrid(APrintApplication, APreviewMode, TModule.mPartner, this.Text, grdDetails, new int[] { 0, 1, 2, 3 }, new int[] { PLanguageTable.ColumnLanguageCodeId, PLanguageTable.ColumnLanguageDescriptionId, PLanguageTable.ColumnCongressLanguageId, PLanguageTable.ColumnDeletableId }); }
/// <summary> /// Print the screen data using Word or Excel /// </summary> /// <param name="APrintUsing">The print application</param> /// <param name="APreviewOnly"></param> public void PrintFormData(TStandardFormPrint.TPrintUsing APrintUsing, bool APreviewOnly) { if (ValidateAllData(true, TErrorProcessingMode.Epm_All) && FPetraUtilsObject.IsDataSaved()) { TStandardFormPrint.PrintGrid(APrintUsing, APreviewOnly, FPetraUtilsObject.GetForm().Text, grdDetails, new int[] { 0, 2, 1, 3 }, new int[] { ExtractTDSMExtractTable.ColumnPartnerKeyId, ExtractTDSMExtractTable.ColumnPartnerShortNameId, ExtractTDSMExtractTable.ColumnPartnerClassId, ExtractTDSMExtractTable.ColumnLocationKeyId }); } }
/// <summary> /// Print the data that is shown in a grid /// </summary> /// <param name="AParentForm">The parent form (since a modal dialog is called)</param> /// <param name="APrintApplication">The print application to use - either Word or Excel</param> /// <param name="APreviewOnly">True if preview, False to print without preview</param> /// <param name="AModule">The module that is making the call</param> /// <param name="ATitleText">Title for the page</param> /// <param name="AGrid">A grid displaying data</param> /// <param name="ATableColumnOrder">Zero-based table column order that matches the grid columns</param> public static void SelectAndPrintGridFields(Form AParentForm, TStandardFormPrint.TPrintUsing APrintApplication, bool APreviewOnly, TModule AModule, string ATitleText, TSgrdDataGrid AGrid, int[] ATableColumnOrder) { TFrmSelectPrintFields SelectPrintFields = new TFrmSelectPrintFields(AParentForm, "SelectPrintFields"); SelectPrintFields.InitData(ATableColumnOrder, AGrid, APreviewOnly); SelectPrintFields.ShowDialog(); if (SelectPrintFields.DialogResult == DialogResult.OK) { TStandardFormPrint.PrintGrid(APrintApplication, APreviewOnly, ATitleText, AGrid, SelectPrintFields.GetColumnOrder(), SelectPrintFields.GetColumnID()); } }
private void PrintGrid(TStandardFormPrint.TPrintUsing APrintApplication, bool APreviewMode) { if (MessageBox.Show(this, Catalog.GetString("You are about to print a combined table of regions and ranges. Do you want to proceed?"), Catalog.GetString("Printing"), MessageBoxButtons.OKCancel) == DialogResult.OK) { DataTable RegionsAndRangesTable = TRemote.MPartner.Mailroom.WebConnectors.GetPostCodeRegionsAndRanges(); DataView regionsAndRangesDataView = new DataView(RegionsAndRangesTable); TFormDataKeyDescriptionList recordList = new TFormDataKeyDescriptionList(); recordList.Title = "Regions and Ranges"; recordList.KeyTitle = Catalog.GetString("Region"); recordList.DescriptionTitle = Catalog.GetString("Region Description"); recordList.Field3Title = Catalog.GetString("Range"); recordList.Field4Title = Catalog.GetString("From"); recordList.Field5Title = Catalog.GetString("To"); foreach (DataRowView typeRowView in regionsAndRangesDataView) { TFormDataKeyDescription record = new TFormDataKeyDescription(); record.Key = typeRowView[0].ToString(); record.Description = typeRowView[1].ToString(); record.Field3 = typeRowView[2].ToString(); record.Field4 = typeRowView[3].ToString(); record.Field5 = typeRowView[4].ToString(); recordList.Add(record); } TStandardFormPrint.PrintRecordList(recordList, 5, APrintApplication, regionsAndRangesDataView.Count, regionsAndRangesDataView, "", APreviewMode); } }