TX Text Control .NET for Windows Forms

MergeJsonData Method

Method|Introduced in 24.0
Namespace
TXTextControl.DocumentServer
Package
TXTextControl.TextControl.WinForms.SDK as TXDocumentServer.dll from the private NuGet feed or Text Control Offline Packages

Description

Merges data given as a JSON string into a document template. The JSON string has to contain either a single object or an array of equally structured objects. Analyzes and uses the given object(s) as merge data in the same way as the method MergeObjects.

Syntax

MergeJsonData(string, bool)

Merges data given as a JSON string into a document template. The JSON string has to contain either a single object or an array of equally structured objects.

public void MergeJsonData(string json, bool append);
ParameterDescription
json

The JSON string containing the merge data.

append

Specifies whether the merge result should be merged into one document or split into separate documents.

MergeJsonData(string)

Does the same as MergeJsonData with the parameter “append” set to true.

public void MergeJsonData(string json);
ParameterDescription
json

The JSON string containing the merge data.

Examples

The following example uses Merge Json Data in a focused Mail Merge workflow. The created object is then available to the surrounding document workflow.

mailMerge.MergeJsonData("Quarterly report", true);
Console.WriteLine("Mail Merge is ready for use.");