protected void btnexportcsv_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); StringBuilder sb = new StringBuilder(); bindheader(); fillgrid(); if (ds.Tables[0].Rows.Count > 0) { sb.Append("<table cellpadding='4' cellspacing='0' style='font-family:Calibri;font-size:12px;' border='0'>" + bindheader() + "<tr><th style='text-align:center;'>S.No.</th><th style='text-align:left;'>Client Code</th><th style='text-align:left;'>Client Name</th><th style='text-align:left;'>Contact Name</th><th style='text-align:left;'>Email Id</th><th style='text-align:left;'>Phone</th><th style='text-align:left;'>Cell</th><th style='text-align:left;'>Fax</th><th style='text-align:left;'>Website</th><th style='text-align:left;'>Address</th><th style='text-align:left;'>City</th><th style='text-align:left;'>State</th><th style='text-align:left;'>Country</th><th style='text-align:left;'>ZIP</th><th style='text-align:left;'>Manager</th><th style='text-align:left;'>Active Status</th></tr>"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { if (ds.Tables[0].Rows[i]["activestatus"].ToString().ToLower() == "block") { sb.Append("<tr style= 'color:red;'><td style='text-align:center;'>" + (i + 1).ToString() + "</td><td>" + ds.Tables[0].Rows[i]["code"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["clientname"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["company"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["email"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["phone"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["mobile"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["fax"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["website"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["street"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["city"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["state"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["country"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["zip"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["managername"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["activestatus"].ToString() + "</td></tr>"); } else { sb.Append("<tr><td style='text-align:center;'>" + (i + 1).ToString() + "</td><td>" + ds.Tables[0].Rows[i]["code"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["clientname"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["company"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["email"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["phone"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["mobile"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["fax"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["website"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["street"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["city"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["state"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["country"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["zip"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["managername"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["activestatus"].ToString() + "</td></tr>"); } } sb.Append("</table>"); } excelexport objexcel = new excelexport(); objexcel.downloadFile(sb.ToString(), "Client.xls"); }
protected void btnexportcsv_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); StringBuilder sb = new StringBuilder(); bindheader(); fillgrid(); if (ds.Tables[0].Rows.Count > 0) { sb.Append("<table cellpadding='4' cellspacing='0' style='font-family:Calibri;font-size:12px;' border='0'>" + bindheader() + "<tr><th style='text-align:center;'>S.No.</th><th style='text-align:left;'>Emp ID</th><th style='text-align:left;'>Emp Name</th><th style='text-align:left;'>Email</th><th style='text-align:left;'>Designation</th><th style='text-align:left;'>Department</th><th style='text-align:left;'>Join Date</th><th style='text-align:left;'>Released Date</th><th style='text-align:left;'>Active Status</th></tr>"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { if (ds.Tables[0].Rows[i]["activestatus"].ToString().ToLower() == "block") { sb.Append("<tr style= 'color:red;'><td style='text-align:center;'>" + (i + 1).ToString() + "</td><td>" + ds.Tables[0].Rows[i]["loginid"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["fname"].ToString() + " " + ds.Tables[0].Rows[i]["lname"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["emailid"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["designation"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["department"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["joindate"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["releaseddate"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["activestatus"].ToString() + "</td></tr>"); } else { sb.Append("<tr><td style='text-align:center;'>" + (i + 1).ToString() + "</td><td>" + ds.Tables[0].Rows[i]["loginid"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["fname"].ToString() + " " + ds.Tables[0].Rows[i]["lname"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["emailid"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["designation"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["department"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["joindate"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["releaseddate"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["activestatus"].ToString() + "</td></tr>"); } } sb.Append("</table>"); } excelexport objexcel = new excelexport(); objexcel.downloadFile(sb.ToString(), "Employee.xls"); }
protected void btnexportcsv_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); StringBuilder sb = new StringBuilder(); StringBuilder sb1 = new StringBuilder(); bindheader(); fillgrid(); if (ds.Tables[0].Rows.Count > 0) { sb.Append("<table cellpadding='4' cellspacing='0' style='font-family:Calibri;font-size:12px;' border='0'>" + bindheader()); for (int i = 0; i < dgnews.Columns.Count; i++) { } sb.Append("<tr><th>Category Name</th></tr>"); for (int j = 0; j < ds.Tables[0].Rows.Count; j++) { sb.Append("<tr>"); //for (int i = 0; i < ds.Tables[0].Columns.Count; i++) { sb.Append("<td>" + ds.Tables[0].Rows[j][2].ToString() + "</td>"); } sb.Append("</tr>"); } sb.Append("</table>"); } excelexport objexcel = new excelexport(); objexcel.downloadFile(sb.ToString(), "FileCategories.xls"); }
protected void btnexportcsv_Click(object sender, EventArgs e) { fillgrid(); excelexport objexcel = new excelexport(); objexcel.downloadFile(sb.ToString(), "EmployeeAttendance.xls"); }
protected void btnexportcsv_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); StringBuilder sb = new StringBuilder(); bindheader(); sb.Append(Session["header"].ToString() + divreport.InnerHtml); objexcel.downloadFile(sb.ToString(), "TimeExpensesReport.xls"); }
protected void btnexportcsv_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); StringBuilder sb = new StringBuilder(); bindheader(); fillgrid(); if (ds.Tables[0].Rows.Count > 0) { sb.Append("<table cellpadding='4' cellspacing='0' style='font-family:Calibri;font-size:12px;' border='0'>" + bindheader() + "<tr><th style='text-align:center;'>S.No.</th><th style='text-align:left;'>Project Code</th><th style='text-align:left;'>Project Name</th><th style='text-align:left;'>Client Code</th><th style='text-align:left;'>Client Name</th><th>Manager</th><th>Contract Type</th><th>Project Status</th> <th>Contract Amount</th><th>Service Amount</th><th>Exp Amount</th><th>Complete Percent</th><th>Creation Date</th><th>Start Date</th><th>Due Date</th></tr>"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { if (ds.Tables[0].Rows[i]["projectstatus"].ToString().ToLower() == "block") { sb.Append("<tr style= 'color:red;'><td style='text-align:center;'>" + (i + 1).ToString() + "</td><td>" + ds.Tables[0].Rows[i]["projectCode"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["projectname"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["clientcode"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["clientname"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["empname"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["contractType"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["projectStatus"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["contractAmt"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["serviceAmt"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["expAmt"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["completePercent"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["creationDate"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["startDate"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["dueDate"].ToString() + "</td></tr>"); } else { sb.Append("<tr><td style='text-align:center;'>" + (i + 1).ToString() + "</td><td>" + ds.Tables[0].Rows[i]["projectCode"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["projectname"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["clientcode"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["clientname"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["empname"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["contractType"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["projectStatus"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["contractAmt"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["serviceAmt"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["expAmt"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["completePercent"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["creationDate"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["startDate"].ToString() + "</td><td>" + ds.Tables[0].Rows[i]["dueDate"].ToString() + "</td></tr>"); } } sb.Append("</table>"); } //using (XLWorkbook wb = new XLWorkbook()) //{ // wb.Worksheets.Add(ds.Tables[0]); // Response.Clear(); // Response.Buffer = true; // Response.Charset = ""; // Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; // Response.AddHeader("content-disposition", "attachment;filename=GridView.xlsx"); // using (MemoryStream MyMemoryStream = new MemoryStream()) // { // wb.SaveAs(MyMemoryStream); // MyMemoryStream.WriteTo(Response.OutputStream); // Response.Flush(); // Response.End(); // } //} //Response.AppendHeader("content-disposition", "attachment;filename=ExportedHtml.xls"); //Response.Charset = ""; //Response.Cache.SetCacheability(HttpCacheability.NoCache); //Response.ContentType = "application/vnd.ms-excel"; //this.EnableViewState = false; //Response.Write(sb.ToString()); //Response.End(); excelexport objexcel = new excelexport(); objexcel.downloadFile(sb.ToString(), "Projects.xls"); }
protected void btnexportcsv_Click(object sender, EventArgs e) { fillgrid(); string rpthtml = bindheader("excel"); for (int i = 0; i < dsexcel.Tables[0].Rows.Count; i++) { rpthtml = rpthtml + "<tr " + (Convert.ToBoolean(dsexcel.Tables[0].Rows[i]["isbillable"]) == true ? "" : " style='color:red;' ") + "><td>" + Convert.ToString(i + 1) + "</td>" + "<td>" + dsexcel.Tables[0].Rows[i]["date"].ToString() + "</td><td>" + dsexcel.Tables[0].Rows[i]["empname"].ToString() + "</td><td>" + dsexcel.Tables[0].Rows[i]["projectcode"].ToString() + "</td><td>" + dsexcel.Tables[0].Rows[i]["projectname"].ToString() + "</td><td>" + dsexcel.Tables[0].Rows[i]["taskcodenamesmall"].ToString() + "</td><td>" + dsexcel.Tables[0].Rows[i]["hours"].ToString() + "</td><td>" + dsexcel.Tables[0].Rows[i]["description"].ToString() + "</td><td>" + (Convert.ToBoolean(dsexcel.Tables[0].Rows[i]["isbillable"]) == true ? "Yes" : "No") + "</td><td>" + dsexcel.Tables[0].Rows[i]["taskstatus"].ToString() + "</td><td>" + dsexcel.Tables[0].Rows[i]["memo"].ToString() + "</td></tr>"; } excelexport objexcel = new excelexport(); objexcel.downloadFile(rpthtml.ToString(), "TimeEntry.xls"); }
protected void btnexportcsv_Click(object sender, EventArgs e) { objexcel.downloadFile(getreport(), "Client Time and Exp Report.xls"); }
protected void btnexportcsv_Click(object sender, EventArgs e) { if (chkmemo.Checked) { colcount = "9"; } DataTable dt = new DataTable(); StringBuilder sb = new StringBuilder(); sb.Append(@"<table>" + bindheader() + @"<tr ><th style='background-color:blue;color:#ffffff;'>Day</th><th style='background-color:blue;color:#ffffff;'>Date</th><th style='background-color:blue;color:#ffffff;'>Project Id</th><th style='background-color:blue;color:#ffffff;'>Project Name</th> <th style='background-color:blue;color:#ffffff;'>Task ID</th><th style='background-color:blue;color:#ffffff;'>Description</th>"); if (chkmemo.Checked) { sb.Append("<th style='background-color:blue;color:#ffffff;'>Memo</th>"); } sb.Append("<th style='background-color:blue;color:#ffffff;'>Hrs.</th><th style='background-color:blue;color:#ffffff;'></th>"); if (Session["tasktable"] != null) { dt = ((DataTable)Session["tasktable"]).Copy(); DataView view = new DataView(dt); view.Sort = "empname ASC"; DataTable sortedDT = view.ToTable(); DataView view1 = new DataView(sortedDT); DataTable distinctValues = view1.ToTable(true, "empid"); double totalhrs = 0, totalbill = 0, totalub = 0; for (int i = 0; i < distinctValues.Rows.Count; i++) { double hrs = 0; DataTable dtfinal = new DataTable(); dtfinal = filerbyemp("empid='" + distinctValues.Rows[i][0].ToString() + "'", dt); dtfinal.DefaultView.Sort = "date1 ASC"; sb.Append(@"<tr><td colspan='" + colcount + @"' style='color:blue;font-weight:bold;'>" + dtfinal.Rows[0]["empname"].ToString() + "(" + dtfinal.Rows[0]["loginid"].ToString() + ")" + "</td></tr>"); DataTable dtfinal1 = new DataTable(); dtfinal1 = filerbyemp("isbillable=1", dtfinal); int count = dtfinal1.Rows.Count; int j = 0; if (dtfinal1.Rows.Count > 0) { for (j = 0; j < count; j++) { string bgcolor = ""; if (j % 2 > 0) { bgcolor = " style='background-color:#E8F5FD;' "; } else { bgcolor = " style='background-color:#CBE5F5;' "; } sb.Append(@"<tr><td " + bgcolor + ">" + Convert.ToDateTime(dtfinal1.Rows[j]["date1"].ToString()).ToString("ddd") + "</td>"); sb.Append(@"<td " + bgcolor + ">" + dtfinal1.Rows[j]["date"].ToString() + "</td>"); sb.Append(@"<td " + bgcolor + ">" + dtfinal1.Rows[j]["projectcode"].ToString() + "</td>"); sb.Append(@"<td " + bgcolor + ">" + dtfinal1.Rows[j]["projectname"].ToString() + "</td>"); sb.Append(@"<td " + bgcolor + ">" + dtfinal1.Rows[j]["taskcodename"].ToString() + "</td>"); sb.Append(@"<td " + bgcolor + ">" + dtfinal1.Rows[j]["description"].ToString() + "</td>"); if (colcount == "9") { sb.Append(@"<td " + bgcolor + ">" + dtfinal1.Rows[j]["memo"].ToString() + "</td>"); } sb.Append(@"<td " + bgcolor + ">" + dtfinal1.Rows[j]["hours"].ToString() + "</td>"); hrs += Convert.ToDouble(dtfinal1.Rows[j]["hours"]); if (Convert.ToBoolean(dtfinal1.Rows[j]["isbillable"])) { sb.Append(@"<td></td></tr>"); } else { sb.Append(@"<td style='color:red;'>NB</td></tr>"); } if (j == count - 1) { sb.Append(@"<tr><td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); if (colcount == "9") { sb.Append(@"<td></td>"); } sb.Append(@"<td style='border-top:solid 1px #000000;border-bottom:solid 1px #000000;font-weight:bold;'>" + dtfinal1.Rows[j]["empname"].ToString() + "(" + dtfinal1.Rows[j]["loginid"].ToString() + ")" + "</td>"); sb.Append(@"<td style='border-top:solid 1px #000000;border-bottom:solid 1px #000000;font-weight:bold;'>" + hrs.ToString("0.00") + "</td><td></td></tr>"); totalhrs += hrs; totalbill += hrs; sb.Append(@"<tr><td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); if (colcount == "9") { sb.Append(@"<td></td>"); } sb.Append(@"<td></td></tr>"); } } } j = 0; double hrs1 = 0; DataTable dtfinal2 = new DataTable(); dtfinal2 = filerbyemp("isbillable=0", dtfinal); count = dtfinal2.Rows.Count; if (dtfinal2.Rows.Count > 0) { for (j = 0; j < count; j++) { string bgcolor = ""; if (j % 2 > 0) { bgcolor = " style='background-color:#E8F5FD;' "; } else { bgcolor = " style='background-color:#CBE5F5;' "; } sb.Append(@"<tr><td " + bgcolor + ">" + Convert.ToDateTime(dtfinal2.Rows[j]["date1"].ToString()).ToString("ddd") + "</td>"); sb.Append(@"<td " + bgcolor + ">" + dtfinal2.Rows[j]["date"].ToString() + "</td>"); sb.Append(@"<td " + bgcolor + ">" + dtfinal2.Rows[j]["projectcode"].ToString() + "</td>"); sb.Append(@"<td " + bgcolor + ">" + dtfinal2.Rows[j]["projectname"].ToString() + "</td>"); sb.Append(@"<td " + bgcolor + ">" + dtfinal2.Rows[j]["taskcodename"].ToString() + "</td>"); sb.Append(@"<td " + bgcolor + ">" + dtfinal2.Rows[j]["description"].ToString() + "</td>"); if (colcount == "9") { sb.Append(@"<td " + bgcolor + ">" + dtfinal2.Rows[j]["memo"].ToString() + "</td>"); } sb.Append(@"<td " + bgcolor + ">" + dtfinal2.Rows[j]["hours"].ToString() + "</td>"); hrs1 += Convert.ToDouble(dtfinal2.Rows[j]["hours"]); if (Convert.ToBoolean(dtfinal2.Rows[j]["isbillable"])) { sb.Append(@"<td></td></tr>"); } else { sb.Append(@"<td style='color:red;'>NB</td></tr>"); } if (j == count - 1) { sb.Append(@"<tr><td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); if (colcount == "9") { sb.Append(@"<td></td>"); } sb.Append(@"<td style='border-top:solid 1px #000000;border-bottom:solid 1px #000000;font-weight:bold;'>" + dtfinal.Rows[0]["empname"].ToString() + "(" + dtfinal2.Rows[j]["loginid"].ToString() + ")" + "</td>"); sb.Append(@"<td style='border-top:solid 1px #000000;border-bottom:solid 1px #000000;font-weight:bold;'>" + hrs1.ToString("0.00") + "</td><td style='color:red;'>NB</td></tr>"); totalhrs += hrs1; totalub += hrs1; sb.Append(@"<tr><td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); if (colcount == "9") { sb.Append(@"<td></td>"); } sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td></tr>"); } } } sb.Append(@"<tr><td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); if (colcount == "9") { sb.Append(@"<td></td>"); } sb.Append(@"<td style='font-weight:bold;'>Employee Total</td>"); sb.Append(@"<td style='border-top:solid 1px #000000;border-bottom:solid 1px #000000;font-weight:bold;'>" + dtfinal.Rows[0]["empname"].ToString() + "(" + dtfinal.Rows[0]["loginid"].ToString() + ")" + "</td>"); sb.Append(@"<td style='border-top:solid 1px #000000;border-bottom:solid 1px #000000;font-weight:bold;'>" + (hrs + hrs1).ToString("0.00") + "</td><td></td></tr>"); sb.Append(@"<tr><td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); if (colcount == "9") { sb.Append(@"<td></td>"); } sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td></tr>"); } sb.Append(@"<tr><td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); if (colcount == "9") { sb.Append(@"<td></td>"); } sb.Append(@"<td></td>"); sb.Append(@"<td style='border-top:solid 1px #000000;border-bottom:solid 1px #000000;font-weight:bold;'>Total</td>"); sb.Append(@"<td style='border-top:solid 1px #000000;border-bottom:solid 1px #000000;font-weight:bold;'>" + totalbill.ToString("0.00") + "</td><td style='font-weight:bold;'>B</td></tr>"); sb.Append(@"<tr><td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); if (colcount == "9") { sb.Append(@"<td></td>"); } sb.Append(@"<td></td>"); sb.Append(@"<td></td></tr>"); // UB sb.Append(@"<tr><td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); if (colcount == "9") { sb.Append(@"<td></td>"); } sb.Append(@"<td></td>"); sb.Append(@"<td style='border-top:solid 1px #000000;border-bottom:solid 1px #000000;font-weight:bold;'>Total</td>"); sb.Append(@"<td style='border-top:solid 1px #000000;border-bottom:solid 1px #000000;font-weight:bold;'>" + totalub.ToString("0.00") + "</td><td style='font-weight:bold;'>UB</td></tr>"); sb.Append(@"<tr><td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); if (colcount == "9") { sb.Append(@"<td></td>"); } sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td></tr>"); // GT sb.Append(@"<tr style='color:blue;'><td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); sb.Append(@"<td></td>"); if (colcount == "9") { sb.Append(@"<td></td>"); } sb.Append(@"<td></td>"); sb.Append(@"<td style='border-top:solid 1px #000000;border-bottom:solid 1px #000000;font-weight:bold;'>Grand Total</td>"); sb.Append(@"<td style='border-top:solid 1px #000000;border-bottom:solid 1px #000000;font-weight:bold;'>" + totalhrs.ToString("0.00") + "</td><td></td></tr>"); } sb.Append("</table>"); objexcel.downloadFile(sb.ToString(), "TimeSheetReport.xls"); }