|
1 | 1 | <!-- default badges list --> |
2 | | - |
3 | 2 | [](https://supportcenter.devexpress.com/ticket/details/E4718) |
4 | 3 | [](https://docs.devexpress.com/GeneralInformation/403183) |
5 | 4 | [](#does-this-example-address-your-development-requirementsobjectives) |
6 | 5 | <!-- default badges end --> |
7 | 6 |
|
8 | | -# Word Processing Document API - How to Create a Master-Detail Report |
| 7 | +# Word Processing Document API - Generate, Populate, and Export Master-Detail Invoices |
9 | 8 |
|
10 | | -This example shows how the Mail Merge feature enhanced with the **DOCVARIABLE** field specifics empowers the users to accomplish complex reporting tasks, such as creating Master-Detail reports. |
| 9 | +This example demonstrates the use of the [Word Processing Document API](https://docs.devexpress.com/OfficeFileAPI/17488/word-processing-document-api)'s Mail Merge functionality to generate invoices from master-detail templates. |
| 10 | + |
| 11 | + |
11 | 12 |
|
12 | 13 | > [!Important] |
13 | | -> The Universal Subscription or an additional Office File API Subscription is required to use this example in production code. For pricing information, please refer to the [DevExpress Subscription](https://www.devexpress.com/Subscriptions/) page. |
| 14 | +> The Universal Subscription or an additional Office File API Subscription is required to use this example in production code. For pricing information, please refer to the following page: [DevExpress Subscription](https://www.devexpress.com/buy/winforms-wpf-blazor-asp-net-maui/) |
| 15 | +
|
| 16 | +## Implementation Details |
| 17 | + |
14 | 18 |
|
15 | | -The project uses a three-level Supplier-Product-OrderDetail hierarchical data source with the **ITypedList** interface. |
| 19 | +Word Processing Document API allows you to perform a mail merge with master-detail templates. The ``TableStart:Name`` and ``TableEnd:Name`` merge fields define master and detail regions. The region name should match the group or table name in your data source. |
16 | 20 |
|
17 | | -## Files to Look At: |
18 | 21 |
|
19 | | -* [MergeProcessor.cs](./CS/MergeProcessor.cs) (VB: [MergeProcessor.vb](./VB/MergeProcessor.vb)) |
| 22 | + Call the [RichEditDocumentServer.CreateMailMergeOptions()](https://docs.devexpress.com/OfficeFileAPI/DevExpress.XtraRichEdit.RichEditDocumentServer.CreateMailMergeOptions) method to create a new [MailMergeOptions](https://docs.devexpress.com/OfficeFileAPI/DevExpress.XtraRichEdit.API.Native.MailMergeOptions) object. This object contains mail merge options. Specify the object's [DataSource](https://docs.devexpress.com/OfficeFileAPI/DevExpress.XtraRichEdit.RichEditMailMergeOptions.DataSource) property to set the mail merge database. This example uses sample `NWind` data converted to a flat JSON database file. |
| 23 | + |
| 24 | + Pass the `MailMergeOptions` object as the [RichEditDocumentServer.MailMerge](https://docs.devexpress.com/OfficeFileAPI/DevExpress.XtraRichEdit.RichEditDocumentServer.MailMerge.overloads) method parameter to apply specified options. |
| 25 | + |
| 26 | +## Files to Review: |
| 27 | + |
| 28 | +* [NWindData.cs](./CS/NWindData.cs) (VB: [NWindData.vb](./VB/NWindData.vb)) |
20 | 29 | * [Program.cs](./CS/Program.cs) (VB: [Program.vb](./VB/Program.vb)) |
| 30 | + |
| 31 | +## Documentation |
| 32 | + |
| 33 | + * [Mail Merge in Word Processing Document API](https://docs.devexpress.com/OfficeFileAPI/15277/word-processing-document-api/mail-merge) |
| 34 | + |
| 35 | +## More Examples |
| 36 | + |
| 37 | +* [How to Automate Mail Merge: Generate, Populate, and Export Documents](https://github.com/DevExpress-Examples/word-document-api-mail-merge) |
| 38 | + |
21 | 39 | <!-- feedback --> |
22 | | -## Does this example address your development requirements/objectives? |
23 | | - |
24 | | -[<img src="https://www.devexpress.com/support/examples/i/yes-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=word-document-api-create-master-detail-report&~~~was_helpful=yes) [<img src="https://www.devexpress.com/support/examples/i/no-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=word-document-api-create-master-detail-report&~~~was_helpful=no) |
25 | | - |
| 40 | +## Does this example address your development requirements/objectives? |
| 41 | + |
| 42 | +[<img src="https://www.devexpress.com/support/examples/i/yes-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=word-document-api-create-master-detail-report&~~~was_helpful=yes) [<img src="https://www.devexpress.com/support/examples/i/no-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=word-document-api-create-master-detail-report&~~~was_helpful=no) |
| 43 | + |
26 | 44 | (you will be redirected to DevExpress.com to submit your response) |
27 | 45 | <!-- feedback end --> |
| 46 | + |
0 commit comments