TX Text Control .NET Server

ReportingMergeBlockFormat Property

Property|Introduced in 24.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

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; }

Members

ValueDescription
DefaultThe document is saved as it is. Reporting merge blocks are not converted.
DocumentTargetsIf the document contains reporting merge blocks marked with subtextparts, these subtextparts are converted to document targets.
SubTextPartsThis 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);
}