const int TITLE_TEXT_DISTANCE = 8; //标题和正文间距 #endregion Fields #region Methods protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["sn"] != null) { string sn = Request.QueryString["sn"].ToString(); if (!string.IsNullOrEmpty(sn)) { bool bRptExist = false; bRptExist = File.Exists(Server.MapPath(@"../PDF/") + sn + ".pdf"); //if (false == bRptExist) { GenPDFReport(sn); } DataTable testerInfoTable = new RptBLL().GetTesterInfo(sn); string usrNm = testerInfoTable.Rows[0]["testerNAME"].ToString(); string dt = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss"); string srcFileNm = Server.MapPath(@"../PDF/") + sn + ".pdf"; string destFileNm = Server.MapPath(@"../PDF/") + usrNm + "-" + dt + ".pdf"; File.Copy(srcFileNm, destFileNm); //Response.Redirect("../PDF/" + sn + ".pdf#zoom=100"); Response.Redirect("../PDF/" + usrNm + "-" + dt + ".pdf#zoom=100"); } } else//打包下载 { ArrayList arSelList = (ArrayList)Session["ExportList"]; if (arSelList != null && arSelList.Count > 0) { Session["ExportList"] = null; ZipFile zip = new ZipFile(); zip.UseUnicodeAsNecessary = true; RptBLL rptBLL = new RptBLL(); foreach (Object obj in arSelList) { if (false == File.Exists(Server.MapPath(@"../PDF/") + obj.ToString() + ".pdf")) { GenPDFReport(obj.ToString()); } //20110906 打包下载经销商名称+人名+GUID begin. DataTable testerInfoTable = rptBLL.GetTesterInfo(obj.ToString()); string usrNm = testerInfoTable.Rows[0]["testerNAME"].ToString(); string usrCompany = testerInfoTable.Rows[0]["tester_dealer"].ToString(); string srcFileNm = Server.MapPath(@"../PDF/") + obj.ToString() + ".pdf"; string destFileNm = Server.MapPath(@"../PDF/") + usrCompany + "_" + usrNm + "_" + obj.ToString() + ".pdf"; if (File.Exists(srcFileNm)) { File.Copy(srcFileNm, destFileNm, true); //20110906 打包下载经销商名称+人名+GUID end. //zip.AddFile(Server.MapPath(@"../PDF/") + obj.ToString() + ".pdf",""); if (File.Exists(destFileNm)) { zip.AddFile(destFileNm, ""); } } } string filePath = Server.MapPath(@"../userfiles/") + @"\" + "ReportZip" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".zip"; string fileName = Path.GetFileName(filePath); zip.Save(filePath); Stream stream = null; stream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read); long bytesToRead = stream.Length; Response.Clear(); Response.ContentType = "application/zip"; Response.AddHeader("Content-Disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); while (bytesToRead > 0) { if (Response.IsClientConnected) { byte[] buffer = new Byte[10000]; int length = stream.Read(buffer, 0, 10000); Response.OutputStream.Write(buffer, 0, length); Response.Flush(); bytesToRead = bytesToRead - length; } else { bytesToRead = -1; } } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["sn"] != null) { string strGUID = Request.QueryString["sn"].ToString(); if (!string.IsNullOrEmpty(strGUID)) { foreach (RenderingExtension extension in ReportViewer1.LocalReport.ListRenderingExtensions()) { if (extension.Name != "PDF" && extension.Name != "WORD") { ReflectivelySetVisibilityFalse(extension); } } RptBLL rptBLL = new RptBLL(); ActivityBLL aBLL = new ActivityBLL(); GuidBLL guidBLL = new GuidBLL(); CommentBLL cBLL = new CommentBLL(); DataTable dtTmp = rptBLL.GetDimensionScore(strGUID); dtTmp.DefaultView.Sort = "DIMCLASSID ASC"; DataTable dimTable = dtTmp.DefaultView.ToTable(); DataTable testerInfoTable = rptBLL.GetTesterInfo(strGUID); DimensionBLL dimbll = new DimensionBLL(); double totalMinutes = rptBLL.GetRefTotalTimeMinute(strGUID); double refMinMinutes = 0; double refMaxMinutes = 0; if (totalMinutes > 12.1) { refMinMinutes = totalMinutes - (double)12.1; } refMaxMinutes = totalMinutes + 12.1; string strREFtime = refMinMinutes.ToString("F1") + " ~ " + refMaxMinutes.ToString("F1"); string shcxxDENGJI = string.Empty; string shcxxPINGDING = string.Empty; string shcxxMIAOSHU = string.Empty; string cxbxPY = string.Empty;//诚信表现评语 int aID = guidBLL.GetActivityId(strGUID); int positionId = aBLL.GetPositionId(aID); Activity a = aBLL.GetModel(aID); int rptSettings = a.Activity_viewreport; bool p5Visible = true; bool p6Visible = true; if (rptSettings != 0 && rptSettings.ToString().Length > 1) { p5Visible = rptSettings.ToString().Substring(5, 1).Equals("1"); p6Visible = rptSettings.ToString().Substring(6, 1).Equals("1"); } ArrayList arGZZT_youshi = new ArrayList();//工作状况_优势 ArrayList arGZZT_lieshi = new ArrayList();//工作状况_劣势 string youshi = string.Empty; string lieshi = string.Empty; StringBuilder sbGZZT = new StringBuilder();//工作状况 StringBuilder sbTZMS = new StringBuilder();//特质描述 StringBuilder sbYRJY = new StringBuilder();//用人建议 StringBuilder sbGRFZ = new StringBuilder();//个人发展 //作答结果是否可信>>>>>>> bool b1 = false;//实际作答时间是否落在参考值区间 bool b2 = false;//社会称许性等级得分大于7.9 bool b3 = false;//作答一致性处于"较高"的等级 //作答结果是否可信<<<<<<< for (int i = 0; i < dimTable.Rows.Count; i++) { int dimID = Int32.Parse(dimTable.Rows[i][0].ToString());//维度ID int dimscore = Int32.Parse(dimTable.Rows[i][2].ToString());//维度原始分 Double dim_s = Double.Parse(dimTable.Rows[i][3].ToString());//维度参考区间开始分 Double dim_e = Double.Parse(dimTable.Rows[i][4].ToString());//维度参考区间结束分 //Double dimQ1 = Double.Parse(dimTable.Rows[i][9].ToString());//Q1 //Double dimQ2 = Double.Parse(dimTable.Rows[i][10].ToString());//Q2 //Double dimQ3 = Double.Parse(dimTable.Rows[i][11].ToString());//Q3 Double p17 = Double.Parse(dimTable.Rows[i][9].ToString()); Double p68 = Double.Parse(dimTable.Rows[i][10].ToString()); Double p92 = Double.Parse(dimTable.Rows[i][11].ToString()); if (dimscore <= p17) { dimTable.Rows[i][8] = "偏低"; } else if (dimscore > p17 && dimscore <= p68) { dimTable.Rows[i][8] = "稍低"; } else if (dimscore > p68 && dimscore < p92) { dimTable.Rows[i][8] = "适配"; } else if (dimscore >= p92) { dimTable.Rows[i][8] = "偏高"; } //维度内判断诚信等级>>>>>>>>>>>>>>>>>>>>>>>>>>>> if (dimTable.Rows[i][1].ToString().Trim().Equals("诚信")) { if (dimscore <= 58.7) { cxbxPY = "有待提高"; } else if (dimscore >= 67.1) { cxbxPY = "比较诚信"; } else if (dimscore > 58.7 && dimscore < 67.1) { cxbxPY = "中等"; } } //维度内判断诚信等级<<<<<<<<<<<<<<<<<<<<<<<<<<<< //获取评语>>>>>>>>>>>>>>>>>>>>>>>>>>>> for (int kk = 1; kk < 5; kk++) { if (dimTable.Rows[i][8].ToString().Trim().Equals("偏低")) { string c = cBLL.GetCommentByAll(positionId, dimID, kk, 4); if (kk == 1) { if (!string.IsNullOrEmpty(c)) { sbTZMS.Append((i + 1).ToString() + "、" + c + Environment.NewLine+Environment.NewLine); } } else if (kk == 2) { if (!string.IsNullOrEmpty(c)) { sbGZZT.Append((i + 1).ToString() + "、" + c + Environment.NewLine+Environment.NewLine); arGZZT_lieshi.Add(c + Environment.NewLine+Environment.NewLine); } } else if (kk == 3) { if (!string.IsNullOrEmpty(c)) { sbYRJY.Append(" * " + c + Environment.NewLine+Environment.NewLine); } } else if (kk == 4) { if (!string.IsNullOrEmpty(c)) { sbGRFZ.Append(" * " + c + Environment.NewLine+Environment.NewLine); } } dimTable.Rows[i][12] = cBLL.GetCommentByAll(positionId, dimID, 1, 4); } else if (dimTable.Rows[i][8].ToString().Trim().Equals("稍低")) { string c = cBLL.GetCommentByAll(positionId, dimID, kk, 3); if (kk == 1) { if (!string.IsNullOrEmpty(c)) { sbTZMS.Append((i + 1).ToString() + "、" + c + Environment.NewLine+Environment.NewLine); } } else if (kk == 2) { if (!string.IsNullOrEmpty(c)) { sbGZZT.Append((i + 1).ToString() + "、" + c + Environment.NewLine+Environment.NewLine); arGZZT_lieshi.Add(c + Environment.NewLine+Environment.NewLine); } } else if (kk == 3) { if (!string.IsNullOrEmpty(c)) { sbYRJY.Append(" * " + c + Environment.NewLine+Environment.NewLine); } } else if (kk == 4) { if (!string.IsNullOrEmpty(c)) { sbGRFZ.Append(" * " + c + Environment.NewLine+Environment.NewLine); } } dimTable.Rows[i][12] = cBLL.GetCommentByAll(positionId, dimID, 1, 3); } else if (dimTable.Rows[i][8].ToString().Trim().Equals("适配")) { string c = cBLL.GetCommentByAll(positionId, dimID, kk, 2); if (kk == 1) { if (!string.IsNullOrEmpty(c)) { sbTZMS.Append((i + 1).ToString() + "、" + c + Environment.NewLine+Environment.NewLine); } } else if (kk == 2) { if (!string.IsNullOrEmpty(c)) { sbGZZT.Append((i + 1).ToString() + "、" + c + Environment.NewLine+Environment.NewLine); arGZZT_youshi.Add(c + Environment.NewLine+Environment.NewLine); } } else if (kk == 3) { if (!string.IsNullOrEmpty(c)) { sbYRJY.Append(" * " + c + Environment.NewLine+Environment.NewLine); } } else if (kk == 4) { if (!string.IsNullOrEmpty(c)) { sbGRFZ.Append(" * " + c + Environment.NewLine+Environment.NewLine); } } dimTable.Rows[i][12] = cBLL.GetCommentByAll(positionId, dimID, 1, 2); } else if (dimTable.Rows[i][8].ToString().Trim().Equals("偏高")) { string c = cBLL.GetCommentByAll(positionId, dimID, kk, 1); if (kk == 1) { if (!string.IsNullOrEmpty(c)) { sbTZMS.Append((i + 1).ToString() + "、" + c + Environment.NewLine+Environment.NewLine); } } else if (kk == 2) { if (!string.IsNullOrEmpty(c)) { sbGZZT.Append((i + 1).ToString() + "、" + c + Environment.NewLine+Environment.NewLine); arGZZT_youshi.Add(c + Environment.NewLine+Environment.NewLine); } } else if (kk == 3) { if (!string.IsNullOrEmpty(c)) { sbYRJY.Append(" * " + c + Environment.NewLine+Environment.NewLine); } } else if (kk == 4) { if (!string.IsNullOrEmpty(c)) { sbGRFZ.Append(" * " + c + Environment.NewLine+Environment.NewLine); } } dimTable.Rows[i][12] = cBLL.GetCommentByAll(positionId, dimID, 1, 1); } } //获取评语<<<<<<<<<<<<<<<<<<<<<<<<<<<< //维度内判断社会称许性等级>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if (dimTable.Rows[i][1].ToString().Trim().Equals("社会称许性")) { double score = double.Parse(dimTable.Rows[i][2].ToString()); if (score >= 0 && score <= 2.1) { shcxxDENGJI = "较高"; shcxxPINGDING = "倾向偏强"; shcxxMIAOSHU = "他(她)在本次答题时表现出较强的获取赞许的倾向,这种倾向可能是有意识的,也可能是无意识的,不能排除潜意识的影响"; } else if (score >= 2.2 && score <= 4.0) { shcxxDENGJI = "中等"; shcxxPINGDING = "可接受"; shcxxMIAOSHU = "他(她)在本次答题时表现出与大多数人相似的称许性倾向"; } else if (score >= 4.1 && score <= 16.0) { shcxxDENGJI = "较低"; shcxxPINGDING = "可接受"; shcxxMIAOSHU = "他(她)在本次答题中表现出较低的社会称许性倾向,通俗说,比起大多数人,他(她)有点不太在乎别人的评价,能够较客观的进行答题"; if (score > 7.9) { b2 = true; } } } //维度内判断社会称许性等级<<<<<<<<<<<<<<<<<<<<<<<<<<<< //原始分转化为标准分>>>>>>>>>>>>>>>>>>>>>> if (dimTable.Rows[i][5].ToString().Trim().Equals("3"))//智力潜能类 { dimTable.Rows[i][2] = rptBLL.ConvertZhiLiDimScore(dimID, dimscore); dimTable.Rows[i][3] = rptBLL.ConvertZhiLiDimScore(dimID, dim_s); dimTable.Rows[i][4] = rptBLL.ConvertZhiLiDimScore(dimID, dim_e); } else { dimTable.Rows[i][2] = rptBLL.ConvertDimScore(dimID, dimscore); dimTable.Rows[i][3] = rptBLL.ConvertDimScore(dimID, dim_s); dimTable.Rows[i][4] = rptBLL.ConvertDimScore(dimID, dim_e); } //原始分转化为标准分<<<<<<<<<<<<<<<<<<<<<<<<<< } //工作劣势 for (int mm = 0; mm < arGZZT_lieshi.Count; mm++) { lieshi += " " + (mm + 1).ToString() + "、" + arGZZT_lieshi[mm].ToString(); } //工作优势 for (int nn = 0; nn < arGZZT_youshi.Count; nn++) { youshi += " " + (nn + 1).ToString() + "、" + arGZZT_youshi[nn].ToString(); } //作答一致性等级,判定>>>>>>>>>>>>>>>>>> string trustful = string.Empty; string trustfulComments = string.Empty; int nTrustful = Int32.Parse(testerInfoTable.Rows[0][7].ToString()); trustful = (nTrustful == 0) ? "较低" : "较高"; trustfulComments = (nTrustful == 0) ? "他(她)答题时前后心理状态略不稳定,疲劳、环境干扰、心绪波动等均可能导致这种偏误" : "他(她)答题时心理状态基本稳定,此方面导致的测评偏误较小"; if (trustful.Equals("较高")) { b3 = true; } //作答一致性等级,判定<<<<<<<<<<<<<<<<<<< //作答时间,判定>>>>>>>>>>>>>>>>>> TimeSpan ts = DateTime.Parse(testerInfoTable.Rows[0][3].ToString()) - DateTime.Parse(testerInfoTable.Rows[0][2].ToString()); double nRealTime = (ts.TotalSeconds) / (double)60; string answerTimeComments = string.Empty; if (nRealTime <= refMinMinutes) { answerTimeComments = "答题速度过快,有可能是答题过程不够认真或是其他原因,有待进一步了解"; } else if (nRealTime >= refMaxMinutes) { answerTimeComments = "答题速度偏慢,背后原因有待进一步了解"; } else if (nRealTime > refMinMinutes && nRealTime < refMaxMinutes) { b1 = true; answerTimeComments = "答题速度比较适中"; } else { answerTimeComments = string.Empty; } //作答时间,判定<<<<<<<<<<<<<<<<<<<<< //提取智力维度,显示柱状图 rptDataSet ds = new rptDataSet(); for (int j = 0; j < dimTable.Rows.Count; j++) { if (dimTable.Rows[j][5].ToString().Trim().Equals("3"))//智力潜能类 { ds.ZhiliDimScore.AddZhiliDimScoreRow( dimTable.Rows[j][0].ToString().Trim(), dimTable.Rows[j][1].ToString().Trim(), dimTable.Rows[j][2].ToString().Trim()); } } //删除智力维度在维度得分表里。 for (int k = 0; k < dimTable.Rows.Count; k++) { if (dimTable.Rows[k][5].ToString().Trim().Equals("3"))//智力潜能类 { dimTable.Rows[k].Delete(); dimTable.AcceptChanges(); k--; } } //删除三个特殊维度在维度得分表里。 for (int s = 0; s < dimTable.Rows.Count; s++) { if (dimTable.Rows[s][1].ToString().Trim().Equals("社会称许性") || dimTable.Rows[s][1].ToString().Trim().Equals("心理健康度") || dimTable.Rows[s][1].ToString().Trim().Equals("诚信")) { dimTable.Rows[s].Delete(); dimTable.AcceptChanges(); s--; } } string xljk = string.Empty; string xljkLevel = string.Empty; string xljkComnet = string.Empty; xljk = rptBLL.GetXljkLevelAndComments(strGUID);//获取心理健康等级和评语 if (!string.IsNullOrEmpty(xljk)) { int n = xljk.IndexOf("-"); xljkLevel = xljk.Substring(0, n); xljkComnet = xljk.Substring(n + 1, xljk.Length - n - 1); } //数据准备完毕!!! //向报表数据源中插入数据。 ds.Report_ONE.AddReport_ONERow("社会称许性等级", shcxxDENGJI, "社会称许性评定", shcxxPINGDING); ds.Report_ONE.AddReport_ONERow("作答一致性等级", trustful, "测评工具信度", "0.857 ~ 0.949"); ds.Report_ONE.AddReport_ONERow("作答实际时间", ((int)ts.TotalMinutes).ToString()+"分钟", "答题时间参照值", strREFtime + "分钟"); ds.Report_ONE.AddReport_ONERow("答题诚信表现", cxbxPY, "心理健康度状况", xljkLevel); ds.Report_ONE2.AddReport_ONE2Row("社会称许性的相关描述:", " 1、" + shcxxMIAOSHU + ";"); ds.Report_ONE2.AddReport_ONE2Row("做答一致性的相关描述:", " 2、" + trustfulComments + ";"); ds.Report_ONE2.AddReport_ONE2Row("作答时间的相关描述:", " 3、" + answerTimeComments + ";"); ds.Report_ONE2.AddReport_ONE2Row("心理健康的相关描述:", " 4、" + xljkComnet + "。"); ds.zhiweilieshi.AddzhiweilieshiRow(lieshi); ds.zhiweiyoushi.AddzhiweiyoushiRow(youshi); ds.Guanli.AddGuanliRow(sbYRJY.ToString()); ds.Qita.AddQitaRow("其他维度名称"); ds.gerenfazhan.AddgerenfazhanRow(sbGRFZ.ToString()); ReportViewer1.LocalReport.ReportPath = MapPath("Report.rdlc"); ReportDataSource rds0 = new ReportDataSource("DimensionScore", dimTable);//注意这里的name和报表中的一致 ReportDataSource rds1 = new ReportDataSource("TesterInfo", testerInfoTable); ReportDataSource rds2 = new ReportDataSource("Report_ONE", ds.Tables[2]); ReportDataSource rds3 = new ReportDataSource("ZhiliDimScore", ds.Tables[3]); ReportDataSource rds4 = new ReportDataSource("Report_ONE2", ds.Tables[4]); ReportDataSource rds5 = new ReportDataSource("zhiweiyoushi", ds.Tables[5]); ReportDataSource rds6 = new ReportDataSource("zhiweilieshi", ds.Tables[6]); ReportDataSource rds7 = new ReportDataSource("Guanli", ds.Tables[7]); ReportDataSource rds8 = new ReportDataSource("Qita", ds.Tables[8]); ReportDataSource rds9 = new ReportDataSource("gerenfazhan", ds.Tables[9]); ReportParameter rp5Hidden = new ReportParameter("p5Visible", (!p5Visible).ToString()); ReportParameter rp6Hidden = new ReportParameter("p6Visible", (!p6Visible).ToString()); bool b = false; if (b1 == true && b2 == true && b3 == true) { b = true; } ReportParameter rptBelievable = new ReportParameter("rptBelievable", b.ToString()); ReportViewer1.LocalReport.DataSources.Add(rds0); ReportViewer1.LocalReport.DataSources.Add(rds1); ReportViewer1.LocalReport.DataSources.Add(rds2); ReportViewer1.LocalReport.DataSources.Add(rds3); ReportViewer1.LocalReport.DataSources.Add(rds4); ReportViewer1.LocalReport.DataSources.Add(rds5); ReportViewer1.LocalReport.DataSources.Add(rds6); ReportViewer1.LocalReport.DataSources.Add(rds7); ReportViewer1.LocalReport.DataSources.Add(rds8); ReportViewer1.LocalReport.DataSources.Add(rds9); ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp5Hidden, rp6Hidden }); ReportViewer1.LocalReport.Refresh(); } } } }
private void GenPDFReport(string strGUID) { try { #region 业务逻辑处理开始 RptBLL rptBLL = new RptBLL(); ActivityBLL aBLL = new ActivityBLL(); GuidBLL guidBLL = new GuidBLL(); CommentBLL cBLL = new CommentBLL(); DataTable dtTmp = rptBLL.GetDimensionScore(strGUID); dtTmp.DefaultView.Sort = "DIMCLASSID ASC"; DataTable dimTable = dtTmp.DefaultView.ToTable(); DataTable testerInfoTable = rptBLL.GetTesterInfo(strGUID); DimensionBLL dimbll = new DimensionBLL(); //double totalMinutes = rptBLL.GetRefTotalTimeMinute(strGUID); double refMinMinutes = 0; double refMaxMinutes = 0; //if (totalMinutes > 12.1) //{ // refMinMinutes = totalMinutes - (double)12.1; //} //refMaxMinutes = totalMinutes + 12.1; refMinMinutes = rptBLL.GetRefTotalTimeMinute_xiaxian(strGUID); refMaxMinutes = rptBLL.GetRefTotalTimeMinute_shangxian(strGUID); string strREFtime = refMinMinutes.ToString("F1") + " ~ " + refMaxMinutes.ToString("F1"); string shcxxDENGJI = string.Empty; string shcxxPINGDING = string.Empty; string shcxxMIAOSHU = string.Empty; string cxbxPY = string.Empty;//诚信表现评语 string usrNm = testerInfoTable.Rows[0]["testerNAME"].ToString(); string posNm = testerInfoTable.Rows[0]["testerPOSITION"].ToString(); int aID = guidBLL.GetActivityId(strGUID); int positionId = aBLL.GetPositionId(aID); Activity a = aBLL.GetModel(aID); int rptSettings = a.Activity_viewreport; bool p5Visible = true; bool p6Visible = true; if (rptSettings != 0 && rptSettings.ToString().Length > 1) { p5Visible = rptSettings.ToString().Substring(5, 1).Equals("1"); p6Visible = rptSettings.ToString().Substring(6, 1).Equals("1"); } ArrayList arGZZT_youshi = new ArrayList();//工作状况_优势 ArrayList arGZZT_lieshi = new ArrayList();//工作状况_劣势 string youshi = string.Empty; string lieshi = string.Empty; bool bAllDimIsLow = false;//所有维度偏低 bool bAllDimIsHigh = false;//所有维度偏高 StringBuilder sbGZZT = new StringBuilder();//工作状况 StringBuilder sbTZMS = new StringBuilder();//特质描述 StringBuilder sbYRJY = new StringBuilder();//用人建议 StringBuilder sbGRFZ = new StringBuilder();//个人发展 //作答结果是否可信>>>>>>> bool b1 = false;//实际作答时间是否落在参考值区间 bool b2 = false;//社会称许性等级得分大于7.9 bool b3 = false;//作答一致性处于"较高"的等级 //作答结果是否可信<<<<<<< for (int i = 0; i < dimTable.Rows.Count; i++) { int dimID = Int32.Parse(dimTable.Rows[i][0].ToString());//维度ID int dimscore = Int32.Parse(dimTable.Rows[i][2].ToString());//维度原始分 Double dim_s = Double.Parse(dimTable.Rows[i][3].ToString());//维度参考区间开始分 Double dim_e = Double.Parse(dimTable.Rows[i][4].ToString());//维度参考区间结束分 //Double dimQ1 = Double.Parse(dimTable.Rows[i][9].ToString());//Q1 //Double dimQ2 = Double.Parse(dimTable.Rows[i][10].ToString());//Q2 //Double dimQ3 = Double.Parse(dimTable.Rows[i][11].ToString());//Q3 Double p17 = Double.Parse(dimTable.Rows[i][9].ToString()); Double p68 = Double.Parse(dimTable.Rows[i][10].ToString()); Double p92 = Double.Parse(dimTable.Rows[i][11].ToString()); if (dimscore <= p17) { dimTable.Rows[i][8] = "偏低"; } else if (dimscore > p17 && dimscore <= p68) { dimTable.Rows[i][8] = "稍低"; } else if (dimscore > p68 && dimscore < p92) { dimTable.Rows[i][8] = "适配"; } else if (dimscore >= p92) { dimTable.Rows[i][8] = "偏高"; } //维度内判断诚信等级>>>>>>>>>>>>>>>>>>>>>>>>>>>> if (dimTable.Rows[i][1].ToString().Trim().Equals("诚信")) { if (dimscore <= 59.5) { cxbxPY = "有待提高"; } else if (dimscore >= 73.5) { cxbxPY = "比较诚信"; } else if (dimscore > 59.5 && dimscore < 73.5) { cxbxPY = "中等"; } } //维度内判断诚信等级<<<<<<<<<<<<<<<<<<<<<<<<<<<< //获取评语>>>>>>>>>>>>>>>>>>>>>>>>>>>> for (int kk = 1; kk < 5; kk++) { if (dimTable.Rows[i][8].ToString().Trim().Equals("偏低")) { string c = cBLL.GetCommentByAll(positionId, dimID, kk, 4); if (kk == 1) { if (!string.IsNullOrEmpty(c)) { sbTZMS.Append((i + 1).ToString() + "、" + c + Environment.NewLine); } } else if (kk == 2) { if (!string.IsNullOrEmpty(c)) { sbGZZT.Append((i + 1).ToString() + "、" + c + Environment.NewLine); arGZZT_lieshi.Add(c + Environment.NewLine); } } else if (kk == 3) { if (!string.IsNullOrEmpty(c)) { sbYRJY.Append(" * " + c + Environment.NewLine); } } else if (kk == 4) { if (!string.IsNullOrEmpty(c)) { sbGRFZ.Append(" * " + c + Environment.NewLine); } } dimTable.Rows[i][12] = cBLL.GetCommentByAll(positionId, dimID, 1, 4); } else if (dimTable.Rows[i][8].ToString().Trim().Equals("稍低")) { string c = cBLL.GetCommentByAll(positionId, dimID, kk, 3); if (kk == 1) { if (!string.IsNullOrEmpty(c)) { sbTZMS.Append((i + 1).ToString() + "、" + c + Environment.NewLine); } } else if (kk == 2) { if (!string.IsNullOrEmpty(c)) { sbGZZT.Append((i + 1).ToString() + "、" + c + Environment.NewLine); arGZZT_lieshi.Add(c + Environment.NewLine); } } else if (kk == 3) { if (!string.IsNullOrEmpty(c)) { sbYRJY.Append(" * " + c + Environment.NewLine); } } else if (kk == 4) { if (!string.IsNullOrEmpty(c)) { sbGRFZ.Append(" * " + c + Environment.NewLine); } } dimTable.Rows[i][12] = cBLL.GetCommentByAll(positionId, dimID, 1, 3); } else if (dimTable.Rows[i][8].ToString().Trim().Equals("适配")) { string c = cBLL.GetCommentByAll(positionId, dimID, kk, 2); if (kk == 1) { if (!string.IsNullOrEmpty(c)) { sbTZMS.Append((i + 1).ToString() + "、" + c + Environment.NewLine); } } else if (kk == 2) { if (!string.IsNullOrEmpty(c)) { sbGZZT.Append((i + 1).ToString() + "、" + c + Environment.NewLine); arGZZT_youshi.Add(c + Environment.NewLine); } } else if (kk == 3) { if (!string.IsNullOrEmpty(c)) { sbYRJY.Append(" * " + c + Environment.NewLine); } } else if (kk == 4) { if (!string.IsNullOrEmpty(c)) { sbGRFZ.Append(" * " + c + Environment.NewLine); } } dimTable.Rows[i][12] = cBLL.GetCommentByAll(positionId, dimID, 1, 2); } else if (dimTable.Rows[i][8].ToString().Trim().Equals("偏高")) { string c = cBLL.GetCommentByAll(positionId, dimID, kk, 1); if (kk == 1) { if (!string.IsNullOrEmpty(c)) { sbTZMS.Append((i + 1).ToString() + "、" + c + Environment.NewLine); } } else if (kk == 2) { if (!string.IsNullOrEmpty(c)) { sbGZZT.Append((i + 1).ToString() + "、" + c + Environment.NewLine); arGZZT_youshi.Add(c + Environment.NewLine); } } else if (kk == 3) { if (!string.IsNullOrEmpty(c)) { sbYRJY.Append(" * " + c + Environment.NewLine); } } else if (kk == 4) { if (!string.IsNullOrEmpty(c)) { sbGRFZ.Append(" * " + c + Environment.NewLine); } } dimTable.Rows[i][12] = cBLL.GetCommentByAll(positionId, dimID, 1, 1); } } //获取评语<<<<<<<<<<<<<<<<<<<<<<<<<<<< //维度内判断社会称许性等级>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if (dimTable.Rows[i][1].ToString().Trim().Equals("社会称许性")) { double score = double.Parse(dimTable.Rows[i][2].ToString()); if (score >= 0 && score <= 0.9) { shcxxDENGJI = "较高"; shcxxPINGDING = "倾向偏强"; shcxxMIAOSHU = "他(她)在本次答题时表现出较强的获取赞许的倾向,这种倾向可能是有意识的,也可能是无意识的,不能排除潜意识的影响"; } else if (score >= 1.0 && score <= 4.0) { shcxxDENGJI = "中等"; shcxxPINGDING = "可接受"; shcxxMIAOSHU = "他(她)在本次答题时表现出与大多数人相似的称许性倾向"; //社会称许性取中间等级(社会称许性既不偏高,也不偏低时)显示比较可信,偏高偏低都需要进一步测评。 b2 = true; } else if (score >= 4.1 && score <= 16.0) { shcxxDENGJI = "较低"; shcxxPINGDING = "可接受"; shcxxMIAOSHU = "他(她)在本次答题中表现出较低的社会称许性倾向,通俗说,比起大多数人,他(她)有点不太在乎别人的评价,能够较客观的进行答题"; } } //维度内判断社会称许性等级<<<<<<<<<<<<<<<<<<<<<<<<<<<< //原始分转化为标准分>>>>>>>>>>>>>>>>>>>>>> if (dimTable.Rows[i][5].ToString().Trim().Equals("3"))//智力潜能类 { dimTable.Rows[i][2] = rptBLL.ConvertZhiLiDimScore(dimID, dimscore); dimTable.Rows[i][3] = rptBLL.ConvertZhiLiDimScore(dimID, dim_s); dimTable.Rows[i][4] = rptBLL.ConvertZhiLiDimScore(dimID, dim_e); } else { dimTable.Rows[i][2] = rptBLL.ConvertDimScore(dimID, dimscore); dimTable.Rows[i][3] = rptBLL.ConvertDimScore(dimID, dim_s); dimTable.Rows[i][4] = rptBLL.ConvertDimScore(dimID, dim_e); } //原始分转化为标准分<<<<<<<<<<<<<<<<<<<<<<<<<< } //查看所有维度是否均较低 2012.3.18 string dimRes = string.Empty; for (int kj = 0; kj < dimTable.Rows.Count; kj++) { if (false == dimTable.Rows[kj]["DIMCLASSID"].ToString().Trim().Equals("3")&& false == dimTable.Rows[kj]["DIMNM"].ToString().Trim().Equals("社会称许性") && false == dimTable.Rows[kj]["DIMNM"].ToString().Trim().Equals("心理健康度") && false == dimTable.Rows[kj]["DIMNM"].ToString().Trim().Equals("诚信"))//除去智力维度 { dimRes = dimTable.Rows[kj]["DIMRESULT"].ToString().Trim(); if (dimRes.Equals("偏低") || dimRes.Equals("稍低")) { bAllDimIsLow = true; } else { bAllDimIsLow = false; break; } } } //查看所有维度是否均较高 2012.3.18 for (int jk = 0; jk < dimTable.Rows.Count; jk++) { if (false == dimTable.Rows[jk]["DIMCLASSID"].ToString().Trim().Equals("3") && false == dimTable.Rows[jk]["DIMNM"].ToString().Trim().Equals("社会称许性") && false == dimTable.Rows[jk]["DIMNM"].ToString().Trim().Equals("心理健康度") && false == dimTable.Rows[jk]["DIMNM"].ToString().Trim().Equals("诚信"))//除去智力维度 { dimRes = dimTable.Rows[jk]["DIMRESULT"].ToString().Trim(); if (dimRes.Equals("适配") || dimRes.Equals("偏高")) { bAllDimIsHigh = true; } else { bAllDimIsHigh = false; break; } } } //工作劣势 for (int mm = 0; mm < arGZZT_lieshi.Count; mm++) { lieshi += " " + (mm + 1).ToString() + "、" + arGZZT_lieshi[mm].ToString(); } if (bAllDimIsHigh == true)//add by conghui 2012.3.18 { lieshi += " " + "答题者在本次所测试的心理特征维度上得分均偏高,请注意其社会称许性得分,如果该得分在适中区间,可以认为他/她在这些特质方面的表现可以符合该岗位要求。"; } //工作优势 for (int nn = 0; nn < arGZZT_youshi.Count; nn++) { youshi += " " + (nn + 1).ToString() + "、" + arGZZT_youshi[nn].ToString(); } if (bAllDimIsLow == true)//add by conghui 2012.3.18 { youshi += " " + "答题者在本次所测试的各心理特征维度上的得分均偏低,他/她在这些方面的表现与岗位要求有些差距。"; } //作答一致性等级,判定>>>>>>>>>>>>>>>>>> string trustful = string.Empty; string trustfulComments = string.Empty; int nTrustful = Int32.Parse(testerInfoTable.Rows[0][7].ToString()); trustful = (nTrustful == 0) ? "较低" : "较高"; trustfulComments = (nTrustful == 0) ? "他(她)答题时前后心理状态略不稳定,疲劳、环境干扰、心绪波动等均可能导致这种偏误" : "他(她)答题时心理状态基本稳定,此方面导致的测评偏误较小"; if (trustful.Equals("较高")) { b3 = true; } //作答一致性等级,判定<<<<<<<<<<<<<<<<<<< //作答时间,判定>>>>>>>>>>>>>>>>>> TimeSpan ts = DateTime.Parse(testerInfoTable.Rows[0][3].ToString()) - DateTime.Parse(testerInfoTable.Rows[0][2].ToString()); double nRealTime = (ts.TotalSeconds) / (double)60; string answerTimeComments = string.Empty; if (nRealTime <= refMinMinutes) { answerTimeComments = "答题速度过快,有可能是答题过程不够认真或是其他原因,有待进一步了解"; } else if (nRealTime >= refMaxMinutes) { answerTimeComments = "答题速度偏慢,背后原因有待进一步了解"; } else if (nRealTime > refMinMinutes && nRealTime < refMaxMinutes) { b1 = true; answerTimeComments = "答题速度比较适中"; } else { answerTimeComments = string.Empty; } //作答时间,判定<<<<<<<<<<<<<<<<<<<<< //提取智力维度,显示柱状图 rptDataSet ds = new rptDataSet(); for (int j = 0; j < dimTable.Rows.Count; j++) { if (dimTable.Rows[j]["DIMCLASSID"].ToString().Trim().Equals("3"))//智力潜能类 { ds.ZhiliDimScore.AddZhiliDimScoreRow( dimTable.Rows[j]["DIMID"].ToString().Trim(), dimTable.Rows[j]["DIMNM"].ToString().Trim(), dimTable.Rows[j]["DIMSCORE"].ToString().Trim()); } } //删除智力维度在维度得分表里。 for (int k = 0; k < dimTable.Rows.Count; k++) { if (dimTable.Rows[k]["DIMCLASSID"].ToString().Trim().Equals("3"))//智力潜能类 { dimTable.Rows[k].Delete(); dimTable.AcceptChanges(); k--; } } //删除三个特殊维度在维度得分表里。 for (int s = 0; s < dimTable.Rows.Count; s++) { if (dimTable.Rows[s]["DIMNM"].ToString().Trim().Equals("社会称许性") || dimTable.Rows[s]["DIMNM"].ToString().Trim().Equals("心理健康度") || dimTable.Rows[s]["DIMNM"].ToString().Trim().Equals("诚信")) { dimTable.Rows[s].Delete(); dimTable.AcceptChanges(); s--; } } string xljk = string.Empty; string xljkLevel = string.Empty; string xljkComnet = string.Empty; xljk = rptBLL.GetXljkLevelAndComments(strGUID);//获取心理健康等级和评语 if (!string.IsNullOrEmpty(xljk)) { int n = xljk.IndexOf("-"); xljkLevel = xljk.Substring(0, n); xljkComnet = xljk.Substring(n + 1, xljk.Length - n - 1); } bool b = false; if (b1 == true && b2 == true && b3 == true) { b = true;//答题结果是否可信 } //数据准备完毕!!! #endregion #region 准备生成pdf报告 Document doc = new Document(PageSize.A4); PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream( Server.MapPath("../PDF") + "\\" + strGUID + ".pdf", FileMode.Create)); doc.Open(); BaseFont bf = BaseFont.CreateFont(@"C:\Windows\fonts\simsun.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); Font zhengwen_font = new Font(bf); Font zhengwen_title = new Font(bf, 12, Font.BOLD); #endregion #region 封面 Paragraph ph = new Paragraph(); ph.Alignment = Element.ALIGN_RIGHT; ph.Font = zhengwen_font; ph.Add("报告编号:" + strGUID); doc.Add(ph); //header Image jpeg = Image.GetInstance(Server.MapPath("../images/header.jpg")); jpeg.Alignment = Image.ALIGN_CENTER; jpeg.ScalePercent(70); doc.Add(jpeg); //first page title BaseFont bfHei = BaseFont.CreateFont(@"C:\WINDOWS\fonts\SIMHEI.TTF", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); Font fRptTitle = new Font(bfHei, 24, Font.BOLD); Paragraph phRptTitle = new Paragraph(); phRptTitle.Alignment = Element.ALIGN_CENTER; phRptTitle.Font = fRptTitle; phRptTitle.Add(testerInfoTable.Rows[0]["testerCOMPANYNM"].ToString() + Environment.NewLine); phRptTitle.Add("4S店" + posNm + "人才测评报告"); phRptTitle.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); phRptTitle.SpacingAfter = 25; phRptTitle.SpacingBefore = 70; doc.Add(phRptTitle); //logo Image logo = Image.GetInstance(Server.MapPath("../images/logo.jpg")); logo.Alignment = Image.ALIGN_CENTER; logo.ScalePercent(70); doc.Add(logo); //姓名,日期 Paragraph phNm = new Paragraph(); //phNm.Alignment = Element.ALIGN_CENTER; phNm.Font = zhengwen_font; phNm.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); phNm.Add("姓名:" + usrNm + Environment.NewLine); phNm.Add("日期:" + DateTime.Parse(testerInfoTable.Rows[0]["testerDATE"].ToString()).ToShortDateString()); phNm.IndentationLeft = 222; phNm.SpacingBefore = 100; phNm.SpacingAfter = 75; doc.Add(phNm); //footer doc.Add(jpeg); #endregion #region 报告阅读说明 doc.NewPage(); Paragraph p0 = new Paragraph("报告阅读说明", new Font(bfHei, 14, Font.BOLD)); p0.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); p0.SpacingAfter = TITLE_TEXT_DISTANCE;//标题与后面文字间隔 p0.Alignment = Element.ALIGN_CENTER; doc.Add(p0); Paragraph phshuoming = new Paragraph(); phshuoming.Font = zhengwen_font; phshuoming.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); phshuoming.Alignment = Element.ALIGN_LEFT; phshuoming.Add(@" 本报告的系统平台内包含人格量表、态度量表、动机量表等数十种心理测验量表,开发过程综合了麦克莱兰德(David C.McClelland)、班杜拉(Albert Bandura)、卡特尔(R.B.Cattell)、吉尔福特(J.P.Guilford)、霍兰德(J.L.Holland) 等多位知名心理学家关于人格类型、态度的形成与改变、驱力理论、管理心理理论等多个专题领域的相关观点,在国内高校本土化研究实践的基础上,进一步实现汽车行业化,力争满足汽车行业广大测评使用者的需求。 报告第一部分为本次测评有效性技术指标的监测结果,并给出简要解释,供报告使用者参考;需要说明的是,以下因素可能影响测评报告的有效性: * 答题者不具备基本水平的阅读理解能力 * 答题时过于关心得到的结果是怎样的 * 答题者误解了测评活动的本质 * 答题者感到较大的环境压力 * 答题过程中存在较严重的心理干扰 * 答题者存在较强的药物依赖 报告第二部分中综合适配度是指以本次测评报告中呈现的各心理特征维度为该岗位的胜任要求时答题者与岗位要求间的适配程度,由于不同用户定制不同,适配度含义会有差异; 报告第三部分逐一分析各项心理特征具体水平状况,提供个人结果与参照标准的对比; 报告第四部分管理用人建议由具备丰富汽车行业实战经验及深厚行业理论基础的资深专家二十余名参与开发,其中融入了多年实践与研究的心得,旨在帮助管理者和报告使用者明确提升方向,解决实际问题; 报告第五部分中的个人发展建议依据杜布(L.W.Doob)、费斯汀格(L.Festinger)、科尔曼(H.Kelman)等人的相关理论编制;由于每个人职业发展机遇、所处团队文化等诸多外因的不确定性,该部分仅就本次测评结果为使用者提供个人发展方面的指导与建议。 由于个体心理结构的复杂性、心理发展的动态性和测评条件的局限性,报告使用者需避免用绝对化的眼光看待测评报告的结果;使用本报告时若能结合标准化面试、情景模拟等其他人才测评技术手段,将会有利于进一步全面评估被测评者的个人能力。"); doc.Add(phshuoming); #endregion #region 第一部分 doc.NewPage(); Paragraph p1 = new Paragraph("第一部分 测评有效性及个人基本情况", new Font(bfHei, 14, Font.BOLD)); p1.SpacingAfter = TITLE_TEXT_DISTANCE;//标题与后面文字间隔 p1.Alignment = Element.ALIGN_CENTER; doc.Add(p1); Paragraph p11 = new Paragraph(" 本部分通过以下指标结果来综合评价本次测评的有效性,并报告答题者的基本心理状况。", zhengwen_font); p11.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p11); //第一部分表格 PdfPTable p1t1 = new PdfPTable(4); p1t1.SpacingAfter = 5; p1t1.SpacingBefore = 15; //row 1 PdfPCell cell11 = new PdfPCell(new Paragraph("社会称许性等级", new Font(bf, 10, Font.NORMAL))); cell11.BackgroundColor = new BaseColor(220, 220, 220); cell11.BorderWidthLeft = 0; cell11.BorderWidthRight = 0; cell11.MinimumHeight = TABLE_ROW_HEIGHT; cell11.VerticalAlignment = Element.ALIGN_MIDDLE; cell11.BorderWidthBottom = 0; PdfPCell cell12 = new PdfPCell(new Paragraph(shcxxDENGJI, new Font(bf, 10, Font.NORMAL))); cell12.BorderWidthLeft = 0; cell12.BorderWidthRight = 0; cell12.VerticalAlignment = Element.ALIGN_MIDDLE; cell12.BorderWidthBottom = 0; PdfPCell cell13 = new PdfPCell(new Paragraph("社会称许性评定", new Font(bf, 10, Font.NORMAL))); cell13.BackgroundColor = new BaseColor(220, 220, 220); cell13.BorderWidthLeft = 0; cell13.BorderWidthRight = 0; cell13.VerticalAlignment = Element.ALIGN_MIDDLE; cell13.BorderWidthBottom = 0; PdfPCell cell14 = new PdfPCell(new Paragraph(shcxxPINGDING, new Font(bf, 10, Font.NORMAL))); cell14.BorderWidthLeft = 0; cell14.BorderWidthRight = 0; cell14.VerticalAlignment = Element.ALIGN_MIDDLE; cell14.BorderWidthBottom = 0; //row 2 PdfPCell cell21 = new PdfPCell(new Paragraph("作答一致性等级", new Font(bf, 10, Font.NORMAL))); cell21.BackgroundColor = new BaseColor(220, 220, 220); cell21.BorderWidthLeft = 0; cell21.BorderWidthRight = 0; cell21.MinimumHeight = TABLE_ROW_HEIGHT; cell21.VerticalAlignment = Element.ALIGN_MIDDLE; cell21.BorderWidthBottom = 0; PdfPCell cell22 = new PdfPCell(new Paragraph(trustful, new Font(bf, 10, Font.NORMAL))); cell22.BorderWidthLeft = 0; cell22.BorderWidthRight = 0; cell22.VerticalAlignment = Element.ALIGN_MIDDLE; cell22.BorderWidthBottom = 0; PdfPCell cell23 = new PdfPCell(new Paragraph("测评工具信度", new Font(bf, 10, Font.NORMAL))); cell23.BackgroundColor = new BaseColor(220, 220, 220); cell23.BorderWidthLeft = 0; cell23.BorderWidthRight = 0; cell23.VerticalAlignment = Element.ALIGN_MIDDLE; cell23.BorderWidthBottom = 0; PdfPCell cell24 = new PdfPCell(new Paragraph("0.857 ~ 0.949", new Font(bf, 10, Font.NORMAL))); cell24.BorderWidthLeft = 0; cell24.BorderWidthRight = 0; cell24.VerticalAlignment = Element.ALIGN_MIDDLE; cell24.BorderWidthBottom = 0; //row 3 PdfPCell cell31 = new PdfPCell(new Paragraph("作答实际时间", new Font(bf, 10, Font.NORMAL))); cell31.BackgroundColor = new BaseColor(220, 220, 220); cell31.BorderWidthLeft = 0; cell31.BorderWidthRight = 0; cell31.MinimumHeight = TABLE_ROW_HEIGHT; cell31.VerticalAlignment = Element.ALIGN_MIDDLE; cell31.BorderWidthBottom = 0; PdfPCell cell32 = new PdfPCell(new Paragraph(((int)ts.TotalMinutes).ToString() + "分钟", new Font(bf, 10, Font.NORMAL))); cell32.BorderWidthLeft = 0; cell32.BorderWidthRight = 0; cell32.VerticalAlignment = Element.ALIGN_MIDDLE; cell32.BorderWidthBottom = 0; PdfPCell cell33 = new PdfPCell(new Paragraph("答题时间参照值", new Font(bf, 10, Font.NORMAL))); cell33.BackgroundColor = new BaseColor(220, 220, 220); cell33.BorderWidthLeft = 0; cell33.BorderWidthRight = 0; cell33.VerticalAlignment = Element.ALIGN_MIDDLE; cell33.BorderWidthBottom = 0; PdfPCell cell34 = new PdfPCell(new Paragraph(strREFtime + "分钟", new Font(bf, 10, Font.NORMAL))); cell34.BorderWidthLeft = 0; cell34.BorderWidthRight = 0; cell34.VerticalAlignment = Element.ALIGN_MIDDLE; cell34.BorderWidthBottom = 0; //row 4 PdfPCell cell41 = new PdfPCell(new Paragraph("答题诚信表现", new Font(bf, 10, Font.NORMAL))); cell41.BackgroundColor = new BaseColor(220, 220, 220); cell41.BorderWidthLeft = 0; cell41.BorderWidthRight = 0; cell41.MinimumHeight = TABLE_ROW_HEIGHT; cell41.VerticalAlignment = Element.ALIGN_MIDDLE; PdfPCell cell42 = new PdfPCell(new Paragraph(cxbxPY, new Font(bf, 10, Font.NORMAL))); cell42.BorderWidthLeft = 0; cell42.BorderWidthRight = 0; cell42.VerticalAlignment = Element.ALIGN_MIDDLE; PdfPCell cell43 = new PdfPCell(new Paragraph("心理健康度状况", new Font(bf, 10, Font.NORMAL))); cell43.BackgroundColor = new BaseColor(220, 220, 220); cell43.BorderWidthLeft = 0; cell43.BorderWidthRight = 0; cell43.VerticalAlignment = Element.ALIGN_MIDDLE; PdfPCell cell44 = new PdfPCell(new Paragraph(xljkLevel, new Font(bf, 10, Font.NORMAL))); cell44.BorderWidthLeft = 0; cell44.BorderWidthRight = 0; cell44.VerticalAlignment = Element.ALIGN_MIDDLE; PdfPCell[] cells1 = new PdfPCell[] { cell11, cell12, cell13, cell14 }; PdfPRow row1 = new PdfPRow(cells1); PdfPCell[] cells2 = new PdfPCell[] { cell21, cell22, cell23, cell24 }; PdfPRow row2 = new PdfPRow(cells2); PdfPCell[] cells3 = new PdfPCell[] { cell31, cell32, cell33, cell34 }; PdfPRow row3 = new PdfPRow(cells3); PdfPCell[] cells4 = new PdfPCell[] { cell41, cell42, cell43, cell44 }; PdfPRow row4 = new PdfPRow(cells4); p1t1.Rows.Add(row1); p1t1.Rows.Add(row2); p1t1.Rows.Add(row3); p1t1.Rows.Add(row4); doc.Add(p1t1); Paragraph p12 = new Paragraph(" 综合来看," + usrNm + "本次作答结果" + (b == true ? "比较可信。" : "有必要进一步测评。"), zhengwen_font); p12.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p12); Paragraph p13 = new Paragraph(" 1、" + shcxxMIAOSHU + ";", zhengwen_font); p13.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p13); Paragraph p14 = new Paragraph(" 2、" + trustfulComments + ";", zhengwen_font); p14.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p14); Paragraph p15 = new Paragraph(" 3、" + answerTimeComments + ";", zhengwen_font); p15.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p15); Paragraph p16 = new Paragraph(" 4、" + xljkComnet + "。", zhengwen_font); p16.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p16); #endregion #region 第二部分 doc.NewPage(); Paragraph p2 = new Paragraph("第二部分 与4S店" + posNm + "岗位规范的综合适配情况", new Font(bfHei, 14, Font.BOLD)); p2.SpacingAfter = TITLE_TEXT_DISTANCE;//标题与后面文字间隔 p2.Alignment = Element.ALIGN_CENTER; doc.Add(p2); Paragraph p21 = new Paragraph(" 将本次测评数据比照汽车行业该岗位素质特征模型统计数据," + usrNm + "与4S店" + posNm + "的综合适配度为:", zhengwen_font); p21.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p21); System.Drawing.Bitmap bmpScore = new System.Drawing.Bitmap(Server.MapPath(@"../images/score_bk.png")); System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmpScore); System.Drawing.Pen redPen = new System.Drawing.Pen(System.Drawing.Color.Red, 3); System.Drawing.Font f = new System.Drawing.Font("Arial", 15); System.Drawing.SolidBrush brush = new System.Drawing.SolidBrush(System.Drawing.Color.Red); g.DrawString(float.Parse(testerInfoTable.Rows[0]["testerTOTALSCORE"].ToString()).ToString("0.0%"), f, brush, 18, 10); g.Dispose(); Image scorePic = Image.GetInstance(bmpScore, new BaseColor(0)); scorePic.Alignment = Image.ALIGN_CENTER; scorePic.ScalePercent(70); doc.Add(scorePic); Paragraph p22 = new Paragraph(" ● " + usrNm + "担任" + posNm + "的优势:", zhengwen_title); p22.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p22); Paragraph p23 = new Paragraph(" 我们对成功的建议是:“以已之长,补已之短”。学会了这一点将会影响个人对工作的喜好甚至职业发展的成败。" + Environment.NewLine + youshi, zhengwen_font); p23.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p23); Paragraph p24 = new Paragraph(" ● " + usrNm + "担任" + posNm + "的劣势:", zhengwen_title); p24.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p24); Paragraph p25 = new Paragraph(" 有的人不足之处比较明显,有的却没有明显缺点,或者他(她)自己并不容易意识到,了解个人存在的问题就是完善自我的重要一步。下面列出了他(她)工作中可能存在的欠缺,目的是为了引起对它们的 “注意”,促进反思。" + Environment.NewLine + lieshi, zhengwen_font); p25.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p25); #endregion #region 第三部分 doc.NewPage(); Paragraph p3 = new Paragraph("第三部分 各项特征具体状况", new Font(bfHei, 14, Font.BOLD)); p3.SpacingAfter = TITLE_TEXT_DISTANCE;//标题与后面文字间隔 p3.Alignment = Element.ALIGN_CENTER; doc.Add(p3); Paragraph p31 = new Paragraph(" 下列图中灰色区间是经过统计分析得出的标准参照区间,下方红色游标指示" + usrNm + "在该特征上的个人得分水平。", zhengwen_font); p31.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p31); for (int i = 0; i < dimTable.Rows.Count; i++) { Paragraph p = new Paragraph(" " + dimTable.Rows[i]["DIMNM"].ToString(), zhengwen_title); p.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p); Double rangeStart = Double.Parse(dimTable.Rows[i]["DIMRANGE_START"].ToString()); Double rangeEnd = Double.Parse(dimTable.Rows[i]["DIMRANGE_END"].ToString()); Double rangeCurrent = Double.Parse(dimTable.Rows[i]["DIMSCORE"].ToString()); Image ruler = Image.GetInstance(drawRuler(rangeStart, rangeEnd, rangeCurrent), new BaseColor(0)); ruler.Alignment = Image.ALIGN_CENTER; ruler.ScalePercent(70); doc.Add(ruler); } for (int j = 0; j < dimTable.Rows.Count; j++) { Paragraph p = new Paragraph(" ● " + dimTable.Rows[j]["DIMNM"].ToString() + " " + dimTable.Rows[j]["dimDESC"].ToString(), zhengwen_font); p.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p); Paragraph q = new Paragraph(" 他(她)在这方面的表现情况是 " + dimTable.Rows[j]["dimCOMMENTS"].ToString(), zhengwen_font); q.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(q); } //各项个人特征得分等级表 Paragraph p32 = new Paragraph("各项个人特征得分等级表", zhengwen_title); p32.Alignment = Element.ALIGN_CENTER; p32.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p32); PdfPTable p3t1 = new PdfPTable(4); p3t1.SpacingAfter = 5; p3t1.SpacingBefore = 15; /* //row 1 PdfPCell c11 = new PdfPCell(new Paragraph("职业特质类别", new Font(bf, 10, Font.BOLD))); c11.BackgroundColor = new BaseColor(220,220,220); c11.BorderWidthLeft = 0; c11.BorderWidthRight = 0; c11.MinimumHeight = TABLE_ROW_HEIGHT; c11.VerticalAlignment = Element.ALIGN_MIDDLE; c11.HorizontalAlignment = Element.ALIGN_CENTER; c11.BorderWidthBottom = 0; c11.BorderWidthTop = 0; */ PdfPCell c12 = new PdfPCell(new Paragraph("个人特征", new Font(bf, 10, Font.BOLD))); c12.BackgroundColor = new BaseColor(220, 220, 220); c12.BorderWidthLeft = 0; c12.BorderWidthRight = 0; c12.VerticalAlignment = Element.ALIGN_MIDDLE; c12.HorizontalAlignment = Element.ALIGN_CENTER; c12.BorderWidthBottom = 0; c12.BorderWidthTop = 0; c12.MinimumHeight = TABLE_ROW_HEIGHT; PdfPCell c13 = new PdfPCell(new Paragraph("实际得分", new Font(bf, 10, Font.BOLD))); c13.BackgroundColor = new BaseColor(220, 220, 220); c13.BorderWidthLeft = 0; c13.BorderWidthRight = 0; c13.VerticalAlignment = Element.ALIGN_MIDDLE; c13.HorizontalAlignment = Element.ALIGN_CENTER; c13.BorderWidthBottom = 0; c13.BorderWidthTop = 0; PdfPCell c14 = new PdfPCell(new Paragraph("参考区间", new Font(bf, 10, Font.BOLD))); c14.BackgroundColor = new BaseColor(220, 220, 220); c14.BorderWidthLeft = 0; c14.BorderWidthRight = 0; c14.VerticalAlignment = Element.ALIGN_MIDDLE; c14.HorizontalAlignment = Element.ALIGN_CENTER; c14.BorderWidthBottom = 0; c14.BorderWidthTop = 0; PdfPCell c15 = new PdfPCell(new Paragraph("评价等级", new Font(bf, 10, Font.BOLD))); c15.BackgroundColor = new BaseColor(220, 220, 220); c15.BorderWidthLeft = 0; c15.BorderWidthRight = 0; c15.VerticalAlignment = Element.ALIGN_MIDDLE; c15.HorizontalAlignment = Element.ALIGN_CENTER; c15.BorderWidthBottom = 0; c15.BorderWidthTop = 0; PdfPCell[] cs1 = new PdfPCell[] { c12, c13, c14, c15 }; PdfPRow r1 = new PdfPRow(cs1); p3t1.Rows.Add(r1); for (int k = 0; k < dimTable.Rows.Count; k++) { /* PdfPCell c1 = new PdfPCell(new Paragraph(dimTable.Rows[k]["dimCLASSNM"].ToString(), new Font(bf, 10, Font.NORMAL))); c1.VerticalAlignment = Element.ALIGN_MIDDLE; c1.HorizontalAlignment = Element.ALIGN_CENTER; c1.BorderWidthLeft = 0; c1.BorderWidthRight = 0; //c1.BorderWidthBottom = 0; c1.BorderWidthTop = 0; c1.MinimumHeight = TABLE_ROW_HEIGHT; */ PdfPCell c2 = new PdfPCell(new Paragraph(dimTable.Rows[k]["dimNM"].ToString(), new Font(bf, 10, Font.NORMAL))); c2.VerticalAlignment = Element.ALIGN_MIDDLE; c2.HorizontalAlignment = Element.ALIGN_CENTER; c2.BorderWidthLeft = 0; c2.BorderWidthRight = 0; //c2.BorderWidthBottom = 0; c2.BorderWidthTop = 0; c2.MinimumHeight = TABLE_ROW_HEIGHT; PdfPCell c3 = new PdfPCell(new Paragraph(dimTable.Rows[k]["dimSCORE"].ToString(), new Font(bf, 10, Font.NORMAL))); c3.VerticalAlignment = Element.ALIGN_MIDDLE; c3.HorizontalAlignment = Element.ALIGN_CENTER; c3.BorderWidthLeft = 0; c3.BorderWidthRight = 0; //c3.BorderWidthBottom = 0; c3.BorderWidthTop = 0; PdfPCell c4 = new PdfPCell(new Paragraph(dimTable.Rows[k]["dimRANGE_START"].ToString() + " ~ " + dimTable.Rows[k]["dimRANGE_END"].ToString(), new Font(bf, 10, Font.NORMAL))); c4.VerticalAlignment = Element.ALIGN_MIDDLE; c4.HorizontalAlignment = Element.ALIGN_CENTER; c4.BorderWidthLeft = 0; c4.BorderWidthRight = 0; //c4.BorderWidthBottom = 0; c4.BorderWidthTop = 0; PdfPCell c5 = new PdfPCell(new Paragraph(dimTable.Rows[k]["dimRESULT"].ToString(), new Font(bf, 10, Font.NORMAL))); c5.VerticalAlignment = Element.ALIGN_MIDDLE; c5.HorizontalAlignment = Element.ALIGN_CENTER; c5.BorderWidthLeft = 0; c5.BorderWidthRight = 0; //c5.BorderWidthBottom = 0; c5.BorderWidthTop = 0; PdfPCell[] ces1 = new PdfPCell[] { c2, c3, c4, c5 }; PdfPRow ro1 = new PdfPRow(ces1); p3t1.Rows.Add(ro1); } doc.Add(p3t1); //智力柱状图 //各项个人特征得分等级表 if (ds != null && ds.ZhiliDimScore.Rows.Count > 0) { Paragraph p33 = new Paragraph("各项智力测评结果图", zhengwen_title); p33.Alignment = Element.ALIGN_CENTER; p33.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p33); Image chrt = Image.GetInstance(makeChart(ds.ZhiliDimScore), new BaseColor(0)); chrt.Alignment = Image.ALIGN_CENTER; chrt.ScalePercent(80); doc.Add(chrt); } #endregion #region 第四部分 doc.NewPage(); Paragraph p4 = new Paragraph("第四部分 4S店管理用人建议", new Font(bfHei, 14, Font.BOLD)); p4.SpacingAfter = TITLE_TEXT_DISTANCE;//标题与后面文字间隔 p4.Alignment = Element.ALIGN_CENTER; doc.Add(p4); Paragraph p41 = new Paragraph(" 针对" + usrNm + "的特点,管理工作中建议注意以下方面:" + Environment.NewLine + sbYRJY.ToString(), zhengwen_font); p41.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p41); #endregion #region 第五部分 doc.NewPage(); Paragraph p5 = new Paragraph("第五部分 个人发展建议", new Font(bfHei, 14, Font.BOLD)); p5.SpacingAfter = TITLE_TEXT_DISTANCE;//标题与后面文字间隔 p5.Alignment = Element.ALIGN_CENTER; doc.Add(p5); Paragraph p51 = new Paragraph(" 本部分是针对" + usrNm + "不够完善的素质提供的一些发展建议。若能要花时间认真思考并付注于行动,定会对本人有所帮助,建议如下: " + Environment.NewLine + sbGRFZ.ToString(), zhengwen_font); p51.SetLeading(PARAGRAPH_SPACING, PARAGRAPH_SPACING); doc.Add(p51); #endregion doc.Close(); } catch (Exception ex) { //Response.Write(ex.Message); StreamWriter errof = new StreamWriter(Server.MapPath(@"../PDF/") + "测评系统log.txt"); errof.WriteLine(System.DateTime.Now.ToString() + ":错误: " + ex.Message); errof.Flush(); errof.Close(); } }