ReportingMergeBlockFormat Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Specifies how reporting merge blocks are handled when a document is saved. Reporting merge blocks can be saved in a document either through special document targets represented through DocumentTarget objects or through special subtextparts represented through SubTextPart objects. When a merge block is marked with document targets, the name of the starting marker begins with blockstart_ and the name of the ending marker begins with blockend_. When a merge block is marked through a subtextpart, its name begins with txmb_.
Syntax
public ReportingMergeBlockFormat ReportingMergeBlockFormat { get; set; }Public Property ReportingMergeBlockFormat As ReportingMergeBlockFormatMembers
| Value | Description |
|---|---|
| Default | The document is saved as it is. Reporting merge blocks are not converted. |
| DocumentTargets | If the document contains reporting merge blocks marked with subtextparts, these subtextparts are converted to document targets. |
| SubTextParts | This member is not used, when a document is saved. |
Examples
The following example preserves reporting merge blocks while loading or saving a template. The configured base settings are then used by the appropriate load or save operation.
loadSaveSettingsBase.ReportingMergeBlockFormat = ReportingMergeBlockFormat.SubTextParts;
if (loadSaveSettingsBase is LoadSettings loadSettings)
{
textControl.Load("template.docx", StreamType.WordprocessingML, loadSettings);
}
else if (loadSaveSettingsBase is SaveSettings saveSettings)
{
textControl.Save("configured-document.docx", StreamType.WordprocessingML, saveSettings);
}loadSaveSettingsBase.ReportingMergeBlockFormat = ReportingMergeBlockFormat.SubTextParts
If TypeOf loadSaveSettingsBase Is LoadSettings Then
textControl.Load("template.docx", StreamType.WordprocessingML, DirectCast(loadSaveSettingsBase, LoadSettings))
ElseIf TypeOf loadSaveSettingsBase Is SaveSettings Then
textControl.Save("configured-document.docx", StreamType.WordprocessingML, DirectCast(loadSaveSettingsBase, SaveSettings))
End If