TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ANIRUDDHA KULKARNI
NA
2
516
created html reports not displayed in browser
Apr 4 2018 2:42 AM
hi
i have created html report using postgresql database and string builder after generating html is not displayed in browser. browser shows blank page.
public
string
showHtml(
string
applnid)
{
StringBuilder sb =
new
StringBuilder();
sb.Append(
"<!DOCTYPE html>"
);
sb.Append(
"<html>"
);
sb.Append(
"<head>"
);
//sb.Append("<style> table, th, td {border: 1px solid black;border-collapse: collapse;}th, td {padding: 15px;}</style>");
sb.Append(
"<style> table { width:100%;}table, th, td {border: 1px solid black; border-collapse: collapse;}th, td {padding: 5px;text-align: left;}table#t01 tr:nth-child(even) { background-color: #eee;}table#t01 tr:nth-child(odd) { background-color:#f1f1c1;}table#t01 th { background-color: CornflowerBlue;color: white;}</style>"
);
sb.Append(
"<meta charset=UTF-8>"
);
sb.Append(
"<title> ???? </title>"
);
sb.Append(
"<center><tr>"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> ???? ??? : - "
);
sb.Append(applnid);
sb.Append(
"</tr></center>"
);
sb.Append(
"<head>"
);
sb.Append(
"<body>"
);
sb.Append(
"<table style='left: 4px; border-right: black thin solid; border-top: black thin solid; border-left: black thin solid; border-bottom: black thin solid;' width='100%' id=t01>"
);
sb.Append(
"<tr >"
);
sb.Append(
"<td style='text-align: left; vertical-align:text-top' >"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> ?????????? ??? : "
);
sb.Append(dsApplicant.Tables[0].Rows[0][
"applicant_fullname"
]);
sb.Append(
"</span></strong></td>"
);
sb.Append(
"<td style=' text-align: center'>"
);
sb.Append(
"</tr>"
);
sb.Append(
"<tr >"
);
sb.Append(
"<td style='text-align: left; vertical-align:text-top' >"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> ?????? ?????? : "
);
sb.Append(
""
+ dsApplicant.Tables[0].Rows[0][
"mut_name"
] +
""
);
sb.Append(
"</span></strong></td>"
);
sb.Append(
"<td style='text-align: left; vertical-align:text-top' >"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> ???? ?????? : "
);
sb.Append(
""
+ dsApplicant.Tables[0].Rows[0][
"application_date"
] +
""
);
sb.Append(
"</span></strong></td>"
);
sb.Append(
"</tr>"
);
sb.Append(
"</table>"
);
/* sb.Append("<center><tr>");
sb.Append("<strong><span style='font-family: Sakal Marathi; '> ????????? ??? : - ");
sb.Append("</tr></center>");
sb.Append("<Table style='left: 4px; border-right: black thin solid; border-top: black thin solid; border-left: black thin solid; border-bottom: black thin solid;' width='100%' id=t01>");
sb.Append("<tr>");
sb.Append("<th>");
sb.Append("<strong><span style='font-family: Sakal Marathi; '> ???? ??? ");
sb.Append("</th>");
sb.Append("<th>");
sb.Append("<strong><span style='font-family: Sakal Marathi; '> ??? ");
sb.Append("</th>");
sb.Append("<th>");
sb.Append("<strong><span style='font-family: Sakal Marathi; '> ?????? ?????? ");
sb.Append("</th>");
sb.Append("</tr>");
sb.Append("<tr>");
for (int i = 0; i < dsAkumi.Tables[0].Rows.Count; i++)
{
sb.Append("<tr>");
sb.Append("<td>");
sb.Append(dsAkumi.Tables[0].Rows[i]["khata_no"].ToString());
sb.Append("</td>");
sb.Append("<td>");
sb.Append(dsAkumi.Tables[0].Rows[i]["mayat_fullname"].ToString());
sb.Append("</td>");
sb.Append("<td>");
sb.Append(dsAkumi.Tables[0].Rows[i]["mayat_date"].ToString());
sb.Append("</td>");
sb.Append("</tr>");
}
sb.Append("</Table>");*/
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> ????????? ??? : - "
);
sb.Append(dsSurvey.Tables[0].Rows[0][
"name"
]);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> ???????? ????? ???. : "
);
sb.Append(
"<Table style='left: 4px; border-right: black thin solid; border-top: black thin solid; border-left: black thin solid; border-bottom: black thin solid;' width='100%' id=t01>"
);
sb.Append(
"<tr>"
);
sb.Append(
"<th>"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> pin "
);
sb.Append(
"</th>"
);
sb.Append(
"<th>"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> pin1 "
);
sb.Append(
"</th>"
);
sb.Append(
"<th>"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> pin2 "
);
sb.Append(
"</th>"
);
sb.Append(
"<th>"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> pin3"
);
sb.Append(
"</th>"
);
sb.Append(
"<th>"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> pin4 "
);
sb.Append(
"</th>"
);
sb.Append(
"<th>"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> pin5 "
);
sb.Append(
"</th>"
);
sb.Append(
"<th colspan=4>"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> pin6"
);
sb.Append(
"</th>"
);
sb.Append(
"<th colspan=4>"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> pin7"
);
sb.Append(
"</th>"
);
sb.Append(
"<th colspan=4>"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> pin8"
);
sb.Append(
"</th>"
);
sb.Append(
"<th colspan=4>"
);
sb.Append(
"<strong><span style='font-family: Sakal Marathi; '> ferfar_no"
);
sb.Append(
"</th>"
);
//sb.Append("<th>");
//sb.Append("<strong><span style='font-family: Sakal Marathi; '> ???? MNAME");
//sb.Append("</th>");
//sb.Append("<th>");
//sb.Append("<strong><span style='font-family: Sakal Marathi; '> ???? LNAME");
//sb.Append("</th>");
//sb.Append("<th>");
//sb.Append("<strong><span style='font-family: Sakal Marathi; '> ???? TOPANNAME");
//sb.Append("</th>");
//sb.Append("<th>");
//sb.Append("<strong><span style='font-family: Sakal Marathi; '> ????");
//sb.Append("</th>");
sb.Append(
"</tr>"
);
for
(
int
i = 0; i < dsSurvey.Tables[0].Rows.Count; i++)
{
sb.Append(
"<tr>"
);
sb.Append(
"<td>"
);
sb.Append(dsSurvey.Tables[0].Rows[i][
"pin"
].ToString());
sb.Append(
"</td>"
);
sb.Append(
"<td>"
);
sb.Append(dsSurvey.Tables[0].Rows[i][
"pin1"
].ToString());
sb.Append(
"</td>"
);
sb.Append(
"<td>"
);
sb.Append(dsSurvey.Tables[0].Rows[i][
"pin2"
].ToString());
sb.Append(
"</td>"
);
sb.Append(
"<td>"
);
sb.Append(dsSurvey.Tables[0].Rows[i][
"pin3"
].ToString());
sb.Append(
"</td>"
);
sb.Append(
"<td>"
);
sb.Append(dsSurvey.Tables[0].Rows[i][
"pin4"
].ToString());
sb.Append(
"</td>"
);
sb.Append(
"<td>"
);
sb.Append(dsSurvey.Tables[0].Rows[i][
"pin5"
].ToString());
sb.Append(
"</td>"
);
sb.Append(
"<td>"
);
sb.Append(dsSurvey.Tables[0].Rows[i][
"pin6"
].ToString());
sb.Append(
"</td>"
);
sb.Append(
"<td>"
);
sb.Append(dsSurvey.Tables[0].Rows[i][
"pin7"
].ToString());
sb.Append(
"</td>"
);
sb.Append(
"<td>"
);
sb.Append(dsSurvey.Tables[0].Rows[i][
"pin8"
].ToString());
sb.Append(
"</td>"
);
sb.Append(
"<td>"
);
sb.Append(dsSurvey.Tables[0].Rows[i][
"ferfar_no"
].ToString());
sb.Append(
"</td>"
);
sb.Append(
"</tr>"
);
}
sb.Append(
"</Table>"
);
return
Convert.ToString(sb);
}
Reply
Answers (
0
)
Add to cart functionality
i want to append button on dynamically generated classes