private void MailMerge_FieldMerged(object sender, TXTextControl.DocumentServer.MailMerge.FieldMergedEventArgs e) { // custom field handling if (e.TableCell == null) { return; } // if TableCell.Name has instructions, create a CellFilterInstructions object // and evaluate the instructions and set the table cell color if (e.TableCell.Name != "") { CellFilterInstructions instructions = (CellFilterInstructions)JsonConvert.DeserializeObject(e.TableCell.Name, typeof(CellFilterInstructions)); // retrieve the color Color?color = instructions.GetColor(e.MailMergeFieldAdapter.ApplicationField.Text); // apply the color if (color != null) { e.TableCell.CellFormat.BackColor = (Color)color; } } }
private void mailMerge1_FieldMerged(object sender, TXTextControl.DocumentServer.MailMerge.FieldMergedEventArgs e) { ApplicationField field = e.MailMergeFieldAdapter.ApplicationField; field.Text = field.Text.Replace(@"\r\n", "\r\n"); }