Thursday, January 3, 2008

Generating html report in C#

//Please System.Text Namespace for define the StringBuilder Varibale the String.
// and take a label or

or panel what you have comfortable for show the reports.

StringBulider strHTML=new StringBulider();

strHTML.Append("

");
while (oDr.Read())
{
strHTML.Append("");
strHTML.Append("");
strHTML.Append("");
strHTML.Append("");
strHTML.Append("");
strHTML.Append("");
strHTML.Append("");
strHTML.Append("");
strHTML.Append("");
strHTML.Append("");
strHTML.Append("");
strHTML.Append("");
strHTML.Append("");
}
strHTML.Append("
" + oDr["Req ID"].ToString() + "" + oDr["Date"].ToString() + "" + oDr["Job Description"].ToString() + "" + oDr["Job Classification"].ToString() + "" + oDr["Loc"].ToString() + "" + oDr["Client"].ToString() + "" + oDr["#"].ToString() + "" + oDr["Duration"].ToString() + "" + oDr["Rate"].ToString() + "" + oDr["Sales Person"].ToString() + "" + oDr["Sales Person"].ToString() + "
");
lblShow.Text=strHTML.ToString()

and here no needs for any varibales

Which i have understand your problem that is way i am give you answer.

No comments: