Your problem may come from the lines like the following one:
dispString = dispString + "<th class="printHeaderText" style="width:10%;text-align:left;border-removedsolid 1px gray;">LnNo</th>";
First, as you are trying to put some double-quotes in a string, you have to esacepe them, so they are not considered as double-quote string delimiters.
But the best option may be to use a StringBuilder here, as you concatenate several strings alltogether ; performance could even be improved.
So your code should look like:
StringBuilder sb = new StringBuilder("<table cellspacing=\"0\" cellpadding=\"2\" class=\"fullborder\" style=\"background-color:FFFFE5;width:100%;font-size:11px;font-family:Verdana;\">");
sb.Append("<th class=\"printHeaderText\" style=\"width:10%;text-align:left;border-removedsolid:1px\" mode=\"hold\" />
sb.Append("<th class=\"printHeaderText\" style=\"width:10%;text-align:left;border-removedsolid:1px=\" mode=\"hold\" />
sb.Append("<th class=\"printHeaderText\" style=\"width:10%;text-align:left;border-removedsolid:1px\" mode=\"hold\" />
// ... and so on.
</table>
The
StringBuilder.AppendFormat(string, params object[])
method could also be useful.
Important thing to remeber is: if you want to insert double-quotes in a string, you have either to escape the double-quote itself (with the '\' character), or double it ('""').
Example:
Imagine you want to store the sentence:
I want to insert the " sign in my string.
in a string.
You can write:
string text = "I want to insert the \" sign in my string.";
OR
string text = "I want to insert the "" sign in my string.";