private void ExportOrgReport(HttpContext context) { var exXls = new ExportXls(); var fieldsNames = new List<string>(); fieldsNames.Add("课程名称"); fieldsNames.Add("培训服务周到细致"); fieldsNames.Add("培训时间安排和控制合理"); fieldsNames.Add("培训场所、设备安排到位"); var quesBll = new BLL.Questionnaire(); var dt = quesBll.GetOrgReport(); dt.Columns.Remove("CourseId"); dt.Columns.Remove("OrgArrange"); dt.Columns.Remove("OrgService"); dt.Columns.Remove("OrgTime"); dt.Columns.Remove("TotalDone"); dt.Columns.Remove("TotalOrg"); dt.AcceptChanges(); var filename = "培训组织和管理满意度分布表.xls"; exXls.ExportOrgReportToxls(context.Response, fieldsNames, dt, filename); }
private void SetOrgReports() { var str = new StringBuilder(); str.Append("<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" bordercolor=\"#000000\" bgcolor=\"#FFFFFF\" " + " style=\"border-collapse:collapse;font-size: 14px;text-align:center\" >"); str.Append("<tr height=\"40\"> "); str.Append("<td colspan='4'> <span style=\"font-size: 25px;font-weight: bold\">培训组织和管理满意度分布表</span><br/> </td>"); str.Append("</tr> "); str.Append("<tr height=\"35\" bgcolor=\"#F0F9FF\" >"); str.Append("<td rowspan=\"2\" ><strong>课程名称</strong></td>"); // str.Append("<td rowspan=\"2\" ><strong>培训教师</strong></td>"); // str.Append("<td rowspan=\"2\" ><strong>培训时间</strong></td>"); str.Append("<td colspan=\"3\" ><strong>培训组织和管理各指标满意度</strong></td>"); str.Append("</tr>"); str.Append("<tr height=\"35\" bgcolor=\"#F0F9FF\">"); str.Append("<td><strong>培训服务周到细致</strong></td>"); str.Append("<td><strong>培训时间安排和控制合理</strong></td>"); str.Append("<td><strong>培训场所、设备安排到位</strong></td>"); str.Append("</tr>"); var report = new BLL.Questionnaire(); var dt = report.GetOrgReport(); var i = 0; if (dt != null && dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { var orgArrangeP = Convert.ToDouble(row["OrgArrangeP"]) >= 1.0 ? "100%" : string.Format("{0:N2}%", Convert.ToDouble(row["OrgArrangeP"]) * 100); var orgServiceP = Convert.ToDouble(row["OrgServiceP"]) >= 1.0 ? "100%" : string.Format("{0:N2}%", Convert.ToDouble(row["OrgServiceP"]) * 100); var orgTimeP = Convert.ToDouble(row["OrgTimeP"]) >= 1.0 ? "100%" : string.Format("{0:N2}%", Convert.ToDouble(row["OrgTimeP"]) * 100); i++; var color = i % 2 == 1 ? "#FFFFFF" : "#F0F9FF"; str.Append("<tr height=\"35\" bgcolor=\"" + color + "\" > "); str.Append("<td>" + row["CourseName"] + " </td>"); // str.Append("<td>" + row["TeacherName"] + " </td>"); // str.Append("<td>" + row["TeachTime"] + " </td>"); str.Append("<td>" + orgServiceP + " </td>"); str.Append("<td>" + orgTimeP + " </td>"); str.Append("<td>" + orgArrangeP + " </td>"); str.Append("</tr>"); } } //i++; //var color1 = i % 2 == 1 ? "#FFFFFF" : "#F0F9FF"; //str.Append("<tr height=\"35\" bgcolor=\"" + color1 + "\" > "); //str.Append("<td colspan='10'>"); //str.Append("总平均分=各项得分总和/实评人数;满意度=(很满意+满意)/实评人数; 课程(讲师或者组织)的满意度=每项满意度相加/项数 "); //str.Append("</td>"); //str.Append("</tr>"); str.Append("<tr height=\"35\" bgcolor=\"#FFFFFF\" > "); str.Append("<td colspan='10'>"); str.Append("<a href=\"javascript:void(0)\" class=\"easyui-linkbutton c6\" iconcls=\"icon-ok\" onclick=\"getOrgReports()\" style=\"width: 120px\">导出</a>"); str.Append("</td>"); str.Append("</tr>"); str.Append("</table>"); divReports.InnerHtml = str.ToString(); }