-
Notifications
You must be signed in to change notification settings - Fork 0
create readme #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
87bf1be
create readme
geumjaLee ee5122c
Created a new file CODEOWNERS [skip ci]
DevExpressExampleBot b46958f
Created a new file vale.yml [skip ci]
DevExpressExampleBot 1daddbb
README auto update [skip ci]
022fd61
update documents
geumjaLee 0023c54
Merge branch 'readme-update' of https://github.com/DevExpress-Example…
geumjaLee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: vale-validation | ||
on: | ||
pull_request: | ||
paths: | ||
- README.md | ||
|
||
jobs: | ||
vale: | ||
name: runner / vale | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: clone repo | ||
uses: actions/checkout@v4 | ||
- name: clone vale-styles repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: DevExpress/vale-styles | ||
path: vale-styles | ||
ssh-key: ${{ secrets.VALE_STYLES_ACCESS_KEY }} | ||
- name: copy vale rules to the root repo | ||
run: shopt -s dotglob && cp -r ./vale-styles/vale/* . | ||
- name: vale linter check | ||
uses: DevExpress/vale-action@reviewdog | ||
with: | ||
files: README.md | ||
fail_on_error: true | ||
filter_mode: nofilter | ||
reporter: github-check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @DevExpressExampleBot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!-- default badges list --> | ||
[](https://docs.devexpress.com/GeneralInformation/403183) | ||
[](#does-this-example-address-your-development-requirementsobjectives) | ||
<!-- default badges end --> | ||
# Word Processing Document API - How to Automate Mail Merge: Generate, Populate, and Export Documents | ||
|
||
This sample project demonstrates how to use the mail merge feature to generate a template, populate it with data, and export the result to a DOCX file. | ||
|
||
 | ||
|
||
## Implementation Details | ||
|
||
The [RichEditDocumentServer.LoadDocument](https://docs.devexpress.com/OfficeFileAPI/DevExpress.XtraRichEdit.RichEditDocumentServer.LoadDocument.overloads) method call loads a document template. The `AddMailMergeFields` method implementation inserts the **INCLUDEPICTURE** and **MERGEFIELD** fields into the template's main body, and the **INCLUDEPICTURE** field to the footer. | ||
|
||
The document template contains the DOCVARIABLE field that inserts the number of years the employee has worked at the company. The nested MERGEFIELD refers to the **HireDate** entry in the database. This field value is calculated in the [CalculateDocumentVariable](https://docs.devexpress.com/OfficeFileAPI/DevExpress.XtraRichEdit.RichEditDocumentServer.CalculateDocumentVariable) event handler. | ||
|
||
The `ImageStreamProvider` class is used to insert images from a database. The `GetStream` method parses the received URI (the INCLUDEPICTURE field), finds the required data row, and returns the `MemoryStream` containing an image. | ||
|
||
This project uses an XML file as the data source. The mail merge result is saved to the DOCX file. | ||
|
||
## Files to Review | ||
|
||
| C# | Visual Basic | | ||
|---------|----------| | ||
| [Program.cs](./CS/WordProcessingMailMerge/Program.cs) | [Program.vb](./VB/WordProcessingMailMerge/Program.vb) | | ||
| [ImageStreamProvider.cs](./CS/WordProcessingMailMerge/ImageStreamProvider.cs) | [ImageStreamProvider.vb](./VB/WordProcessingMailMerge/ImageStreamProvider.vb) | | ||
|
||
## More Examples | ||
|
||
* [How to Use DOCVARIABLE Fields in a Document](https://github.com/DevExpress-Examples/word-document-api-use-docvariable-fields) | ||
* [How to: Embed Images into a Mail Merge Template](https://github.com/DevExpress-Examples/how-to-use-images-in-richedit-mail-merge) | ||
* [How to: Send a Mail-Merge Document as an E-mail](https://github.com/DevExpress-Examples/word-document-api-send-mail-merge-document-as-email) | ||
* [How to: Import HTML Files that Contain Images Referenced with a Custom Prefix](https://github.com/DevExpress-Examples/how-to-import-html-files-that-contain-images-referenced-with-custom-prefix) | ||
|
||
## Documentation | ||
|
||
* [Mail Merge in Word Processing Document API](https://docs.devexpress.com/OfficeFileAPI/15277/word-processing-document-api/mail-merge) | ||
* [How to: Insert Dynamic Content](https://docs.devexpress.com/OfficeFileAPI/401197/word-processing-document-api/examples/text/how-to-insert-dynamic-content) | ||
* [How to: Replace a Placeholder with a Document Element](https://docs.devexpress.com/OfficeFileAPI/404369/word-processing-document-api/examples/search-and-replace/how-to-replace-a-placeholder-with-a-document-element) | ||
<!-- feedback --> | ||
## Does this example address your development requirements/objectives? | ||
|
||
[<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-mail-merge&~~~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-mail-merge&~~~was_helpful=no) | ||
|
||
(you will be redirected to DevExpress.com to submit your response) | ||
<!-- feedback end --> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.