Hi smile,
I have created sample. Refer below code and adjust the table cell as per the design you want.
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$("[src*=plus]").live("click", function () {
$(this).closest("tr").after("<tr><td></td><td colspan = '999'>" + $(this).next().html() + "</td></tr>")
$(this).attr("src", "images/minus.png");
});
$("[src*=minus]").live("click", function () {
$(this).attr("src", "images/plus.png");
$(this).closest("tr").next().remove();
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" CssClass="Grid"
DataKeyNames="AdmissionNo" OnRowDataBound="OnRowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<img alt="" style="cursor: pointer" src="images/plus.png" />
<asp:Panel ID="pnlOrders" runat="server" Style="display: none">
<asp:GridView ID="gvResult" runat="server" AutoGenerateColumns="false" CssClass="ChildGrid">
<Columns>
<asp:BoundField DataField="Sr.No" HeaderText="S.I" />
<asp:BoundField DataField="SubjectName" HeaderText="Subject" />
<asp:BoundField DataField="MaxMarks" HeaderText="Total" />
<asp:BoundField DataField="Marks" HeaderText="Obtain" />
<asp:BoundField DataField="Percentage" HeaderText="%age" />
<asp:BoundField DataField="Grade" HeaderText="Grade" />
<asp:BoundField DataField="Remarks" HeaderText="Remarks" />
<asp:BoundField DataField="Position" HeaderText="Position" />
</Columns>
</asp:GridView>
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="AdmissionNo" HeaderText="Registration Number" />
<asp:BoundField DataField="SName" HeaderText="Student Name" />
<asp:BoundField DataField="FName" HeaderText="Father Name" />
<asp:BoundField DataField="ClassName" HeaderText="Class" />
<asp:BoundField DataField="SectionName" HeaderText="Section" />
<asp:TemplateField HeaderText="Image">
<ItemTemplate>
<asp:Image ID="Image1" runat="server" class="img-circle img-responsive" ImageUrl='<%# "data:image/jpg;base64," + Convert.ToBase64String((byte[])Eval("SPic")) %>'
Height="50px" Width="50px" />
<br />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<br />
<asp:Button ID="Button1" Text="Export" runat="server" OnClick="btnMultiple_Click" />
</div>
</form>
</body>
</html>
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindSectionGrid();
}
}
private void BindSectionGrid()
{
DataTable sTable = new DataTable();
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings[1].ConnectionString);
SqlCommand cmd = new SqlCommand("SELECT * FROM sTable", con);
con.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(sTable);
con.Close();
if (sTable.Rows.Count > 0)
{
GridView1.DataSource = sTable;
GridView1.DataBind();
}
else
{
Response.Write("No Record Found");
return;
}
}
protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string Id = GridView1.DataKeys[e.Row.RowIndex].Value.ToString();
GridView gvOrders = e.Row.FindControl("gvResult") as GridView;
DataTable mTable = new DataTable();
mTable.Columns.AddRange(new DataColumn[9] {
new DataColumn("AdmissionNo"),new DataColumn("Sr.No"), new DataColumn("SubjectName"), new DataColumn("MaxMarks"),
new DataColumn("Marks"), new DataColumn("Percentage"), new DataColumn("Grade"),new DataColumn("Remarks"), new DataColumn("Position")});
mTable.Rows.Add("R-000267", "1", "Urdu", "25", "24", "96", "A+", "Outstanding", "1");
mTable.Rows.Add("R-000267", "2", "English", "25", "16", "64", "C", "Good", "2");
mTable.Rows.Add("R-000268", "1", "Urdu", "25", "20", "80", "A", "Excellent", "1");
mTable.Rows.Add("R-000268", "2", "English", "25", "18", "72", "B", "Very Good", "2");
gvOrders.DataSource = mTable.Select("AdmissionNo='" + Id + "'").CopyToDataTable();
gvOrders.DataBind();
}
}
protected void btnMultiple_Click(object sender, EventArgs e)
{
int i = 0;
string Reg = null;
string name = null;
string fname = null;
string Cls = null;
string Sec = null;
string spresent = null;
//string stotal = null;
int j = 0;
string si = null;
string Subject = null;
string Totall = null;
string Obtained = null;
string Per = null;
string sgrade = null;
string sremarks = null;
string sposition = null;
string cposition = null;
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=Report-StuExamResultCard-" + "ddlClass.SelectedItem.ToString()" + ".pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Document doc = new Document(PageSize.A4);
PdfWriter writer = PdfWriter.GetInstance(doc, Response.OutputStream);
doc.Open();
try
{
DataTable dt = new DataTable("GridView_Data");
foreach (GridViewRow row in GridView1.Rows)
{
Reg = row.Cells[1].Text;
name = row.Cells[2].Text;
fname = row.Cells[3].Text;
Cls = row.Cells[4].Text;
Sec = row.Cells[5].Text;
spresent = row.Cells[6].Text;
byte[] bytess = Convert.FromBase64String((row.FindControl("Image1") as System.Web.UI.WebControls.Image).ImageUrl.Replace("data:image/jpg;base64,",""));
PdfContentByte content = writer.DirectContent;
Rectangle rectangle = new Rectangle(doc.PageSize);
rectangle.Left += doc.LeftMargin;
rectangle.Right -= doc.RightMargin;
rectangle.Top -= doc.TopMargin;
rectangle.Bottom += doc.BottomMargin;
content.SetColorStroke(BaseColor.BLACK);
content.Rectangle(rectangle.Left, rectangle.Bottom, rectangle.Width, rectangle.Height);
content.Stroke();
//con = new SqlDbConnect();
//con.SqlQuery("select logo,SystemName,Address,Phone,Email FROM tblSystem");
//con.RdrEx();
//while (con.Rdr.Read())
//{
// PdfPTable tablel = new PdfPTable(2);
// tablel.TotalWidth = 500f;
// tablel.LockedWidth = true;
// float[] widths = new float[] { 0.9f, 3f };
// tablel.SetWidths(widths);
// tablel.DefaultCell.Border = 0;
// Byte[] lbytes = (Byte[])con.Rdr[0];
// iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(lbytes);
// image.ScaleAbsolute(100f, 70f);
// PdfPCell Img = new PdfPCell(image);
// Img.Border = 0;
// tablel.AddCell(Img);
// PdfPCell header = new PdfPCell(new Phrase(con.Rdr[1].ToString(), FontFactory.GetFont("Calibri", 35)));
// header.PaddingTop = 10;
// header.HorizontalAlignment = 1;
// header.Border = 0;
// tablel.AddCell(header);
// tablel.AddCell(new Phrase("", FontFactory.GetFont("Calibri", 13)));
// PdfPCell footer = new PdfPCell(new Phrase(con.Rdr[2].ToString() + "\tPhone:" + con.Rdr[3].ToString() + "\t Email:" + con.Rdr[4].ToString(), FontFactory.GetFont("Calibri", 16)));
// footer.HorizontalAlignment = 1;
// footer.Border = 0;
// tablel.AddCell(footer);
// doc.Add(tablel);
// Paragraph p = new Paragraph(new Chunk(new iTextSharp.text.pdf.draw.LineSeparator(1.0F, 100.0F, iTextSharp.text.BaseColor.BLACK, Element.ALIGN_LEFT, 1)));
// doc.Add(p);
//}
PdfPTable table = new PdfPTable(8);
table.DefaultCell.Padding = 10f;
table.DefaultCell.BackgroundColor = iTextSharp.text.BaseColor.WHITE;
table.DefaultCell.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
table.HorizontalAlignment = Element.ALIGN_CENTER;
table.DefaultCell.HorizontalAlignment = 1;
table.TotalWidth = 500f;
table.LockedWidth = true;
table.DefaultCell.Border = PdfPCell.NO_BORDER;
//table.DefaultCell.CellEvent = new RoundedBorder();
PdfPTable nested = new PdfPTable(6);
float[] width = new float[] { 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f };
nested.SetWidths(width);
nested.DefaultCell.BackgroundColor = iTextSharp.text.BaseColor.WHITE;
nested.DefaultCell.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
nested.DefaultCell.Padding = 5f;
nested.DefaultCell.Border = 0;
nested.AddCell(new Phrase("Reg No.", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested.AddCell(new Phrase(Reg, FontFactory.GetFont(FontFactory.HELVETICA, 8)));
nested.AddCell(new Phrase("Session", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested.AddCell(new Phrase("First Session", FontFactory.GetFont(FontFactory.HELVETICA, 8)));
nested.AddCell(new Phrase("Image", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(bytess);
image.ScalePercent(50f);
PdfPCell cell = new PdfPCell(image);
cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
cell.VerticalAlignment = PdfPCell.ALIGN_CENTER;
cell.PaddingBottom = 0f;
cell.PaddingTop = 0f;
nested.AddCell(cell);
nested.AddCell(new Phrase("Student Name", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested.AddCell(new Phrase(name, FontFactory.GetFont(FontFactory.HELVETICA, 8)));
nested.AddCell(new Phrase("Assessment Term", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested.AddCell(new Phrase("December Exam", FontFactory.GetFont(FontFactory.HELVETICA, 8)));
nested.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA, 8)));
nested.AddCell(new Phrase("Father Name", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested.AddCell(new Phrase(fname, FontFactory.GetFont(FontFactory.HELVETICA, 8)));
nested.AddCell(new Phrase("Attendance", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested.AddCell(new Phrase(spresent, FontFactory.GetFont(FontFactory.HELVETICA, 8)));
nested.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA, 8)));
nested.AddCell(new Phrase("Class", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested.AddCell(new Phrase(Cls, FontFactory.GetFont(FontFactory.HELVETICA, 8)));
nested.AddCell(new Phrase("Section", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested.AddCell(new Phrase(Sec, FontFactory.GetFont(FontFactory.HELVETICA, 8)));
nested.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA, 8)));
PdfPCell nesthousing = new PdfPCell(nested);
nesthousing.BackgroundColor = iTextSharp.text.BaseColor.WHITE;
nesthousing.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
nesthousing.Colspan = 7;
nesthousing.Padding = 0f;
nesthousing.Border = PdfPCell.NO_BORDER;
//nesthousing.CellEvent = new RoundedBorder();
table.AddCell(nesthousing);
// iTextSharp.text.Image imag = iTextSharp.text.Image.GetInstance(bytess);
//imag.ScaleToFit(45F, 50F);
PdfPCell bottom = new PdfPCell();
bottom.Padding = 5f;
bottom.BackgroundColor = iTextSharp.text.BaseColor.WHITE;
bottom.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
bottom.HorizontalAlignment = 1;
bottom.Border = PdfPCell.NO_BORDER;
//bottom.CellEvent = new RoundedBorder();
table.AddCell(bottom);
GridView gvResult = (row.FindControl("gvResult") as GridView);
int Total = 0;
for (int l = 0; l < gvResult.Rows.Count; ++l)
{
Total += Convert.ToInt32(gvResult.Rows[l].Cells[2].Text);
}
int marks = 0;
for (int l = 0; l < gvResult.Rows.Count; ++l)
{
marks += Convert.ToInt32(gvResult.Rows[l].Cells[3].Text);
}
float per = marks * 100 / Total;
string grade = null;
string cRemarks = null;
string tRemarks = null;
if (per >= 90)
{
grade = "A+";
cRemarks = "Out Standing";
}
else if (per >= 80 && per < 90)
{
grade = "A";
cRemarks = "Excellent";
}
else if (per >= 70 && per < 80)
{
grade = "B";
cRemarks = "Very Good";
}
else if (per >= 60 && per < 70)
{
grade = "C";
cRemarks = "Good";
}
else if (per >= 50 && per < 60)
{
grade = "D";
cRemarks = "Satisfactory";
}
else if (per < 50)
{
grade = "E";
cRemarks = "Work Hard";
}
if (per >= 90)
{
tRemarks = "His/Her performance has been outstanding.Keep it up.";
}
else if (per >= 80 && per < 90)
{
tRemarks = "Keep up the good work.All the best.";
}
else if (per >= 70 && per < 80)
{
tRemarks = "He/She has the potential to do more.All the best.";
}
else if (per >= 60 && per < 70)
{
tRemarks = "He/She has been doing good in studies.";
}
else if (per >= 50 && per < 60)
{
tRemarks = "He/She needs to work hard in order to improve his/her grades.";
}
else if (per < 50)
{
tRemarks = "He/She is advised to pay attention towards studies.";
}
PdfPCell head1 = new PdfPCell(new Phrase("Student Marks Detail", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
//head1.BackgroundColor = new iTextSharp.text.BaseColor(191, 208, 247);
//head1.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
head1.Indent = 10;
head1.HorizontalAlignment = 1;
head1.Colspan = 8;
head1.Padding = 10;
head1.Border = PdfPCell.NO_BORDER;
//head1.CellEvent = new RoundedBorder();
table.AddCell(head1);
PdfPTable nested1 = new PdfPTable(8);
nested1.DefaultCell.BackgroundColor = iTextSharp.text.BaseColor.WHITE;
nested1.DefaultCell.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
nested1.DefaultCell.Padding = 7f;
nested1.DefaultCell.Border = 0;
nested1.DefaultCell.HorizontalAlignment = 1;
nested1.AddCell(new Phrase("Sr. No.", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested1.AddCell(new Phrase("Subjects", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested1.AddCell(new Phrase("Max Marks", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested1.AddCell(new Phrase("Obt Marks", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested1.AddCell(new Phrase("% age", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested1.AddCell(new Phrase("Grade", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested1.AddCell(new Phrase("Position", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested1.AddCell(new Phrase("Remarks", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
PdfPCell nesthousing1 = new PdfPCell(nested1);
nesthousing1.BackgroundColor = iTextSharp.text.BaseColor.WHITE;
nesthousing1.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
nesthousing1.Colspan = 8;
nesthousing1.Padding = 0f;
nesthousing1.Border = PdfPCell.NO_BORDER;
//nesthousing1.CellEvent = new RoundedBorder();
table.AddCell(nesthousing1);
for (j = 0; j < gvResult.Rows.Count; j++)
{
si = gvResult.Rows[j].Cells[0].Text;
Subject = gvResult.Rows[j].Cells[1].Text;
Totall = gvResult.Rows[j].Cells[2].Text;
Obtained = gvResult.Rows[j].Cells[3].Text;
Per = gvResult.Rows[j].Cells[4].Text;
sgrade = gvResult.Rows[j].Cells[5].Text;
sremarks = gvResult.Rows[j].Cells[6].Text;
sposition = gvResult.Rows[j].Cells[7].Text;
table.AddCell(new Phrase(si, FontFactory.GetFont(FontFactory.HELVETICA, 7)));
table.AddCell(new Phrase(Subject, FontFactory.GetFont(FontFactory.HELVETICA, 7)));
table.AddCell(new Phrase(Totall, FontFactory.GetFont(FontFactory.HELVETICA, 7)));
table.AddCell(new Phrase(Obtained, FontFactory.GetFont(FontFactory.HELVETICA, 7)));
table.AddCell(new Phrase(Per, FontFactory.GetFont(FontFactory.HELVETICA, 7)));
table.AddCell(new Phrase(sgrade, FontFactory.GetFont(FontFactory.HELVETICA, 7)));
table.AddCell(new Phrase(sposition, FontFactory.GetFont(FontFactory.HELVETICA, 7)));
table.AddCell(new Phrase(sremarks, FontFactory.GetFont(FontFactory.HELVETICA, 7)));
}
PdfPTable nested2 = new PdfPTable(8);
nested2.DefaultCell.BackgroundColor = iTextSharp.text.BaseColor.WHITE;
nested2.DefaultCell.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
nested2.DefaultCell.Padding = 7f;
nested2.DefaultCell.Border = 0;
nested2.DefaultCell.HorizontalAlignment = 1;
nested2.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested2.AddCell(new Phrase("Total", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested2.AddCell(new Phrase(Total.ToString(), FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested2.AddCell(new Phrase(marks.ToString(), FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested2.AddCell(new Phrase(Convert.ToString(per) + " %", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested2.AddCell(new Phrase("Grade:", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested2.AddCell(new Phrase(grade.ToString(), FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested2.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
PdfPCell nesthousing2 = new PdfPCell(nested2);
nesthousing2.BackgroundColor = iTextSharp.text.BaseColor.WHITE;
nesthousing2.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
nesthousing2.Colspan = 8;
nesthousing2.Padding = 0f;
nesthousing2.Border = PdfPCell.NO_BORDER;
//nesthousing2.CellEvent = new RoundedBorder();
table.AddCell(nesthousing2);
PdfPTable nested3 = new PdfPTable(8);
float[] width3 = new float[] { 0.1f, 0.1f, 0.1f, 0.2f, 0.05f, 0.1f, 0.2f, 0.05f };
nested3.SetWidths(width3);
nested3.DefaultCell.BackgroundColor = iTextSharp.text.BaseColor.WHITE;
nested3.DefaultCell.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
nested3.DefaultCell.Padding = 7f;
nested3.DefaultCell.Border = 0;
nested3.DefaultCell.HorizontalAlignment = 1;
nested3.AddCell(new Phrase("Remarks:", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested3.AddCell(new Phrase(cRemarks.ToString(), FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested3.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested3.AddCell(new Phrase("Class Strength:", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested3.AddCell(new Phrase("50", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested3.AddCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested3.AddCell(new Phrase("Class Position:", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
nested3.AddCell(new Phrase("4", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
PdfPCell nesthousing3 = new PdfPCell(nested3);
nesthousing3.BackgroundColor = iTextSharp.text.BaseColor.WHITE;
nesthousing3.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
nesthousing3.Colspan = 8;
nesthousing3.Padding = 0f;
nesthousing3.Border = PdfPCell.NO_BORDER;
//nesthousing3.CellEvent = new RoundedBorder();
table.AddCell(nesthousing3);
PdfPCell head7 = new PdfPCell(new Phrase("", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8)));
head7.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
head7.Indent = 10;
head7.HorizontalAlignment = 1;
head7.Colspan = 8;
head7.Padding = 10;
head7.Border = 0;
table.AddCell(head7);
PdfPCell head3 = new PdfPCell(new Phrase("Principal Signature", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8, Font.UNDERLINE, BaseColor.BLACK)));
head3.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
head3.Indent = 10;
head3.HorizontalAlignment = 0;
head3.Colspan = 3;
head3.FixedHeight = 75;
head3.Border = 0;
table.AddCell(head3);
PdfPCell head4 = new PdfPCell(new Phrase("Incharge Signature:", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8, Font.UNDERLINE, BaseColor.BLACK)));
head4.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
head4.Indent = 10;
head4.HorizontalAlignment = 0;
head4.Colspan = 3;
head4.Border = 0;
head4.FixedHeight = 75;
table.AddCell(head4);
PdfPCell head5 = new PdfPCell(new Phrase("Parents Signature", FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 8, Font.UNDERLINE, BaseColor.BLACK)));
head5.BorderColor = new iTextSharp.text.BaseColor(191, 208, 247);
head5.Indent = 10;
head5.HorizontalAlignment = 1;
head5.Colspan = 3;
//head5.Padding = 45;
head5.Border = 0;
head5.FixedHeight = 75;
table.AddCell(head5);
doc.Add(table);
Chunk chunk = new Chunk("Teacher Remarks:\t" + tRemarks.ToString(), FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12.0f, iTextSharp.text.Font.BOLD | iTextSharp.text.Font.UNDERLINE));
Paragraph tremarks = new Paragraph(chunk);
tremarks.SpacingBefore = 12.0f;
tremarks.IndentationLeft = 15;
doc.Add(tremarks);
doc.NewPage();
// doc.Add(table);
}
doc.Close();
Response.Write(doc);
Response.End();
}
catch (Exception)
{
throw;
}
finally
{
doc.Close();
}
}
Screenshot
Gridview
For student 267 in page 1
For student 268 in page 2