This example implements the IUriStreamProvider to insert images from a database.
The INCLUDEPICTURE
field in the template has a nested MERGEFIELD
that refers to the CategodyID field from the database. The "dbimg://" prefix is a stream generated by the IUriStreamProvider implementation. The GetStream method parses the received URI (the INCLUDEPICTURE
field), finds the required data row, and returns the MemoryStream
with an image.
Tip
You can use a DOCVARIABLE field to insert images to a template. Refer to the following topic for more information: Handle the CalculateDocumentVariable Event to Insert a Document Element
- Program.cs (VB: Program.vb)
- ImageStreamProvider.cs (VB: ImageStreamProvider.vb)
- NorthwindDataProvider.cs (VB: NorthwindDataProvider.vb)
- How to: Embed Images into a Mail Merge Template
- How to: Implement Mail Merge in a RichEditControl
- How to: Use Multiple Data Sources for a Mail Merge
- How to: Send a Mail-Merge Document as an E-mail
- How to: Import HTML Files that Contain Images Referenced with a Custom Prefix
(you will be redirected to DevExpress.com to submit your response)