diff --git a/CS/RichEditMasterDetailMailMerge.csproj b/CS/RichEditMasterDetailMailMerge.csproj index 55f8659..3891ddf 100644 --- a/CS/RichEditMasterDetailMailMerge.csproj +++ b/CS/RichEditMasterDetailMailMerge.csproj @@ -1,47 +1,47 @@  - - net8.0-windows - WinExe - false - true - true - - - - - - - - - - - - - Always - - - Always - - - Always - - - - - Always - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - \ No newline at end of file + + net8.0-windows + WinExe + false + true + true + + + + + + + + + + + + + Always + + + Always + + + Always + + + + + Always + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + diff --git a/Readme.md b/Readme.md index 7090ec9..16e319e 100644 --- a/Readme.md +++ b/Readme.md @@ -5,17 +5,32 @@ [![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives) -# Rich Text Editor for WinForms - Create a Master-Detail Report +# Rich Text Editor for WinForms - Use Mail Merge to Create a Master-Detail Report -This example illustrates an older approach to creating master-detail documents. +This example uses the Rich Text Editor control and its Mail Merge functionality to generate a product catalog report based on a master-detail template. -> [!IMPORTANT] -> To learn about a newer and more convenient approach to master-detail mail merge, refer to the following article: [Create a Master-Detail Report with a Detail Report Band](https://docs.devexpress.com/XtraReports/4785/create-reports/create-a-master-detail-report-with-a-detail-report-band). +This project uses a two-level **Categories-Products** data source retrieved from **nwind.xml**. +![result](./media/96c27986-26f4-4775-b794-285e373adea7.png) -This project uses a two-level **Categories-Products** hierarchical data source, retrieved from the **nwind.xml** file. +## Implementation Details -![result](./media/96c27986-26f4-4775-b794-285e373adea7.png) +Rich Text Editor supports master-detail mail merge templates. ``TableStart:Name`` and ``TableEnd:Name`` merge fields define master and nested detail regions. Region names should match group or table names in your data source. + +This example loads the template to the `RichEditControl` instance located in the **Main Template** tab. + +![winforms richedit template tab](./media/richedit-template-tab.png) + +This example uses the following APIs to specify the data source: + +- [RichEditControl.CreateMailMergeOptions()](https://docs.devexpress.com/OfficeFileAPI/DevExpress.XtraRichEdit.RichEditControl.CreateMailMergeOptions) method - initializes an object with mail merge settings. +- [RichEditMailMergeOptions.DataSource](https://docs.devexpress.com/OfficeFileAPI/DevExpress.XtraRichEdit.RichEditMailMergeOptions.DataSource) - sets the data source. +- [RichEditControl.MailMerge](https://docs.devexpress.com/OfficeFileAPI/DevExpress.XtraRichEdit.RichEditControl.MailMerge.overloads) method - accepts the settings object as a parameter. + +In this project, the [RichEditControl.MailMerge](https://docs.devexpress.com/OfficeFileAPI/DevExpress.XtraRichEdit.RichEditControl.MailMerge.overloads) method exports the result to the `RichEditControl` instance located in the **Result** tab. + + +![winforms richedit template tab](./media/richedit-result-tab.png) ## Files to Review @@ -23,13 +38,13 @@ This project uses a two-level **Categories-Products** hierarchical data source, ## Documentation -* [How to: Create a Master-Detail Report](https://docs.devexpress.com/OfficeFileAPI/15329/word-processing-document-api/examples/mail-merge/master-detail-report) +* [Mail Merge in Rich Text Documents](https://docs.devexpress.com/WindowsForms/9330/controls-and-libraries/rich-text-editor/mail-merge) -## Does this example address your development requirements/objectives? - -[](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=winforms-richedit-create-a-master-detail-report&~~~was_helpful=yes) [](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=winforms-richedit-create-a-master-detail-report&~~~was_helpful=no) - +## Does this example address your development requirements/objectives? + +[](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=winforms-richedit-create-a-master-detail-report&~~~was_helpful=yes) [](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=winforms-richedit-create-a-master-detail-report&~~~was_helpful=no) + (you will be redirected to DevExpress.com to submit your response) diff --git a/media/richedit-result-tab.png b/media/richedit-result-tab.png new file mode 100644 index 0000000..f93358a Binary files /dev/null and b/media/richedit-result-tab.png differ diff --git a/media/richedit-template-tab.png b/media/richedit-template-tab.png new file mode 100644 index 0000000..53d9e28 Binary files /dev/null and b/media/richedit-template-tab.png differ