StringBuilder str = new StringBuilder(); BAL.EmailForVerification ObjEmailVer = new BAL.EmailForVerification();//FROM EmailForVerification.cs BAL DataTable dt = ObjEmailVer.SelectPrepetsPartForReceipt(); if (dt.Rows.Count > 0) { Response.Clear(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment;filename=Receipts.pdf"); Response.ContentType = "application/pdf"; Response.Cache.SetCacheability(HttpCacheability.NoCache); for (int i = 0; i < dt.Rows.Count; i++) { string status = string.Empty; if (Convert.ToString(dt.Rows[i]["Resident Category"]).ToLower() == "yes") { status = "Couple"; } else if (Convert.ToString(dt.Rows[i]["Resident Category"]).ToLower() == "no") { status = "Single"; } //str.Append("<h2 style='page-break-before: always;'> </h2>"); str.Append("<table width=100% cellpadding=3 cellspacing=0 border=0 style=border:solid 1px #000000;>"); str.Append("<tr><td align=center colspan=2 valign=top><table width=100% cellpadding=0 cellspacing=0 border=0><tr><td align=left width=10%><img src=http://prepets.rotarydombivlieast.org/App_Themes/images/RotaryLogo_wh-k.jpg width=60 height=60 /></td><td align=center width=90% style=font-size:16pt; font-weight:bold; font-family:Times New Roman; >Rotary Club of Dombivili East<br/><span style=font-size:10px>Dist. 3140</span> <br/>PREPETS ROYALE 2011</td></tr></table> </td></tr>"); str.Append("<tr><td style=width:70%> </td><td style=width:30%; align=left valign=top ><br/>Receipt No: " + Convert.ToString(dt.Rows[i]["ReceiptNo"]) + "<br/>"); str.Append("Receipt Date: " + Convert.ToString(dt.Rows[i]["ReceiptDate"]) + "</td></tr>"); str.Append("<tr><td align=left valign=top colspan=2><br/>Received from Rtn. " + Convert.ToString(dt.Rows[i]["Name"]) + " Rs. " + Convert.ToString(dt.Rows[i]["AmountPaid"]) + " towards registration charges (" + status + ") for PREPETS 2011. </td></tr>"); str.Append("<tr><td align=left valign=top colspan=2><br/>Cheque/DD No.: " + Convert.ToString(dt.Rows[i]["TransactionChequeNo"]) + " Date: " + Convert.ToString(dt.Rows[i]["TransactionChequeDate"]) + " Drawn On: " + Convert.ToString(dt.Rows[i]["DrawnonBankName"]) + "</td></tr>"); str.Append("<tr><td align=center valign=top colspan=2 > </td></tr>"); str.Append("<tr><td align=left valign=top colspan=2 style=padding-left:320px; ><br/>PP Dr. Madhav Baitule <br/>"); str.Append("Treasurer <br/>"); str.Append("PREPETS Organizing Committee <br/>"); str.Append("Rotary Club of Dombivli East </td></tr>"); str.Append("</table>"); str.Append("<h2 style='page-break-after: always;'> </h2>"); //str.Append("<br/>"); } Response.Output.Write(str.ToString()); Response.Flush(); Response.End(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)