not sure that you can render control programmatically inside wcf service or not. What you can do is create HTML based on your data like below.
assume you have datatable then
public static string ConvertDataTableToHTML(DataTable dt)
{
string html = "<table>";
html += "<tr>";
for(int i=0;i<dt.columns.count;i++)>
html+="<td>"+dt.Columns[i].ColumnName+"</td>";
html += "</tr>";
for (int i = 0; i < dt.Rows.Count; i++)
{
html += "<tr>";
for (int j = 0; j< dt.Columns.Count; j++)
html += "<td>" + dt.Rows[i][j].ToString() + "</td>";
html += "</tr>";
}
html += "</table>";
return html;
}
As per
This question answers[
^]
you can try by turning on ASP.NET compatibility mode in your WCF configuration.