Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created February 17, 2022 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/5b25b1e6ae8c86591fe9e19d9c2064b1 to your computer and use it in GitHub Desktop.
Save bjoerntx/5b25b1e6ae8c86591fe9e19d9c2064b1 to your computer and use it in GitHub Desktop.
// load the template
textControl1.Load("template.tx", TXTextControl.StreamType.InternalUnicodeFormat);
// get the "outofstock" SubTextPart
SubTextPart subTextPart = textControl1.SubTextParts.GetItem("txmb_outofstock");
// create a MergeBlockInfo object
MergeBlockInfo mergeBlockInfo = new MergeBlockInfo(subTextPart);
// add the condition
mergeBlockInfo.BlockMergingCondition =
new List<TXTextControl.DocumentServer.DataShaping.FilterInstruction>()
{
new TXTextControl.DocumentServer.DataShaping.FilterInstruction(
"available",
TXTextControl.DocumentServer.DataShaping.RelationalOperator.Equals,
false
)
};
// store the condition in the SubTextPart
mergeBlockInfo.Apply();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment