public ActionResult MonthlyNGReport()
{
var sbHtml = new StringBuilder();
sbHtml.Append("<table><tr><td colspan='7' style='text-align: center; font-size:26px'><b>MONTHLY REPORT</b></td></tr></table><br/>");
sbHtml.Append("<table><tr><td colspan='7'><b>OVERALL SUMMARY</b></td></tr></table><br/><br/>");
//-------------------------------------- first table ---------------------------------------------------//
sbHtml.Append("<table border='1'");
sbHtml.Append("<tr>");
sbHtml.Append("<td></td>");
sbHtml.Append("<td colspan='2' style='text-align:center'>Inpsected Lots</td>");
sbHtml.Append("<td colspan='2' style='text-align:center'> NG Lots </td>");
sbHtml.Append("</tr>");
sbHtml.Append("<tr>");
sbHtml.Append("<td>Process</td>");
sbHtml.Append("<td>Lot</td>");
sbHtml.Append("<td>Qty (mt)</td>");
sbHtml.Append("<td>Lot</td>");
sbHtml.Append("<td>Qty (mt)</td>");
sbHtml.Append("</tr>");
sbHtml.Append("</table>");
byte[] fileContents = Encoding.Default.GetBytes(sbHtml.ToString());
return File(fileContents, "application/ms-excel", "MonthlyNGReport" + DateTime.Now.ToString("ddMMyyyy hh_mm_s_tt") + ".xls");
}
for now, i just display the header only.