public void Btn_Click() { var configuration = new ReportConfiguration(); configuration.PageOrientation = PageSize.LETTER_LANDSCAPE.Rotate(); configuration.ReportTitle = "Technical reports/certificates"; string printPOHTML; //printPOHTML = "<!DOCTYPE html>"; printPOHTML = "<html><head><title></title></head><body>"; printPOHTML = printPOHTML + "<header>Technical reports/certificates</header><h4>The supplier is required to fill out this form and shipped with each individual part:</h4>"; printPOHTML = printPOHTML + " <table cellspacing="\"0\" rules="\"all\" border="\"1\" style="\"width:100%;border-collapse:collapse;border-color:" mode="hold" /> printPOHTML = printPOHTML + "<tbody>"; printPOHTML = printPOHTML + "<tr style="\"white-space:nowrap;\">"; printPOHTML = printPOHTML + "<th style="\"background-color:gray\" width="\"30%\"> Supplier </th>"; printPOHTML = printPOHTML + "<td colspan="\"2\" width="\"70%\"> Data of Supplier </td>"; printPOHTML = printPOHTML + "</tr>"; printPOHTML = printPOHTML + "<tr style="\"white-space:nowrap;\">"; printPOHTML = printPOHTML + "<th style="\"background-color:gray\" width="\"30%\"> Date of test </th>"; printPOHTML = printPOHTML + "<td colspan="\"2\" width="\"70%\"> Data of Date of test </td>"; printPOHTML = printPOHTML + "</tr>"; printPOHTML = printPOHTML + "<tr style="\"white-space:nowrap;\">"; printPOHTML = printPOHTML + "<th style="\"background-color:gray\" width="\"30%\"> Serial # </th>"; printPOHTML = printPOHTML + "<td colspan="\"2\" width="\"70%\"> Data of Serial # </td>"; printPOHTML = printPOHTML + "</tr>"; printPOHTML = printPOHTML + "</tbody>"; printPOHTML = printPOHTML + ""; printPOHTML = printPOHTML + "<br /><br />"; printPOHTML = printPOHTML + "<h5>Note – Supplier should either provide the measurement data or check when the measurement is done and stored.</h5>"; printPOHTML = printPOHTML + "<table cellspacing="\"0\" rules="\"all\" border="\"1\" style="\"width:100%;border-collapse:collapse;border-color:" mode="hold" /> printPOHTML = printPOHTML + "<tr>"; printPOHTML = printPOHTML + "<th style="\"background-color:yellow\">Category</th> "; printPOHTML = printPOHTML + "<th style="\"background-color:yellow\">12NC</th>"; printPOHTML = printPOHTML + "<th style="\"background-color:yellow\">Item</th>"; printPOHTML = printPOHTML + "<th style="\"background-color:yellow\">Spec. Value</th>"; printPOHTML = printPOHTML + "<th style="\"background-color:yellow\">Meas. Value</th>"; printPOHTML = printPOHTML + "<th style="\"background-color:yellow\">Chk/Data Stored</th>"; printPOHTML = printPOHTML + "</tr>"; // printPOHTML = printPOHTML + "<br /> <br />"; //foreach code to be written for td ///Html code for Footer. string footerHtml; footerHtml = "<footer>"; footerHtml = footerHtml + " <table cellspacing="\"0\" rules="\"all\" border="\"1\" style="\"width:100%;border-collapse:collapse;border-color:" mode="hold" /> footerHtml = footerHtml + "<tr>"; footerHtml = footerHtml + "<td> ASML</td>"; footerHtml = footerHtml + "<td colspan="\"2\">YS350E OM FOC REF BS PLATE</td>"; footerHtml = footerHtml + "<td colspan="\"2\"> 4022.656.1758</td>"; footerHtml = footerHtml + "<td colspan="\"2\">"; footerHtml = footerHtml + "<table border="\"1\" style="\"width:" mode="hold" /> footerHtml = footerHtml + "<tr><td>1</td></tr>"; footerHtml = footerHtml + "<tr><td>2</td></tr>"; footerHtml = footerHtml + "<tr><td>3</td></tr>"; footerHtml = footerHtml + "<tr><td>4</td></tr>"; footerHtml = footerHtml + "<tr><td>5</td></tr>"; footerHtml = footerHtml + ""; footerHtml = footerHtml + "</td>"; footerHtml = footerHtml + "</tr>"; footerHtml = footerHtml + "<tr>"; footerHtml = footerHtml + "<td colspan="\"2\">Name</td>"; footerHtml = footerHtml + "<td>FORMER 12NC:</td>"; footerHtml = footerHtml + "<td>SHEET:</td>"; footerHtml = footerHtml + "<td>SHEETS:</td>"; footerHtml = footerHtml + "<td>SYS:</td>"; footerHtml = footerHtml + "<td>SIZE:</td>"; footerHtml = footerHtml + "</tr>"; footerHtml = footerHtml + "<td>CHECKED BY:</td>"; footerHtml = footerHtml + "<td>STATUS:</td>"; footerHtml = footerHtml + " <td colspan="\"2\">NAME CODEVELOPER:</td>"; footerHtml = footerHtml + "<td colspan="\"3\">SHEET:</td>"; footerHtml = footerHtml + ""; footerHtml = footerHtml + ""; footerHtml = footerHtml + "</footer></body></html>"; string htmlText = printPOHTML + footerHtml; Response.Clear(); Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=Student Details.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.BinaryWrite(stream.ToArray()); }
Response.Write
application/pdf
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)