Current filter:
                                You should refresh the page.
                                  • I have report which uses a Rich Text  (HTML) control. The datasource is SQL server query in which I have two fields which I want to join before printing is performed.

                                    I do not know in which event I need to can pug this code in so my the HTML table is appended to the text field.

                                    [C#]
                                    private void richText1_EvaluateBinding(object sender, BindingEventArgs e) { var obj = GetCurrentColumnValue("CustomValue").ToString(); if (!string.IsNullOrEmpty(obj)) { var z = new { Columns = new List<Column>(), Items = new List<dynamic>() }; var result = JsonConvert.DeserializeAnonymousType(obj.ToString(), z); var t = "<table>"; //build header for (int k = 0; k < result.Columns.Count; k++) { if (k == 0) t = t + "<th>"; t += $"<td>{result.Columns[k].Caption}</td>"; if (k == result.Columns.Count - 1) t = t + "</th>"; } for (int i = 0; i < result.Items.Count; i++) { var row = result.Items[i]; for (int j = 0; j < result.Columns.Count; j++) { if (j == 0) t = t + "<tr>"; var prop = result.Columns[j].DataField; var val = row[prop]; t += $"<td>{val}</td>"; if (j == result.Items.Count - 1) t = t + "</tr>"; } } t += "</table>"; richText1.Text += t; }

                                1 Solution

                                Creation Date Importance Sort by

                                Hello,
                                If you need to show merged HTML content from two data fields in the XRRichText control, the best way to accomplish this task is to handle its EvaluateBinding event in the following manner:

                                [C#]
                                private void XrRichText1_EvaluateBinding(object sender, BindingEventArgs e) { string value1 = GetCurrentColumnValue("Field1").ToString(); string value2 = GetCurrentColumnValue("Field2").ToString(); e.Value = value1 + value2; }

                                Please try this solution and let me know your result.

                                • Customer82100 08.09.2019

                                  Awesome! Thanks

                                • Andrey (DevExpress Support) 08.09.2019

                                  You're welcome.