diff --git a/DataBase/版本日志/HJGLDB_DS_2025-06-23_bwj.sql b/DataBase/版本日志/HJGLDB_DS_2025-06-23_bwj.sql new file mode 100644 index 0000000..5cd2024 --- /dev/null +++ b/DataBase/版本日志/HJGLDB_DS_2025-06-23_bwj.sql @@ -0,0 +1,137 @@ + + +ALTER PROCEDURE [dbo].[HJGL_sp_rpt_NDTReport] +( + @ProjectId NVARCHAR(50) = null, + @trustDate datetime = null +) +AS +/***************ձ**********************/ +SELECT NDTType.NDT_ID, +Base_Project.ProjectCode AS ProjectCode,--ʩ +Base_Project.ProjectName AS ProjectName,--Ŀ +NDTType.NDT_Code,--ⷽʽ +ISNULL(need_check_count.need_check_count,0) as need_check_count,--⺸ϼƣ +ISNULl(trust_count_current.trust_count_current,0) as trust_count_current,--ίк +ISNULL(trust_count_total.trust_count_total,0) as trust_count_total,--ۼίк +ISNULL(check_count_current.check_count_current,0) as check_count_current,--ռ⺸ +ISNULL(check_count.check_count,0) as check_count,--ۼƼ⺸ +ISNULL(total_check_Pass_count.total_check_Pass_count,0) as total_check_Pass_count,--ۼƺϸ񺸿 +ISNULL(check_count_film.check_count_film,0) AS check_count_film,--ۼƼƬ +ISNULL(check_count_Pass_film.check_count_Pass_film,0) as check_count_Pass_film,--ۼƺϸƬ + +CONVERT(nvarchar(10),CAST(CAST((CASE ISNULL(need_check_count.need_check_count,0) WHEN 0 THEN 0 + ELSE 1.0 * ISNULL(check_count.check_count,0)/(1.0 * need_check_count.need_check_count) END) AS DECIMAL(19,3))*100 as DECIMAL(19,1)) )+'%' + AS complated_check_rate, --ɼ ۼƼ⺸/⺸ + +CONVERT(nvarchar(10),CAST(CAST((CASE ISNULL(check_count.check_count,0) WHEN 0 THEN 0 + ELSE 1.0 * ISNULL(total_check_Pass_count.total_check_Pass_count,0)/(1.0 * check_count.check_count) END) AS DECIMAL(19,3))*100 as DECIMAL(19,1)) )+'%' + AS check_onePass_rate,--һκϸʣ ۼƺϸ񺸿/ۼƼ⺸ + +(CASE WHEN ISNULL(check_count_film.check_count_film,0)>0 +THEN CONVERT(nvarchar(10),ISNULL(check_count_Pass_film.check_count_Pass_film,0)/ISNULL(check_count_film.check_count_film,0)*1.0*100)+'%' +ELSE '0%' END) AS check_onePass_film_rate,--һκϸʣƬ ۼƺϸƬ/ۼƼƬ + +(isnull(check_count.check_count,0) - isnull(total_check_Pass_count.total_check_Pass_count,0)) AS check_noPass_count,--ۼƼⲻϸ ۼƼ⺸-ۼƺϸ񺸿 + +(isnull(check_count_film.check_count_film,0) - isnull(check_count_Pass_film,0)) as check_noPass_film_count,--ۼƼⲻϸƬ ۼƼƬ-ۼƺϸƬ + +ISNULL(repair_current_film.repair_current_film,0) AS repair_current_film,--췵Ƭɣ +ISNULL(repair_total_film.repair_total_film,0) AS repair_total_film,--췵Ƭۼɣ +(ISNULl(check_count_film.check_count_film,0) - isnull(check_count_Pass_film.check_count_Pass_film,0))-ISNULL(repair_total_film.repair_total_film,0) as pending_repair_film, --췵Ƭ ۼƼⲻϸƬ- 췵Ƭۼɣ +isnull(repair_current_count.repair_current_count,0) as repair_current_count,--췵 +isnull(repair_total_count.repair_total_count,0) as repair_total_count, --췵ۼ +(isnull(check_count.check_count,0) - isnull(total_check_Pass_count.total_check_Pass_count,0))-isnull(repair_total_count.repair_total_count,0) as pending_repair_count --췵 (ۼƼⲻϸڣ-췵ۼ) +FROM HJGL_BS_NDTType AS NDTType +LEFT JOIN Base_Project ON Base_Project.ProjectId=@ProjectId +--⺸ +LEFT JOIN (SELECT COUNT(*) AS need_check_count,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem + LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID + LEFT JOIN HJGL_PW_JointInfo ON HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID + WHERE HJGL_CH_Trust.ProjectId=@ProjectId + GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS need_check_count ON need_check_count.CH_NDTMethod = NDTType.NDT_ID + +--ίк +LEFT JOIN (SELECT COUNT(*) AS trust_count_current,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem + LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID + LEFT JOIN HJGL_PW_JointInfo ON HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID + WHERE HJGL_CH_Trust.ProjectId=@ProjectId AND CONVERT(varchar(10), HJGL_CH_Trust.CH_TrustDate,120)=@trustDate + GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS trust_count_current ON trust_count_current.CH_NDTMethod = NDTType.NDT_ID + +--ۼίк +LEFT JOIN (SELECT COUNT(*) AS trust_count_total,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem + LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID + LEFT JOIN HJGL_PW_JointInfo ON HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID + WHERE HJGL_CH_Trust.ProjectId=@ProjectId + GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS trust_count_total ON trust_count_total.CH_NDTMethod = NDTType.NDT_ID + +LEFT JOIN (SELECT COUNT(*) AS check_count_current,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem + LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID + LEFT JOIN HJGL_PW_JointInfo ON HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID + WHERE HJGL_CH_TrustItem.States!='1' + AND HJGL_CH_Trust.ProjectId=@ProjectId AND CONVERT(varchar(10), HJGL_CH_Trust.CH_TrustDate,120)=@trustDate + GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS check_count_current ON check_count_current.CH_NDTMethod = NDTType.NDT_ID + +--ۼƼ⺸ +LEFT JOIN (SELECT COUNT(*) AS check_count,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem + LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID + LEFT JOIN HJGL_PW_JointInfo ON HJGL_PW_JointInfo.JOT_ID = HJGL_CH_TrustItem.JOT_ID + WHERE HJGL_CH_TrustItem.States!='1' + AND HJGL_CH_Trust.ProjectId=@ProjectId + GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS check_count ON check_count.CH_NDTMethod = NDTType.NDT_ID + +----ۼƼƬ +LEFT JOIN (SELECT COUNT(*) AS check_count_film,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_BO_QualityRating + LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_BO_QualityRating.CH_TrustItemID + LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID + WHERE HJGL_CH_Trust.ProjectId=@ProjectId + GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS check_count_film ON check_count_film.CH_NDTMethod = NDTType.NDT_ID + +--ۼƺϸ񺸿 +LEFT JOIN (SELECT COUNT(*) AS total_check_Pass_count,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_CH_TrustItem + LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID + WHERE HJGL_CH_Trust.ProjectId=@ProjectId AND HJGL_CH_TrustItem.States='2' and HJGL_CH_Trust.CH_TrustType='1' + GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS total_check_Pass_count ON total_check_Pass_count.CH_NDTMethod = NDTType.NDT_ID + +--ۼƺϸƬ +LEFT JOIN (SELECT COUNT(*) AS check_count_Pass_film,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_BO_QualityRating + LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_BO_QualityRating.CH_TrustItemID + LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID + WHERE HJGL_BO_QualityRating.IsPass='ϸ' and HJGL_CH_Trust.ProjectId=@ProjectId + GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS check_count_Pass_film ON check_count_Pass_film.CH_NDTMethod = NDTType.NDT_ID + +--췵Ƭɣ +LEFT JOIN (SELECT COUNT(*) AS repair_current_film,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_BO_QualityRatingRepair + LEFT JOIN HJGL_CH_RepairItem ON HJGL_CH_RepairItem.CH_RepairItemId = HJGL_BO_QualityRatingRepair.CH_RepairItemId + LEFT JOIN HJGL_CH_Repair ON HJGL_CH_Repair.CH_RepairID = HJGL_CH_RepairItem.CH_RepairID + LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_CH_Repair.TrustItemID + LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID + WHERE HJGL_CH_Trust.ProjectId=@ProjectId AND CONVERT(varchar(10),HJGL_CH_Repair.RepairTrustDate,120)=@trustDate + GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS repair_current_film ON repair_current_film.CH_NDTMethod = NDTType.NDT_ID + +--췵Ƭۼɣ +LEFT JOIN (SELECT COUNT(*) AS repair_total_film,HJGL_CH_Trust.CH_NDTMethod FROM HJGL_BO_QualityRatingRepair + LEFT JOIN HJGL_CH_RepairItem ON HJGL_CH_RepairItem.CH_RepairItemId = HJGL_BO_QualityRatingRepair.CH_RepairItemId + LEFT JOIN HJGL_CH_Repair ON HJGL_CH_Repair.CH_RepairID = HJGL_CH_RepairItem.CH_RepairID + LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_CH_Repair.TrustItemID + LEFT JOIN HJGL_CH_Trust ON HJGL_CH_Trust.CH_TrustID = HJGL_CH_TrustItem.CH_TrustID + WHERE HJGL_CH_Trust.ProjectId=@ProjectId + GROUP BY HJGL_CH_Trust.CH_NDTMethod) AS repair_total_film ON repair_total_film.CH_NDTMethod = NDTType.NDT_ID + +--췵 +left join (select count(*) as repair_current_count,HJGL_CH_Repair.NDT_ID from HJGL_CH_RepairItem + LEFT JOIN HJGL_CH_Repair ON HJGL_CH_Repair.CH_RepairID = HJGL_CH_RepairItem.CH_RepairID + LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_CH_Repair.TrustItemID + WHERE HJGL_CH_RepairItem.States='4' AND HJGL_CH_Repair.ProjectId=@ProjectId AND CONVERT(varchar(10),HJGL_CH_Repair.RepairTrustDate,120)=@trustDate + GROUP BY HJGL_CH_Repair.NDT_ID) as repair_current_count on repair_current_count.NDT_ID =NDTType.NDT_ID + +--췵 ۼ +left join (select count(*) as repair_total_count,HJGL_CH_Repair.NDT_ID from HJGL_CH_RepairItem + LEFT JOIN HJGL_CH_Repair ON HJGL_CH_Repair.CH_RepairID = HJGL_CH_RepairItem.CH_RepairID + LEFT JOIN HJGL_CH_TrustItem ON HJGL_CH_TrustItem.CH_TrustItemID = HJGL_CH_Repair.TrustItemID + WHERE HJGL_CH_RepairItem.States='4' AND HJGL_CH_Repair.ProjectId=@ProjectId + GROUP BY HJGL_CH_Repair.NDT_ID) as repair_total_count on repair_total_count.NDT_ID =NDTType.NDT_ID + +GO + + diff --git a/HJGL_DS/FineUIPro.Web/ContinuousPrint/PipingSingleDiagramPrint.aspx.cs b/HJGL_DS/FineUIPro.Web/ContinuousPrint/PipingSingleDiagramPrint.aspx.cs index 6b24c9a..95de96e 100644 --- a/HJGL_DS/FineUIPro.Web/ContinuousPrint/PipingSingleDiagramPrint.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/ContinuousPrint/PipingSingleDiagramPrint.aspx.cs @@ -149,809 +149,731 @@ namespace FineUIPro.Web.ContinuousPrint Alert.ShowInTop("最少选中一行!", MessageBoxIcon.Warning); return; } - string initTemplatePath = ""; - string rootPath = Server.MapPath("~/"); - BLL.Common.FastReportService.ResetData(); + #region 报表打印(不用了) + //string initTemplatePath = ""; + //string rootPath = Server.MapPath("~/"); + //BLL.Common.FastReportService.ResetData(); + + //if (Grid2.Rows.Count > 0) + //{ + // //for (int gi = 0; gi < Grid2.Rows.Count; gi++) + // //{ + // if (!string.IsNullOrEmpty(this.Grid2.SelectedRowID)) + // { + // //var listStr = new List(); + // //listStr.Add(new SqlParameter("@iso_id", this.Grid2.SelectedRowID)); + // //SqlParameter[] parameter = listStr.ToArray(); + // //var tb = SQLHelper.GetDataTableRunProc("HJGL_rpt_PipelineAttach", parameter); + + // //if (tb.Rows.Count > 0) + // //{ + // DataTable dtM = new DataTable(); + // dtM.TableName = "MaterialData"; + // dtM.Columns.Add("SortNum"); + // //tb.DefaultView.Sort = "Sort1,Sort2,Sort3,Sort4,Sort5 ASC"; + + // //DataRow[] rows = tb.DefaultView.ToTable().Select(); + // //foreach (var row in rows) + // for (int i = 0; i < 9; i++) + // { + // var newRow = dtM.NewRow(); + // newRow["SortNum"] = (i + 1).ToString(); + // dtM.Rows.Add(newRow); + // } + // BLL.Common.FastReportService.AddFastreportTable(dtM); + + // //System.Web.UI.WebControls.HiddenField hidISO_ID = Grid2.Rows[gi].FindControl("hidISO_ID") as System.Web.UI.WebControls.HiddenField; + // var listStr = new List(); + // listStr.Add(new SqlParameter("@iso_id", this.Grid2.SelectedRowID)); + // SqlParameter[] parameter = listStr.ToArray(); + // var tb = SQLHelper.GetDataTableRunProc("HJGL_rpt_PipelineAttach", parameter); + + // if (tb.Rows.Count > 0) + // { + // DataTable dt = new DataTable(); + // dt.TableName = "JointData"; + // dt.Columns.Add("ISO_IsoNo"); + // dt.Columns.Add("JOT_JointNo"); + // dt.Columns.Add("WED_Code"); + // dt.Columns.Add("JOT_JointDesc"); + // dt.Columns.Add("STE_Name"); + // dt.Columns.Add("JOT_Location"); + // dt.Columns.Add("IS_Proess"); + // tb.DefaultView.Sort = "Sort1,Sort2,Sort3,Sort4,Sort5 ASC"; + + // DataRow[] rows = tb.DefaultView.ToTable().Select(); + // foreach (var row in rows) + // { + // var newRow = dt.NewRow(); + // newRow["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); + // newRow["JOT_JointNo"] = row["JOT_JointNo"].ToString(); + // newRow["WED_Code"] = row["WED_Code"].ToString(); + // newRow["JOT_JointDesc"] = row["JOT_JointDesc"].ToString(); + // newRow["STE_Name"] = row["STE_Name"].ToString(); + // newRow["JOT_Location"] = row["JOT_Location"].ToString(); + // newRow["IS_Proess"] = row["IS_Proess"].ToString(); + // dt.Rows.Add(newRow); + // } + // BLL.Common.FastReportService.AddFastreportTable(dt); + + + // Dictionary keyValuePairs = new Dictionary(); + // keyValuePairs.Add("ProjectName", hidProjectName.Text); + // keyValuePairs.Add("ISO_No", BLL.HJGL_PW_IsoInfoService.GetIsoInfoByIsoInfoId(this.Grid2.SelectedRowID).ISO_IsoNo); + // BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); + + + // initTemplatePath = "File\\Fastreport\\管道轴测图附页.frx"; + // } + // } + // //} + // if (File.Exists(rootPath + initTemplatePath)) + // { + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + // } + #endregion + + #region 导出excel + string rootPath = Server.MapPath("~/") + Const.ExcelUrl; + //导出文件 + string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\"; + if (!Directory.Exists(filePath)) + { + Directory.CreateDirectory(filePath); + } + string ReportFileName = filePath + "out1.xlsx"; if (Grid2.Rows.Count > 0) { - //for (int gi = 0; gi < Grid2.Rows.Count; gi++) - //{ - if (!string.IsNullOrEmpty(this.Grid2.SelectedRowID)) - { - //var listStr = new List(); - //listStr.Add(new SqlParameter("@iso_id", this.Grid2.SelectedRowID)); - //SqlParameter[] parameter = listStr.ToArray(); - //var tb = SQLHelper.GetDataTableRunProc("HJGL_rpt_PipelineAttach", parameter); + int rowIndex = 0; + XSSFWorkbook hssfworkbook = new XSSFWorkbook(); + XSSFSheet ws = (XSSFSheet)hssfworkbook.CreateSheet("项目管理管线单线图附页"); - //if (tb.Rows.Count > 0) - //{ - DataTable dtM = new DataTable(); - dtM.TableName = "MaterialData"; - dtM.Columns.Add("SortNum"); - //tb.DefaultView.Sort = "Sort1,Sort2,Sort3,Sort4,Sort5 ASC"; - - //DataRow[] rows = tb.DefaultView.ToTable().Select(); - //foreach (var row in rows) - for (int i = 0; i < 9; i++) - { - var newRow = dtM.NewRow(); - newRow["SortNum"] = (i + 1).ToString(); - dtM.Rows.Add(newRow); - } - BLL.Common.FastReportService.AddFastreportTable(dtM); - - //System.Web.UI.WebControls.HiddenField hidISO_ID = Grid2.Rows[gi].FindControl("hidISO_ID") as System.Web.UI.WebControls.HiddenField; - var listStr = new List(); - listStr.Add(new SqlParameter("@iso_id", this.Grid2.SelectedRowID)); - SqlParameter[] parameter = listStr.ToArray(); - var tb = SQLHelper.GetDataTableRunProc("HJGL_rpt_PipelineAttach", parameter); - - if (tb.Rows.Count > 0) - { - DataTable dt = new DataTable(); - dt.TableName = "JointData"; - dt.Columns.Add("ISO_IsoNo"); - dt.Columns.Add("JOT_JointNo"); - dt.Columns.Add("WED_Code"); - dt.Columns.Add("JOT_JointDesc"); - dt.Columns.Add("STE_Name"); - dt.Columns.Add("JOT_Location"); - dt.Columns.Add("IS_Proess"); - tb.DefaultView.Sort = "Sort1,Sort2,Sort3,Sort4,Sort5 ASC"; - - DataRow[] rows = tb.DefaultView.ToTable().Select(); - foreach (var row in rows) - { - var newRow = dt.NewRow(); - newRow["ISO_IsoNo"] = row["ISO_IsoNo"].ToString(); - newRow["JOT_JointNo"] = row["JOT_JointNo"].ToString(); - newRow["WED_Code"] = row["WED_Code"].ToString(); - newRow["JOT_JointDesc"] = row["JOT_JointDesc"].ToString(); - newRow["STE_Name"] = row["STE_Name"].ToString(); - newRow["JOT_Location"] = row["JOT_Location"].ToString(); - newRow["IS_Proess"] = row["IS_Proess"].ToString(); - dt.Rows.Add(newRow); - } - BLL.Common.FastReportService.AddFastreportTable(dt); - - - Dictionary keyValuePairs = new Dictionary(); - keyValuePairs.Add("ProjectName", hidProjectName.Text); - keyValuePairs.Add("ISO_No", BLL.HJGL_PW_IsoInfoService.GetIsoInfoByIsoInfoId(this.Grid2.SelectedRowID).ISO_IsoNo); - BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); - - - initTemplatePath = "File\\Fastreport\\管道轴测图附页.frx"; - } - } - //} - if (File.Exists(rootPath + initTemplatePath)) - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); - } - #region 导出excel,不用了 - //} - - //string rootPath = Server.MapPath("~/") + Const.ExcelUrl; - ////导出文件 - //string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\"; - //if (!Directory.Exists(filePath)) - //{ - // Directory.CreateDirectory(filePath); - //} - //string ReportFileName = filePath + "out1.xlsx"; - //if (Grid2.Rows.Count > 0) - //{ - // int rowIndex = 0; - // XSSFWorkbook hssfworkbook = new XSSFWorkbook(); - // XSSFSheet ws = (XSSFSheet)hssfworkbook.CreateSheet("项目管理管线单线图附页"); - - // #region 列宽 - // ws.SetColumnWidth(0, (10 * 256) + 15);//(9.5)9.55 - // ws.SetColumnWidth(1, (2 * 256) - 95);//(1.08)1.09 - // ws.SetColumnWidth(2, (8 * 256) + 50);//(7.58)7.64 - // ws.SetColumnWidth(3, (8 * 256) + 100);//(7.83)7.82 - // ws.SetColumnWidth(4, (9 * 256) + 55);//(8.67)8.64 - // ws.SetColumnWidth(5, (12 * 256) - 15);//(11.33)11.36 - // ws.SetColumnWidth(6, (12 * 256) - 15);//(11.33)11.36 - // ws.SetColumnWidth(7, (12 * 256) + 200);//(11.17)11.18 - // ws.SetColumnWidth(8, (6 * 256) + 100);//(5.83)5.82 - // ws.SetColumnWidth(9, (3 * 256) - 95);//(2.08)2.09 - // ws.SetColumnWidth(10, (2 * 256) + 100);//(1.83)1.82 - // ws.SetColumnWidth(11, (3 * 256) + 55);//(2.67)2.64 - // ws.SetColumnWidth(12, (3 * 256) + 15);//(2.5)2.55 - // ws.SetColumnWidth(13, (3 * 256) + 15);//(2.5)2.55 - // ws.SetColumnWidth(14, (2 * 256) + 55);//(1.67)1.64 - // #endregion - - // //图片地址 - // byte[] bytes = File.ReadAllBytes(Server.MapPath("~/") + "Images\\PrintLog.png"); - // int pictureIdx = hssfworkbook.AddPicture(bytes, PictureType.JPEG); - - // for (int gi = 0; gi < Grid2.Rows.Count; gi++) - // { - // if (Grid2.SelectedRowIndexArray.Contains(gi)) - // { - // System.Web.UI.WebControls.HiddenField hidISO_ID = Grid2.Rows[gi].FindControl("hidISO_ID") as System.Web.UI.WebControls.HiddenField; - - // #region 其他参数值取值 - // var isoId = hidISO_ID.Value; - // string v1 = string.Empty; - // string v2 = string.Empty; - // string v3 = string.Empty; - // string v4 = string.Empty; - // string v5 = string.Empty; - // string v6 = string.Empty; - // string v7 = string.Empty; - // string v8 = string.Empty; - // string v9 = string.Empty; - // string v10 = string.Empty; - // string v11 = string.Empty; - // string v12 = string.Empty; - // string v13 = string.Empty; - // string v14 = string.Empty; - // string v15 = string.Empty; - // string v16 = string.Empty; - // string ptCount1 = (from x in Funs.DB.HJGL_CH_TrustItem - // join y in Funs.DB.HJGL_PW_JointInfo - // on x.JOT_ID equals y.JOT_ID - // join a in Funs.DB.HJGL_BS_JointType - // on y.JOTY_ID equals a.JOTY_ID - // join b in Funs.DB.HJGL_CH_Trust - // on x.CH_TrustID equals b.CH_TrustID - // join c in Funs.DB.HJGL_BS_NDTType - // on b.CH_NDTMethod equals c.NDT_ID - // where a.JOTY_Group == "2" && y.ISO_ID == isoId && c.NDT_Code == "PT" - // select x).Distinct().Count().ToString(); - // string mtCount1 = (from x in Funs.DB.HJGL_CH_TrustItem - // join y in Funs.DB.HJGL_PW_JointInfo - // on x.JOT_ID equals y.JOT_ID - // join a in Funs.DB.HJGL_BS_JointType - // on y.JOTY_ID equals a.JOTY_ID - // join b in Funs.DB.HJGL_CH_Trust - // on x.CH_TrustID equals b.CH_TrustID - // join c in Funs.DB.HJGL_BS_NDTType - // on b.CH_NDTMethod equals c.NDT_ID - // where a.JOTY_Group == "2" && y.ISO_ID == isoId && c.NDT_Code == "MT" - // select x).Distinct().Count().ToString(); - // if (ptCount1 != "0") - // { - // v1 = "PT"; - // v2 = ptCount1; - // if (mtCount1 != "0") - // { - // v3 = "MT"; - // v4 = mtCount1; - // } - // } - // else - // { - // if (mtCount1 != "0") - // { - // v1 = "MT"; - // v2 = mtCount1; - // } - // } - // string ptCount2 = (from x in Funs.DB.HJGL_CH_TrustItem - // join y in Funs.DB.HJGL_PW_JointInfo - // on x.JOT_ID equals y.JOT_ID - // join a in Funs.DB.HJGL_BS_JointType - // on y.JOTY_ID equals a.JOTY_ID - // join b in Funs.DB.HJGL_CH_Trust - // on x.CH_TrustID equals b.CH_TrustID - // join c in Funs.DB.HJGL_BS_NDTType - // on b.CH_NDTMethod equals c.NDT_ID - // where a.JOTY_Group == "3" && y.ISO_ID == isoId && c.NDT_Code == "PT" - // select x).Distinct().Count().ToString(); - // string mtCount2 = (from x in Funs.DB.HJGL_CH_TrustItem - // join y in Funs.DB.HJGL_PW_JointInfo - // on x.JOT_ID equals y.JOT_ID - // join a in Funs.DB.HJGL_BS_JointType - // on y.JOTY_ID equals a.JOTY_ID - // join b in Funs.DB.HJGL_CH_Trust - // on x.CH_TrustID equals b.CH_TrustID - // join c in Funs.DB.HJGL_BS_NDTType - // on b.CH_NDTMethod equals c.NDT_ID - // where a.JOTY_Group == "3" && y.ISO_ID == isoId && c.NDT_Code == "MT" - // select x).Distinct().Count().ToString(); - // if (ptCount2 != "0") - // { - // v5 = "PT"; - // v6 = ptCount2; - // if (mtCount1 != "0") - // { - // v7 = "MT"; - // v8 = mtCount2; - // } - // } - // else - // { - // if (mtCount2 != "0") - // { - // v5 = "MT"; - // v6 = mtCount2; - // } - // } - // string rtCount3 = (from x in Funs.DB.HJGL_CH_TrustItem - // join y in Funs.DB.HJGL_PW_JointInfo - // on x.JOT_ID equals y.JOT_ID - // join a in Funs.DB.HJGL_BS_JointType - // on y.JOTY_ID equals a.JOTY_ID - // join b in Funs.DB.HJGL_CH_Trust - // on x.CH_TrustID equals b.CH_TrustID - // join c in Funs.DB.HJGL_BS_NDTType - // on b.CH_NDTMethod equals c.NDT_ID - // where a.JOTY_Group == "1" && y.ISO_ID == isoId && c.NDT_Code == "RT" - // select x).Distinct().Count().ToString(); - // string utCount3 = (from x in Funs.DB.HJGL_CH_TrustItem - // join y in Funs.DB.HJGL_PW_JointInfo - // on x.JOT_ID equals y.JOT_ID - // join a in Funs.DB.HJGL_BS_JointType - // on y.JOTY_ID equals a.JOTY_ID - // join b in Funs.DB.HJGL_CH_Trust - // on x.CH_TrustID equals b.CH_TrustID - // join c in Funs.DB.HJGL_BS_NDTType - // on b.CH_NDTMethod equals c.NDT_ID - // where a.JOTY_Group == "1" && y.ISO_ID == isoId && c.NDT_Code == "UT" - // select x).Distinct().Count().ToString(); - // if (rtCount3 != "0") - // { - // v9 = "RT"; - // v10 = rtCount3; - // if (utCount3 != "0") - // { - // v11 = "UT"; - // v12 = utCount3; - // } - // } - // else - // { - // if (utCount3 != "0") - // { - // v9 = "UT"; - // v10 = utCount3; - // } - // } - // string rt4 = "RT"; - // string rtCount4 = (from x in Funs.DB.HJGL_CH_TrustItem - // join y in Funs.DB.HJGL_PW_JointInfo - // on x.JOT_ID equals y.JOT_ID - // join a in Funs.DB.HJGL_BS_JointType - // on y.JOTY_ID equals a.JOTY_ID - // join b in Funs.DB.HJGL_CH_Trust - // on x.CH_TrustID equals b.CH_TrustID - // join c in Funs.DB.HJGL_BS_NDTType - // on b.CH_NDTMethod equals c.NDT_ID - // where a.JOTY_Group == "1" && y.ISO_ID == isoId && c.NDT_Code == "RT" && y.JOT_JointAttribute == "固定" - // select x).Distinct().Count().ToString(); - // string ut4 = "UT"; - // string utCount4 = (from x in Funs.DB.HJGL_CH_TrustItem - // join y in Funs.DB.HJGL_PW_JointInfo - // on x.JOT_ID equals y.JOT_ID - // join a in Funs.DB.HJGL_BS_JointType - // on y.JOTY_ID equals a.JOTY_ID - // join b in Funs.DB.HJGL_CH_Trust - // on x.CH_TrustID equals b.CH_TrustID - // join c in Funs.DB.HJGL_BS_NDTType - // on b.CH_NDTMethod equals c.NDT_ID - // where a.JOTY_Group == "1" && y.ISO_ID == isoId && c.NDT_Code == "UT" && y.JOT_JointAttribute == "固定" - // select x).Distinct().Count().ToString(); - // if (rtCount4 != "0") - // { - // v13 = "RT"; - // v14 = rtCount4; - // if (utCount4 != "0") - // { - // v15 = "UT"; - // v16 = utCount4; - // } - // } - // else - // { - // if (utCount4 != "0") - // { - // v13 = "UT"; - // v14 = utCount4; - // } - // } - - // #endregion - - - // //列表 - // var listStr = new List(); - // listStr.Add(new SqlParameter("@iso_id", hidISO_ID.Value)); - // listStr.Add(new SqlParameter("@Flag", "0")); - // SqlParameter[] parameter = listStr.ToArray(); - // var tb = SQLHelper.GetDataTableRunProc("HJGL_rpt_PipelineAttach", parameter); - // //头部 - // var listTitleStr = new List(); - // listTitleStr.Add(new SqlParameter("@iso_id", hidISO_ID.Value)); - // SqlParameter[] titleparameter = listTitleStr.ToArray(); - // var tbTitle = SQLHelper.GetDataTableRunProc("HJGL_rpt_PipelineAttachMain", titleparameter); - // if (tb.Rows.Count > 0 && tbTitle.Rows.Count > 0) - // { - // CellRangeAddress region; - // var pageNum = - // tb.Rows.Count < 21 ? 1 - // : (tb.Rows.Count > 21 && tb.Rows.Count < 55) ? 2 - // : Math.Ceiling((float)(tb.Rows.Count - 55) / 38) + 2; - - // //公共样式 - // ICellStyle style = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10, true); - // //无边框文字靠左 - // ICellStyle leftNoneStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Left, 10, true); - // //无边框文字靠右 - // ICellStyle rightNoneStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Right, 10, true); - // //头部样式 - // ICellStyle titleStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 12, true, true, "黑体"); - // //循环页 - // for (int i = 1; i <= pageNum; i++) - // { - // //每页数据开始和结束条数 - // var dStart = 0; - // var dEnd = 0; - // //数据开始行和结束行 - // var tStart = 0; - // var tEnd = 0; - - // #region 头部和每页数据参数 - // //第一页和第二页需要创建头 - // if (i == 1) - // { - // //创建头部行和列 - // ws = ExcelCreateRowTitle(ws, hssfworkbook, rowIndex, rowIndex + 13, style, 0, 14); - // //取数据开始和结束条数 - // dStart = 0; - // dEnd = 21; - // //数据开始行和结束行 - // tStart = rowIndex + 14; - // tEnd = rowIndex + 34; - - // #region 头部 - // //行1 - // ws.GetRow(rowIndex).GetCell(0).SetCellValue("文件版本:1"); - // ws.GetRow(rowIndex).GetCell(0).CellStyle = leftNoneStyle; - // region = new CellRangeAddress(rowIndex, rowIndex, 8, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex).GetCell(8).SetCellValue("保管期限:5年"); - // ws.GetRow(rowIndex).GetCell(8).CellStyle = rightNoneStyle; - // //行2 - // region = new CellRangeAddress(rowIndex + 1, rowIndex + 3, 0, 1); - // ws.AddMergedRegion(region); - // IDrawing patriarch = ws.CreateDrawingPatriarch(); - // IClientAnchor anchor = patriarch.CreateAnchor(0, 0, 0, 0, 0, rowIndex + 1, 1, rowIndex + 4); - // IPicture pict = patriarch.CreatePicture(anchor, pictureIdx); - // //pict.Resize(); - // //行3 - // region = new CellRangeAddress(rowIndex + 1, rowIndex + 1, 2, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 1).GetCell(2).SetCellValue("中国石油化工股份有限公司镇海炼化分公司管理体系"); - // region = new CellRangeAddress(rowIndex + 2, rowIndex + 2, 2, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 2).GetCell(2).SetCellValue("项目管理部管道单线图附页"); - // ws.GetRow(rowIndex + 2).GetCell(2).CellStyle = titleStyle; - // //行4 - // ws.GetRow(rowIndex + 3).GetCell(2).SetCellValue("记录编号"); - // region = new CellRangeAddress(rowIndex + 3, rowIndex + 3, 3, 5); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 3).GetCell(3).SetCellValue("PMT-T10.326.06.039.2016"); - // ws.GetRow(rowIndex + 3).GetCell(6).SetCellValue("使用单位"); - // region = new CellRangeAddress(rowIndex + 3, rowIndex + 3, 7, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 3).GetCell(7).SetCellValue("镇海石化建安工程有限公司"); - // //行5 - // ws.GetRow(rowIndex + 4).GetCell(0).SetCellValue("工程名称"); - // region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 1, 5); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 4).GetCell(1).SetCellValue(tbTitle.Rows[0]["ProjectName"].ToString()); - // ws.GetRow(rowIndex + 4).GetCell(6).SetCellValue("管道级别"); - // region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 7, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 4).GetCell(7).SetCellValue(tbTitle.Rows[0]["ISC_IsoName"].ToString()); - // //行6 - // ws.GetRow(rowIndex + 5).GetCell(0).SetCellValue("单线号"); - // region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 1, 3); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 5).GetCell(1).SetCellValue(tbTitle.Rows[0]["ISO_IsoNo"].ToString()); - // ws.GetRow(rowIndex + 5).GetCell(4).SetCellValue("设计压力"); - // ws.GetRow(rowIndex + 5).GetCell(5).SetCellValue(tbTitle.Rows[0]["ISO_DesignPress"].ToString()); - // ws.GetRow(rowIndex + 5).GetCell(6).SetCellValue("管道主规格"); - // region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 7, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 5).GetCell(7).SetCellValue(tbTitle.Rows[0]["Specification"].ToString()); - // //行7 - // ws.GetRow(rowIndex + 6).GetCell(0).SetCellValue("管道编号"); - // region = new CellRangeAddress(rowIndex + 6, rowIndex + 6, 1, 3); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 6).GetCell(1).SetCellValue(tbTitle.Rows[0]["ISO_Code"].ToString()); - // ws.GetRow(rowIndex + 6).GetCell(4).SetCellValue("设计温度"); - // ws.GetRow(rowIndex + 6).GetCell(5).SetCellValue(tbTitle.Rows[0]["ISO_DesignTemperature"].ToString()); - // ws.GetRow(rowIndex + 6).GetCell(6).SetCellValue("管道主材质"); - // region = new CellRangeAddress(rowIndex + 6, rowIndex + 6, 7, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 6).GetCell(7).SetCellValue(tbTitle.Rows[0]["STE_Code"].ToString()); - // //行8 - // ws.GetRow(rowIndex + 7).GetCell(0).SetCellValue("检测类别号"); - // region = new CellRangeAddress(rowIndex + 7, rowIndex + 7, 1, 3); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 7).GetCell(1).SetCellValue(tbTitle.Rows[0]["TestCategoryNum"].ToString()); - // ws.GetRow(rowIndex + 7).GetCell(4).SetCellValue("验收规范"); - // ws.GetRow(rowIndex + 7).GetCell(5).SetCellValue(tbTitle.Rows[0]["ExecStandardName"].ToString()); - // ws.GetRow(rowIndex + 7).GetCell(6).SetCellValue("介质"); - // region = new CellRangeAddress(rowIndex + 7, rowIndex + 7, 7, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 7).GetCell(7).SetCellValue(tbTitle.Rows[0]["SER_Name"].ToString()); - // //行9 - // ws.GetRow(rowIndex + 8).GetCell(0).SetCellValue("焊缝类型"); - // region = new CellRangeAddress(rowIndex + 8, rowIndex + 8, 1, 3); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 8).GetCell(1).SetCellValue("角焊接头"); - // region = new CellRangeAddress(rowIndex + 8, rowIndex + 8, 4, 5); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 8).GetCell(4).SetCellValue("支管连接接头"); - // region = new CellRangeAddress(rowIndex + 8, rowIndex + 8, 6, 7); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 8).GetCell(6).SetCellValue("对焊接头"); - // region = new CellRangeAddress(rowIndex + 8, rowIndex + 8, 8, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 8).GetCell(8).SetCellValue("其中对焊接头固定口"); - // //行10 - // ws.GetRow(rowIndex + 9).GetCell(0).SetCellValue("总焊口数"); - // region = new CellRangeAddress(rowIndex + 9, rowIndex + 9, 1, 3); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 9).GetCell(1).SetCellValue(tbTitle.Rows[0]["Joty_C_Num"].ToString()); - // region = new CellRangeAddress(rowIndex + 9, rowIndex + 9, 4, 5); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 9).GetCell(4).SetCellValue(tbTitle.Rows[0]["Joty_D_Num"].ToString()); - // region = new CellRangeAddress(rowIndex + 9, rowIndex + 9, 6, 7); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 9).GetCell(6).SetCellValue(tbTitle.Rows[0]["Joty_Num"].ToString()); - // region = new CellRangeAddress(rowIndex + 9, rowIndex + 9, 8, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 9).GetCell(8).SetCellValue(tbTitle.Rows[0]["Joty_G_Num"].ToString()); - // //行11 - // ws.GetRow(rowIndex + 10).GetCell(0).SetCellValue("检测比例"); - // region = new CellRangeAddress(rowIndex + 10, rowIndex + 10, 1, 3); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 10).GetCell(1).SetCellValue(tbTitle.Rows[0]["Joty_C_Rate"].ToString()); - // region = new CellRangeAddress(rowIndex + 10, rowIndex + 10, 4, 5); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 10).GetCell(4).SetCellValue(tbTitle.Rows[0]["Joty_D_Rate"].ToString()); - // region = new CellRangeAddress(rowIndex + 10, rowIndex + 10, 6, 7); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 10).GetCell(6).SetCellValue(tbTitle.Rows[0]["JotyRate"].ToString()); - // region = new CellRangeAddress(rowIndex + 10, rowIndex + 10, 8, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 10).GetCell(8).SetCellValue("40%"); - // //行12 - // ws.GetRow(rowIndex + 11).GetCell(0).SetCellValue("检测方法"); - // region = new CellRangeAddress(rowIndex + 11, rowIndex + 11, 1, 2); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 11).GetCell(1).SetCellValue(v1); - // ws.GetRow(rowIndex + 11).GetCell(3).SetCellValue(v3); - // ws.GetRow(rowIndex + 11).GetCell(4).SetCellValue(v5); - // ws.GetRow(rowIndex + 11).GetCell(5).SetCellValue(v7); - // ws.GetRow(rowIndex + 11).GetCell(6).SetCellValue(v9); - // ws.GetRow(rowIndex + 11).GetCell(7).SetCellValue(v11); - // region = new CellRangeAddress(rowIndex + 11, rowIndex + 11, 8, 9); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 11).GetCell(8).SetCellValue(v13); - // region = new CellRangeAddress(rowIndex + 11, rowIndex + 11, 10, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 11).GetCell(10).SetCellValue(v15); - // //行13 - // ws.GetRow(rowIndex + 12).GetCell(0).SetCellValue("实检焊口数"); - // region = new CellRangeAddress(rowIndex + 12, rowIndex + 12, 1, 2); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 12).GetCell(1).SetCellValue(v2); - // ws.GetRow(rowIndex + 12).GetCell(3).SetCellValue(v4); - // ws.GetRow(rowIndex + 12).GetCell(4).SetCellValue(v6); - // ws.GetRow(rowIndex + 12).GetCell(5).SetCellValue(v8); - // ws.GetRow(rowIndex + 12).GetCell(6).SetCellValue(v10); - // ws.GetRow(rowIndex + 12).GetCell(7).SetCellValue(v12); - // region = new CellRangeAddress(rowIndex + 12, rowIndex + 12, 8, 9); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 12).GetCell(8).SetCellValue(v14); - // region = new CellRangeAddress(rowIndex + 12, rowIndex + 12, 10, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 12).GetCell(10).SetCellValue(v16); - // //行14 - // ws.GetRow(rowIndex + 13).GetCell(0).SetCellValue("焊口编号"); - // region = new CellRangeAddress(rowIndex + 13, rowIndex + 13, 1, 2); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 13).GetCell(1).SetCellValue("焊工号"); - // ws.GetRow(rowIndex + 13).GetCell(3).SetCellValue("焊接位置"); - // ws.GetRow(rowIndex + 13).GetCell(4).SetCellValue("焊接时间"); - // ws.GetRow(rowIndex + 13).GetCell(5).SetCellValue("热处理时间"); - // ws.GetRow(rowIndex + 13).GetCell(6).SetCellValue("硬度试验时间"); - // ws.GetRow(rowIndex + 13).GetCell(7).SetCellValue("委托检测时间"); - // region = new CellRangeAddress(rowIndex + 13, rowIndex + 13, 8, 9); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 13).GetCell(8).SetCellValue("检测结果"); - // region = new CellRangeAddress(rowIndex + 13, rowIndex + 13, 10, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 13).GetCell(10).SetCellValue("备注"); - - // #endregion - // } - // else if (i == 2) - // { - // //创建头部行和列 - // ws = ExcelCreateRowTitle(ws, hssfworkbook, rowIndex, rowIndex + 5, style, 0, 14, true); - // //取数据开始和结束条数 - // dStart = 21; - // dEnd = 52; - // //数据开始行和结束行 - // tStart = rowIndex + 6; - // tEnd = rowIndex + 36; - - // #region 头部(续) - // //行1 - // ws.GetRow(rowIndex).GetCell(0).SetCellValue("文件版本:1"); - // ws.GetRow(rowIndex).GetCell(0).CellStyle = leftNoneStyle; - // region = new CellRangeAddress(rowIndex, rowIndex, 8, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex).GetCell(8).SetCellValue("保管期限:5年"); - // ws.GetRow(rowIndex).GetCell(8).CellStyle = rightNoneStyle; - // //行2 - // region = new CellRangeAddress(rowIndex + 1, rowIndex + 3, 0, 1); - // ws.AddMergedRegion(region); - // IDrawing patriarch = ws.CreateDrawingPatriarch(); - // IClientAnchor anchor = patriarch.CreateAnchor(0, 0, 0, 0, 0, rowIndex + 1, 1, rowIndex + 4); - // IPicture pict = patriarch.CreatePicture(anchor, pictureIdx); - // //pict.Resize(); - // //行3 - // region = new CellRangeAddress(rowIndex + 1, rowIndex + 1, 2, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 1).GetCell(2).SetCellValue("中国石油化工股份有限公司镇海炼化分公司管理体系"); - // region = new CellRangeAddress(rowIndex + 2, rowIndex + 2, 2, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 2).GetCell(2).SetCellValue("管道单线图附页(续)"); - // ws.GetRow(rowIndex + 2).GetCell(2).CellStyle = titleStyle; - // //行4 - // ws.GetRow(rowIndex + 3).GetCell(2).SetCellValue("记录编号"); - // region = new CellRangeAddress(rowIndex + 3, rowIndex + 3, 3, 5); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 3).GetCell(3).SetCellValue("PMT-T10.326.06.039.2016"); - // ws.GetRow(rowIndex + 3).GetCell(6).SetCellValue("使用单位"); - // region = new CellRangeAddress(rowIndex + 3, rowIndex + 3, 7, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 3).GetCell(7).SetCellValue("镇海石化建安工程有限公司"); - // //行5 - // ws.GetRow(rowIndex + 4).GetCell(0).SetCellValue("工程名称"); - // region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 1, 5); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 4).GetCell(1).SetCellValue(tbTitle.Rows[0]["ProjectName"].ToString()); - // ws.GetRow(rowIndex + 4).GetCell(6).SetCellValue("管道级别"); - // region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 7, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 4).GetCell(7).SetCellValue(tbTitle.Rows[0]["ISO_IsoNo"].ToString()); - // //行6 - // ws.GetRow(rowIndex + 5).GetCell(0).SetCellValue("焊口编号"); - // region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 1, 2); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 5).GetCell(1).SetCellValue("焊工号"); - // ws.GetRow(rowIndex + 5).GetCell(3).SetCellValue("焊接位置"); - // ws.GetRow(rowIndex + 5).GetCell(4).SetCellValue("焊接时间"); - // ws.GetRow(rowIndex + 5).GetCell(5).SetCellValue("热处理时间"); - // ws.GetRow(rowIndex + 5).GetCell(6).SetCellValue("硬度试验时间"); - // ws.GetRow(rowIndex + 5).GetCell(7).SetCellValue("委托检测时间"); - // region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 8, 9); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 5).GetCell(8).SetCellValue("检测结果"); - // region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 10, 14); - // ws.AddMergedRegion(region); - // ws.GetRow(rowIndex + 5).GetCell(10).SetCellValue("备注"); - // #endregion - // } - // else - // { - // var pNum = (i - 2) * 38; - // //取数据开始和结束条数 - // dStart = 52 + ((i - 3) * 38); - // dEnd = 52 + pNum; - // //数据开始行和结束行 - // tStart = rowIndex; - // tEnd = rowIndex + 37; - // } - // #endregion - - // #region 数据 - // //创建数据行和列 - // ws = ExcelCreateRow(ws, hssfworkbook, tStart, tEnd, style, 0, 14); - // //获取当前页数据 - // var pageTb = GetPageToTable(tb, dStart, dEnd); - // //遍历数据 - // for (int j = 0; j < pageTb.Rows.Count; j++) - // { - // var dataRow = tStart + j; - // ws.GetRow(dataRow).GetCell(0).SetCellValue(pageTb.Rows[j]["JOT_JointNo"].ToString()); - // ws.GetRow(dataRow).GetCell(1).SetCellValue(pageTb.Rows[j]["WED_Code"].ToString()); - // ws.GetRow(dataRow).GetCell(3).SetCellValue(pageTb.Rows[j]["JOT_Location"].ToString()); - // ws.GetRow(dataRow).GetCell(4).SetCellValue(pageTb.Rows[j]["JOT_WeldDate"].ToString()); - // ws.GetRow(dataRow).GetCell(5).SetCellValue(pageTb.Rows[j]["TrustDate"].ToString()); - // ws.GetRow(dataRow).GetCell(6).SetCellValue(pageTb.Rows[j]["TestDate"].ToString()); - // ws.GetRow(dataRow).GetCell(7).SetCellValue(pageTb.Rows[j]["CH_TrustDate"].ToString()); - // ws.GetRow(dataRow).GetCell(8).SetCellValue(pageTb.Rows[j]["IsOK"].ToString()); - // ws.GetRow(dataRow).GetCell(10).SetCellValue(pageTb.Rows[j]["Remark"].ToString()); - // } - // #endregion - - // #region 尾部 - // //尾部页码 - // ws.CreateRow(tEnd + 1); - // ws.GetRow(tEnd + 1).HeightInPoints = 16.5f; - // //尾部样式 - // ICellStyle pageStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Center, 10); - // for (int eIndex = 0; eIndex <= 14; eIndex++) - // { - // ws.GetRow(tEnd + 1).CreateCell(eIndex); - // ws.GetRow(tEnd + 1).GetCell(eIndex).CellStyle = pageStyle; - // } - // ws.GetRow(tEnd + 1).GetCell(9).SetCellValue("第"); - // ws.GetRow(tEnd + 1).GetCell(10).SetCellValue(i.ToString()); - // ws.GetRow(tEnd + 1).GetCell(11).SetCellValue("页"); - // ws.GetRow(tEnd + 1).GetCell(12).SetCellValue("共"); - // ws.GetRow(tEnd + 1).GetCell(13).SetCellValue(pageNum.ToString()); - // ws.GetRow(tEnd + 1).GetCell(14).SetCellValue("页"); - // #endregion - - // rowIndex = tEnd + 2; - // } - // } - // } - // } - - // ws.SetMargin(MarginType.LeftMargin, 0.2); - // ws.SetMargin(MarginType.RightMargin, 0.2); - - // //ws.SetMargin(MarginType.BottomMargin, 1); - // //ws.SetMargin(MarginType.TopMargin, 1); - // //ws.SetMargin(MarginType.FooterMargin, 0.5); - // //ws.SetMargin(MarginType.HeaderMargin, 0.5); - - // ws.PrintSetup.Landscape = false; - // ws.PrintSetup.PaperSize = 9; - - // ws.ForceFormulaRecalculation = true; - // using (FileStream filess = File.OpenWrite(ReportFileName)) - // { - // hssfworkbook.Write(filess); - // } - // FileInfo filet = new FileInfo(ReportFileName); - // Response.Clear(); - // Response.Charset = "GB2312"; - // Response.ContentEncoding = System.Text.Encoding.UTF8; - // // 添加头信息,为"文件下载/另存为"对话框指定默认文件名 - // Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode("项目管理管线单线图附页.xlsx")); - // // 添加头信息,指定文件大小,让浏览器能够显示下载进度 - // Response.AddHeader("Content-Length", filet.Length.ToString()); - // // 指定返回的是一个不能被客户端读取的流,必须被下载 - // Response.ContentType = "application/ms-excel"; - // // 把文件流发送到客户端 - // Response.WriteFile(filet.FullName); - // // 停止页面的执行 - // Response.End(); - //} + #region 列宽 + ws.SetColumnWidth(0, (3 * 256) - 95);//(2.08)2.09 + ws.SetColumnWidth(1, (6 * 256) + 100);//(1.08)1.09 + ws.SetColumnWidth(2, (8 * 256) + 50);//(7.58)7.64 + ws.SetColumnWidth(3, (13 * 256) + 100);//(7.83)7.82 + ws.SetColumnWidth(4, (9 * 256) + 55);//(8.67)8.64 + ws.SetColumnWidth(5, (12 * 256) - 15);//(11.33)11.36 + ws.SetColumnWidth(6, (10 * 256) - 15);//(11.33)11.36 + ws.SetColumnWidth(7, (3 * 256) - 95);//(11.17)11.18 + ws.SetColumnWidth(8, (20 * 256) + 100);//(5.83)5.82 + ws.SetColumnWidth(9, (10 * 256) - 95);//(2.08)2.09 + ws.SetColumnWidth(10, (12 * 256) + 100);//(1.83)1.82 + ws.SetColumnWidth(11, (12 * 256) + 55);//(2.67)2.64 + ws.SetColumnWidth(12, (10 * 256) + 15);//(2.5)2.55 + ws.SetColumnWidth(13, (10 * 256) + 15);//(2.5)2.55 + ws.SetColumnWidth(14, (10 * 256) + 55);//(1.67)1.64 #endregion + + for (int gi = 0; gi < Grid2.Rows.Count; gi++) + { + if (Grid2.SelectedRowIndexArray.Contains(gi)) + { + System.Web.UI.WebControls.HiddenField hidISO_ID = Grid2.Rows[gi].FindControl("hidISO_ID") as System.Web.UI.WebControls.HiddenField; + + //焊口清单 + var listStr = new List(); + listStr.Add(new SqlParameter("@iso_id", hidISO_ID.Value)); + SqlParameter[] parameter = listStr.ToArray(); + var tb = SQLHelper.GetDataTableRunProc("HJGL_rpt_PipelineAttach", parameter); + + string IsoNo = string.Empty; + if (!string.IsNullOrEmpty(hidISO_ID.Value)) + { + var isoInfo = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByIsoInfoId(this.Grid2.SelectedRowID); + if (isoInfo!=null) + { + IsoNo = isoInfo.ISO_IsoNo; + } + } + + if (tb.Rows.Count > 0) + { + CellRangeAddress region; + var pageNum = tb.Rows.Count < 31 ? 1 : Math.Ceiling((float)(tb.Rows.Count) / 31); + + #region 样式 + //公共样式 + ICellStyle style = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10, true); + //有边框文字靠左 + ICellStyle leftstyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Top, HorizontalAlignment.Left, 10, true); + //无边框文字靠左 + ICellStyle leftNoneStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Left, 10, true); + //无边框文字靠右 + ICellStyle rightNoneStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Right, 10, true, true, "宋体"); + //头部样式 + ICellStyle titleStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10, true, true, "宋体"); + //有边框文字居中,楷体10.5 + ICellStyle styleList = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true, false, "楷体"); + + #endregion + + //每页数据开始和结束条数 + var dStart = 0; + var dEnd = 0; + //数据开始行和结束行 + var tStart = 0; + var tEnd = 0; + + //循环页 + for (int i = 1; i <= pageNum; i++) + { + #region 头部和每页数据参数 + //第一页需要创建头 + //if (i == 1) + //{ + //创建头部行和列 + ws = ExcelCreateRowTitle(ws, hssfworkbook, rowIndex, rowIndex + 3, style, 0, 15); + //取数据开始和结束条数 + //dStart = 0; + //dEnd = 28; + //数据开始行和结束行 + tStart = rowIndex + 3; + tEnd = rowIndex + 30; + + #region 头部 + //行1 + ws.GetRow(rowIndex).GetCell(0).SetCellValue(""); + ws.GetRow(rowIndex).GetCell(0).CellStyle = rightNoneStyle; + + region = new CellRangeAddress(rowIndex, rowIndex, 1, 15); + ws.GetRow(rowIndex).GetCell(1).SetCellValue("ZDS-T6.38.039.A/1.2022"); + ws.GetRow(rowIndex).GetCell(1).CellStyle = rightNoneStyle; + + //行2 + ws.GetRow(rowIndex + 1).GetCell(0).SetCellValue(""); + ws.GetRow(rowIndex + 1).GetCell(0).CellStyle = rightNoneStyle; + + region = new CellRangeAddress(rowIndex + 1, rowIndex + 1, 1, 6); + ws.GetRow(rowIndex + 1).GetCell(1).SetCellValue("材料清单"); + ws.GetRow(rowIndex + 1).GetCell(1).CellStyle = titleStyle; + + ws.GetRow(rowIndex + 1).GetCell(7).SetCellValue(""); + ws.GetRow(rowIndex + 1).GetCell(7).CellStyle = rightNoneStyle; + + region = new CellRangeAddress(rowIndex + 1, rowIndex + 1, 8, 15); + ws.GetRow(rowIndex + 1).GetCell(8).SetCellValue("焊口清单"); + ws.GetRow(rowIndex + 1).GetCell(8).CellStyle = titleStyle; + + //行3 + ws.GetRow(rowIndex + 2).GetCell(1).SetCellValue("序号"); + ws.GetRow(rowIndex + 2).GetCell(1).CellStyle = titleStyle; + + region = new CellRangeAddress(rowIndex + 2, rowIndex + 2, 2, 4); + ws.GetRow(rowIndex + 2).GetCell(2).SetCellValue("描述"); + ws.GetRow(rowIndex + 2).GetCell(2).CellStyle = titleStyle; + + ws.GetRow(rowIndex + 2).GetCell(5).SetCellValue("公称直径"); + ws.GetRow(rowIndex + 2).GetCell(5).CellStyle = titleStyle; + + ws.GetRow(rowIndex + 2).GetCell(6).SetCellValue("数量"); + ws.GetRow(rowIndex + 2).GetCell(6).CellStyle = titleStyle; + + ws.GetRow(rowIndex + 2).GetCell(7).SetCellValue(""); + ws.GetRow(rowIndex + 2).GetCell(7).CellStyle = rightNoneStyle; + + ws.GetRow(rowIndex + 2).GetCell(8).SetCellValue("管道编号"); + ws.GetRow(rowIndex + 2).GetCell(8).CellStyle = titleStyle; + + ws.GetRow(rowIndex + 2).GetCell(9).SetCellValue("焊口编号"); + ws.GetRow(rowIndex + 2).GetCell(9).CellStyle = titleStyle; + + ws.GetRow(rowIndex + 2).GetCell(10).SetCellValue("焊工代号"); + ws.GetRow(rowIndex + 2).GetCell(10).CellStyle = titleStyle; + + ws.GetRow(rowIndex + 2).GetCell(11).SetCellValue("规格mm"); + ws.GetRow(rowIndex + 2).GetCell(11).CellStyle = titleStyle; + + ws.GetRow(rowIndex + 2).GetCell(12).SetCellValue("材质"); + ws.GetRow(rowIndex + 2).GetCell(12).CellStyle = titleStyle; + + ws.GetRow(rowIndex + 2).GetCell(13).SetCellValue("焊接位置"); + ws.GetRow(rowIndex + 2).GetCell(13).CellStyle = titleStyle; + + ws.GetRow(rowIndex + 2).GetCell(14).SetCellValue("热处理"); + ws.GetRow(rowIndex + 2).GetCell(14).CellStyle = titleStyle; + + ws.GetRow(rowIndex + 2).GetCell(15).SetCellValue("检测方式"); + ws.GetRow(rowIndex + 2).GetCell(15).CellStyle = titleStyle; + + #endregion + //} + //else + //{ + // var pNum = (i + 1) * 31; + // //取数据开始和结束条数 + // dStart = 31 + ((i - 3) * 31); + // dEnd = 31 + pNum; + // //数据开始行和结束行 + // tStart = rowIndex; + // tEnd = rowIndex + 31; + //dStart = i == 1 ? 0 : (i - 1) * 31; + //dEnd = i * 31; + //} + #endregion + + #region 数据 + ws = ExcelCreateRow(ws, hssfworkbook, tStart, tEnd, style, 0, 15); + + //创建数据行和列 + for (int r = 0; r < 28; r++) + { + var dataRow = tStart + r; + ws.GetRow(dataRow).GetCell(0).SetCellValue(""); + ws.GetRow(dataRow).GetCell(0).CellStyle = rightNoneStyle; + ws.GetRow(dataRow).GetCell(7).SetCellValue(""); + ws.GetRow(dataRow).GetCell(7).CellStyle = rightNoneStyle; + if (r == 0) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("1."); + ws.GetRow(dataRow).GetCell(2).SetCellValue("无缝钢管DN50 S40 20#8163"); + ws.GetRow(dataRow).GetCell(5).SetCellValue("DN50"); + ws.GetRow(dataRow).GetCell(6).SetCellValue("150米"); + } + else if (r == 1) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("2."); + ws.GetRow(dataRow).GetCell(2).SetCellValue("无缝钢管DN25 S80 20#8163"); + ws.GetRow(dataRow).GetCell(5).SetCellValue("DN25"); + ws.GetRow(dataRow).GetCell(6).SetCellValue("0.5米"); + } + else if (r == 2) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("3."); + ws.GetRow(dataRow).GetCell(2).SetCellValue("90°弯头DN50 S40 20#8163"); + ws.GetRow(dataRow).GetCell(5).SetCellValue("DN50"); + ws.GetRow(dataRow).GetCell(6).SetCellValue("11个"); + } + else if (r == 3) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("4."); + ws.GetRow(dataRow).GetCell(2).SetCellValue("异径三通DN100*50 S40 20#8163"); + ws.GetRow(dataRow).GetCell(5).SetCellValue("DN100*50"); + ws.GetRow(dataRow).GetCell(6).SetCellValue("1个"); + } + else if (r == 4) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("5."); + ws.GetRow(dataRow).GetCell(2).SetCellValue("异径三通DN80*50 S40 20#8163"); + ws.GetRow(dataRow).GetCell(5).SetCellValue("DN80*50"); + ws.GetRow(dataRow).GetCell(6).SetCellValue("1个"); + } + else if (r == 5) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("6."); + ws.GetRow(dataRow).GetCell(2).SetCellValue("异径三通DN50*25 S40 20#8163"); + ws.GetRow(dataRow).GetCell(5).SetCellValue("DN50*25"); + ws.GetRow(dataRow).GetCell(6).SetCellValue("1个"); + } + else if (r == 6) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("7."); + ws.GetRow(dataRow).GetCell(2).SetCellValue("8字盲板 DN50 CL300 20#"); + ws.GetRow(dataRow).GetCell(5).SetCellValue("DN50"); + ws.GetRow(dataRow).GetCell(6).SetCellValue("1个"); + } + else if (r == 7) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("8."); + ws.GetRow(dataRow).GetCell(2).SetCellValue("盲盖 DN25 CL300"); + ws.GetRow(dataRow).GetCell(5).SetCellValue("DN25"); + ws.GetRow(dataRow).GetCell(6).SetCellValue("1个"); + } + else if (r == 8) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("9."); + ws.GetRow(dataRow).GetCell(2).SetCellValue("对焊法兰 DN50 CL300 S40 20#"); + ws.GetRow(dataRow).GetCell(5).SetCellValue("DN50"); + ws.GetRow(dataRow).GetCell(6).SetCellValue("6片"); + } + else if (r == 9) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("10."); + ws.GetRow(dataRow).GetCell(2).SetCellValue("承插焊法兰 DN20 CL300 S80 20#"); + ws.GetRow(dataRow).GetCell(5).SetCellValue("DN25"); + ws.GetRow(dataRow).GetCell(6).SetCellValue("2片"); + } + else if (r == 10) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("11."); + ws.GetRow(dataRow).GetCell(2).SetCellValue("闸阀 DN50 CL300 WCB ANTI-H2S"); + ws.GetRow(dataRow).GetCell(5).SetCellValue("DN50"); + ws.GetRow(dataRow).GetCell(6).SetCellValue("3台"); + } + else if (r == 11) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("12."); + ws.GetRow(dataRow).GetCell(2).SetCellValue("闸阀 DN25 CL300 WCB ANTI-H2S"); + ws.GetRow(dataRow).GetCell(5).SetCellValue("DN25"); + ws.GetRow(dataRow).GetCell(6).SetCellValue("1台"); + } + else if (r == 12) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("13."); + ws.GetRow(dataRow).GetCell(2).SetCellValue(""); + ws.GetRow(dataRow).GetCell(5).SetCellValue(""); + ws.GetRow(dataRow).GetCell(6).SetCellValue(""); + } + else if (r == 13) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("14."); + ws.GetRow(dataRow).GetCell(2).SetCellValue(""); + ws.GetRow(dataRow).GetCell(5).SetCellValue(""); + ws.GetRow(dataRow).GetCell(6).SetCellValue(""); + } + else if (r == 14) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("15."); + ws.GetRow(dataRow).GetCell(2).SetCellValue(""); + ws.GetRow(dataRow).GetCell(5).SetCellValue(""); + ws.GetRow(dataRow).GetCell(6).SetCellValue(""); + } + else if (r == 15) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("16."); + ws.GetRow(dataRow).GetCell(2).SetCellValue(""); + ws.GetRow(dataRow).GetCell(5).SetCellValue(""); + ws.GetRow(dataRow).GetCell(6).SetCellValue(""); + } + else if (r == 16) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("说明:"); + ws.GetRow(dataRow).GetCell(1).CellStyle = leftstyle; + } + else if (r == 23) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("浙江鼎盛石化工程有限公司"); + ws.GetRow(dataRow).GetCell(1).CellStyle = titleStyle; + } + else if (r == 24) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("工程名称"); + ws.GetRow(dataRow).GetCell(1).CellStyle = titleStyle; + ws.GetRow(dataRow).GetCell(3).SetCellValue(BLL.Base_ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId).ProjectName); + ws.GetRow(dataRow).GetCell(3).CellStyle = titleStyle; + } + else if (r == 25) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("施工图号"); + ws.GetRow(dataRow).GetCell(1).CellStyle = titleStyle; + ws.GetRow(dataRow).GetCell(3).SetCellValue(""); + } + else if (r == 26) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("管线编号"); + ws.GetRow(dataRow).GetCell(1).CellStyle = titleStyle; + ws.GetRow(dataRow).GetCell(3).SetCellValue(IsoNo); + ws.GetRow(dataRow).GetCell(3).CellStyle = titleStyle; + ws.GetRow(dataRow).GetCell(4).SetCellValue("绘制"); + ws.GetRow(dataRow).GetCell(4).CellStyle = titleStyle; + ws.GetRow(dataRow).GetCell(5).SetCellValue(""); + } + else if (r == 27) + { + ws.GetRow(dataRow).GetCell(1).SetCellValue("管 道 轴 测 图 附 页"); + ws.GetRow(dataRow).GetCell(1).CellStyle = titleStyle; + ws.GetRow(dataRow).GetCell(4).SetCellValue("共" + pageNum + "页,第" + i + "页"); + ws.GetRow(dataRow).GetCell(4).CellStyle = titleStyle; + } + } + //每页数据开始和结束条数 + dStart = i == 1 ? 0 : (i - 1) * 28; + dEnd = i * 28; + + //获取当前页数据 + var pageTb = GetPageToTable(tb, dStart, dEnd); + //遍历数据 + for (int j = 0; j < pageTb.Rows.Count; j++) + { + var dataRow = tStart + j; + ws.GetRow(dataRow).GetCell(8).SetCellValue(pageTb.Rows[j]["ISO_IsoNo"].ToString()); + ws.GetRow(dataRow).GetCell(8).CellStyle = styleList; + ws.GetRow(dataRow).GetCell(9).SetCellValue(pageTb.Rows[j]["JOT_JointNo"].ToString()); + ws.GetRow(dataRow).GetCell(9).CellStyle = styleList; + ws.GetRow(dataRow).GetCell(10).SetCellValue(pageTb.Rows[j]["WED_Code"].ToString()); + ws.GetRow(dataRow).GetCell(10).CellStyle = styleList; + ws.GetRow(dataRow).GetCell(11).SetCellValue(pageTb.Rows[j]["JOT_JointDesc"].ToString()); + ws.GetRow(dataRow).GetCell(11).CellStyle = styleList; + ws.GetRow(dataRow).GetCell(12).SetCellValue(pageTb.Rows[j]["STE_Name"].ToString()); + ws.GetRow(dataRow).GetCell(12).CellStyle = styleList; + ws.GetRow(dataRow).GetCell(13).SetCellValue(pageTb.Rows[j]["JOT_Location"].ToString()); + ws.GetRow(dataRow).GetCell(13).CellStyle = styleList; + ws.GetRow(dataRow).GetCell(14).SetCellValue(pageTb.Rows[j]["IS_Proess"].ToString()); + ws.GetRow(dataRow).GetCell(14).CellStyle = styleList; + ws.GetRow(dataRow).GetCell(15).SetCellValue(""); + ws.GetRow(dataRow).GetCell(15).CellStyle = styleList; + } + #endregion + + #region 尾部 + //ws = ExcelCreateRowBottom(ws, hssfworkbook, tEnd + 1, tEnd + 12, style, 1, 6); + + //region = new CellRangeAddress(tEnd + 1, tEnd + 6, 1, 6); + //ws.GetRow(tEnd + 1).GetCell(1).SetCellValue("说明:"); + //ws.GetRow(tEnd + 1).GetCell(1).CellStyle = leftstyle; + + //region = new CellRangeAddress(tEnd + 8, tEnd + 8, 1, 6); + //ws.GetRow(tEnd + 8).GetCell(1).SetCellValue("浙江鼎盛石化工程有限公司"); + //ws.GetRow(tEnd + 8).GetCell(1).CellStyle = style; + + //region = new CellRangeAddress(tEnd + 9, tEnd + 9, 1, 2); + //ws.GetRow(tEnd + 9).GetCell(1).SetCellValue("工程名称"); + //ws.GetRow(tEnd + 9).GetCell(1).CellStyle = style; + + //region = new CellRangeAddress(tEnd + 9, tEnd + 9, 3, 6); + //ws.GetRow(tEnd + 9).GetCell(3).SetCellValue(BLL.Base_ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId).ProjectName); + //ws.GetRow(tEnd + 9).GetCell(3).CellStyle = style; + + //region = new CellRangeAddress(tEnd + 10, tEnd + 10, 1, 2); + //ws.GetRow(tEnd + 10).GetCell(1).SetCellValue("施工图号"); + //ws.GetRow(tEnd + 10).GetCell(1).CellStyle = style; + + //region = new CellRangeAddress(tEnd + 10, tEnd + 10, 3, 6); + //ws.GetRow(tEnd + 10).GetCell(3).SetCellValue(""); + //ws.GetRow(tEnd + 10).GetCell(3).CellStyle = style; + + //region = new CellRangeAddress(tEnd + 11, tEnd + 11, 1, 2); + //ws.GetRow(tEnd + 11).GetCell(1).SetCellValue("管线编号"); + //ws.GetRow(tEnd + 11).GetCell(1).CellStyle = style; + + //ws.GetRow(tEnd + 11).GetCell(3).SetCellValue(""); + //ws.GetRow(tEnd + 11).GetCell(3).CellStyle = style; + + //ws.GetRow(tEnd + 11).GetCell(4).SetCellValue("绘制"); + //ws.GetRow(tEnd + 11).GetCell(4).CellStyle = style; + + //region = new CellRangeAddress(tEnd + 11, tEnd + 11, 5, 6); + //ws.GetRow(tEnd + 11).GetCell(5).SetCellValue(""); + //ws.GetRow(tEnd + 11).GetCell(5).CellStyle = style; + + //region = new CellRangeAddress(tEnd + 12, tEnd + 12, 1, 3); + //ws.GetRow(tEnd + 12).GetCell(1).SetCellValue("管 道 轴 测 图 附 页"); + //ws.GetRow(tEnd + 12).GetCell(1).CellStyle = style; + + //region = new CellRangeAddress(tEnd + 12, tEnd + 12, 4, 6); + //ws.GetRow(tEnd + 12).GetCell(4).SetCellValue(""); + //ws.GetRow(tEnd + 12).GetCell(4).CellStyle = style; + + #endregion + + rowIndex = tEnd + 2; + } + } + } + } + + ws.SetMargin(MarginType.LeftMargin, 0.2); + ws.SetMargin(MarginType.RightMargin, 0.2); + + ws.PrintSetup.Landscape = false; + ws.PrintSetup.PaperSize = 9; + + ws.ForceFormulaRecalculation = true; + using (FileStream filess = File.OpenWrite(ReportFileName)) + { + hssfworkbook.Write(filess); + } + FileInfo filet = new FileInfo(ReportFileName); + Response.Clear(); + Response.Charset = "GB2312"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + // 添加头信息,为"文件下载/另存为"对话框指定默认文件名 + Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode("项目管理管线单线图附页.xlsx")); + // 添加头信息,指定文件大小,让浏览器能够显示下载进度 + Response.AddHeader("Content-Length", filet.Length.ToString()); + // 指定返回的是一个不能被客户端读取的流,必须被下载 + Response.ContentType = "application/ms-excel"; + // 把文件流发送到客户端 + Response.WriteFile(filet.FullName); + // 停止页面的执行 + Response.End(); } + #endregion } - #endregion + //} + #endregion - #region 私有方法 + #region 私有方法 + /// + /// 数据行和列 + /// + /// + private XSSFSheet ExcelCreateRow(XSSFSheet ws, XSSFWorkbook hssfworkbook, int sRows, int eRows, ICellStyle style, int cStart, int cEnd) + { + CellRangeAddress region; + for (int i = sRows; i <= eRows; i++) + { + ws.CreateRow(i); + ws.GetRow(i).HeightInPoints = 18.8f; + for (int j = cStart; j <= cEnd; j++) + { + ws.GetRow(i).CreateCell(j); + ws.GetRow(i).GetCell(j).CellStyle = style; + } + //合并数据 + if (i < eRows - 11) + { + region = new CellRangeAddress(i, i, 2, 4); + ws.AddMergedRegion(region); + } + else + { + if (i == eRows - 11) + { + region = new CellRangeAddress(i, i + 6, 1, 6); + ws.AddMergedRegion(region); + } + else if (i == eRows - 4) + { + region = new CellRangeAddress(i, i, 1, 6); + ws.AddMergedRegion(region); + } + else if (i == eRows - 3) + { + region = new CellRangeAddress(i, i, 1, 2); + ws.AddMergedRegion(region); + region = new CellRangeAddress(i, i, 3, 6); + ws.AddMergedRegion(region); + } + else if (i == eRows - 2) + { + region = new CellRangeAddress(i, i, 1, 2); + ws.AddMergedRegion(region); + region = new CellRangeAddress(i, i, 3, 6); + ws.AddMergedRegion(region); + } + else if (i == eRows - 1) + { + region = new CellRangeAddress(i, i, 1, 2); + ws.AddMergedRegion(region); + region = new CellRangeAddress(i, i, 5, 6); + ws.AddMergedRegion(region); + } + else if (i == eRows) + { + region = new CellRangeAddress(i, i, 1, 3); + ws.AddMergedRegion(region); + region = new CellRangeAddress(i, i, 4, 6); + ws.AddMergedRegion(region); + } + } + } + return ws; + } - /// - /// 数据行和列 - /// - /// - //private XSSFSheet ExcelCreateRow(XSSFSheet ws, XSSFWorkbook hssfworkbook, int sRows, int eRows, ICellStyle style, int cStart, int cEnd) - //{ - // CellRangeAddress region; - // for (int i = sRows; i <= eRows; i++) - // { - // ws.CreateRow(i); - // ws.GetRow(i).HeightInPoints = 18.8f; - // for (int j = cStart; j <= cEnd; j++) - // { - // ws.GetRow(i).CreateCell(j); - // ws.GetRow(i).GetCell(j).CellStyle = style; - // } - // //合并数据 - // region = new CellRangeAddress(i, i, 1, 2); - // ws.AddMergedRegion(region); - // region = new CellRangeAddress(i, i, 8, 9); - // ws.AddMergedRegion(region); - // region = new CellRangeAddress(i, i, 10, 14); - // ws.AddMergedRegion(region); - // } - // return ws; - //} + /// + /// 创建头部 + /// + /// + private XSSFSheet ExcelCreateRowTitle(XSSFSheet ws, XSSFWorkbook hssfworkbook, int sRows, int eRows, ICellStyle style, int cStart, int cEnd) + { + var noneStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Center, 7); + CellRangeAddress region; + for (int i = sRows; i <= eRows; i++) + { + ws.CreateRow(i); + ws.GetRow(i).HeightInPoints = 18.8f; + for (int j = cStart; j <= cEnd; j++) + { + ws.GetRow(i).CreateCell(j); + ws.GetRow(i).GetCell(j).CellStyle = i == sRows ? noneStyle : style; + } + } + //合并数据 + region = new CellRangeAddress(sRows, sRows, 1, 15); + ws.AddMergedRegion(region); + region = new CellRangeAddress(sRows + 1, sRows + 1, 1, 6); + ws.AddMergedRegion(region); + region = new CellRangeAddress(sRows + 1, sRows + 1, 8, 15); + ws.AddMergedRegion(region); + region = new CellRangeAddress(sRows + 2, sRows + 2, 2, 4); + ws.AddMergedRegion(region); + return ws; + } - /// - /// 创建头部 - /// - /// - //private XSSFSheet ExcelCreateRowTitle(XSSFSheet ws, XSSFWorkbook hssfworkbook, int sRows, int eRows, ICellStyle style, int cStart, int cEnd, bool xuTitle = false) - //{ - // var noneStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Center, 7, true); + /// + /// 创建尾部 + /// + /// + /// + /// + /// + /// + /// + /// + /// + private XSSFSheet ExcelCreateRowBottom(XSSFSheet ws, XSSFWorkbook hssfworkbook, int sRows, int eRows, ICellStyle style, int cStart, int cEnd) + { + var noneStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 7); + CellRangeAddress region; + for (int i = sRows; i <= eRows; i++) + { + ws.CreateRow(i); + ws.GetRow(i).HeightInPoints = 18.8f; + for (int j = cStart; j <= cEnd; j++) + { + ws.GetRow(i).CreateCell(j); + ws.GetRow(i).GetCell(j).CellStyle = i == sRows ? noneStyle : style; + } + } - // for (int i = sRows; i <= eRows; i++) - // { - // ws.CreateRow(i); - // if (xuTitle) - // { - // ws.GetRow(i).HeightInPoints = - // i == sRows ? 16.5f : - // i == (sRows + 1) ? 17.3f : - // i == (sRows + 2) ? 27.8f : - // i == (sRows + 3) ? 20.3f : - // i == (sRows + 4) ? 20.3f : - // i == (sRows + 5) ? 28.5f : - // 18.8f; - // } - // else - // { - // ws.GetRow(i).HeightInPoints = - // i == sRows ? 16.5f : - // i == (sRows + 1) ? 18f : - // i == (sRows + 2) ? 27.8f : - // i == (sRows + 3) ? 20.3f : - // i == (sRows + 4) ? 20.3f : - // i == (sRows + 5) ? 21.8f : - // i == (sRows + 6) ? 28.5f : - // i == (sRows + 7) ? 21f : - // i == (sRows + 8) ? 24.8f : - // i == (sRows + 9) ? 21f : - // i == (sRows + 10) ? 21f : - // i == (sRows + 11) ? 21.8f : - // i == (sRows + 12) ? 21f : - // i == (sRows + 13) ? 27f : - // 18.8f; - // } - // for (int j = cStart; j <= cEnd; j++) - // { - // ws.GetRow(i).CreateCell(j); - // ws.GetRow(i).GetCell(j).CellStyle = i == sRows ? noneStyle : style; - // } - // } - // return ws; - //} + //合并数据 + region = new CellRangeAddress(sRows, sRows + 6, 1, 6); + ws.AddMergedRegion(region); + region = new CellRangeAddress(sRows + 7, sRows + 7, 1, 6); + ws.AddMergedRegion(region); + region = new CellRangeAddress(sRows + 8, sRows + 8, 1, 2); + ws.AddMergedRegion(region); + region = new CellRangeAddress(sRows + 8, sRows + 8, 3, 6); + ws.AddMergedRegion(region); + region = new CellRangeAddress(sRows + 9, sRows + 9, 1, 2); + ws.AddMergedRegion(region); + region = new CellRangeAddress(sRows + 9, sRows + 9, 3, 6); + ws.AddMergedRegion(region); + region = new CellRangeAddress(sRows + 10, sRows + 10, 1, 2); + ws.AddMergedRegion(region); + region = new CellRangeAddress(sRows + 10, sRows + 10, 5, 6); + ws.AddMergedRegion(region); + region = new CellRangeAddress(sRows + 11, sRows + 11, 1, 3); + ws.AddMergedRegion(region); + region = new CellRangeAddress(sRows + 11, sRows + 11, 4, 6); + ws.AddMergedRegion(region); + return ws; + } - /// - /// 查询指定条数分页 - /// - /// - //public static DataTable GetPageToTable(DataTable dt, int StartNum, int EndNum) - //{ - // //0页代表每页数据,直接返回 - // if (EndNum == 0) return dt; - // //数据源为空返回空DataTable - // if (dt == null) return new DataTable(); + /// + /// 查询指定条数分页 + /// + /// + public static DataTable GetPageToTable(DataTable dt, int StartNum, int EndNum) + { + //0页代表每页数据,直接返回 + if (EndNum == 0) return dt; + //数据源为空返回空DataTable + if (dt == null) return new DataTable(); - // DataTable newdt = dt.Copy(); - // newdt.Clear();//copy dt的框架 + DataTable newdt = dt.Copy(); + newdt.Clear();//copy dt的框架 - // if (StartNum >= dt.Rows.Count) - // return newdt;//源数据记录数小于等于要显示的记录,直接返回dt + if (StartNum >= dt.Rows.Count) + return newdt;//源数据记录数小于等于要显示的记录,直接返回dt - // if (EndNum > dt.Rows.Count) - // EndNum = dt.Rows.Count; - // for (int i = StartNum; i <= EndNum - 1; i++) - // { - // DataRow newdr = newdt.NewRow(); - // DataRow dr = dt.Rows[i]; - // foreach (DataColumn column in dt.Columns) - // { - // newdr[column.ColumnName] = dr[column.ColumnName]; - // } - // newdt.Rows.Add(newdr); - // } - // return newdt; - //} - - #endregion - -} + if (EndNum > dt.Rows.Count) + EndNum = dt.Rows.Count; + for (int i = StartNum; i <= EndNum - 1; i++) + { + DataRow newdr = newdt.NewRow(); + DataRow dr = dt.Rows[i]; + foreach (DataColumn column in dt.Columns) + { + newdr[column.ColumnName] = dr[column.ColumnName]; + } + newdt.Rows.Add(newdr); + } + return newdt; + } + #endregion + } } \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/ErrLog.txt b/HJGL_DS/FineUIPro.Web/ErrLog.txt index ad88c01..5f28270 100644 --- a/HJGL_DS/FineUIPro.Web/ErrLog.txt +++ b/HJGL_DS/FineUIPro.Web/ErrLog.txt @@ -1,219 +1 @@ - -错误信息开始=====> -错误类型:HttpException -错误信息:DataBinding:“System.Data.DataRowView”不包含名为“NDTR_ID”的属性。 -错误堆栈: - 在 System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) - 在 System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) - 在 ASP.continuousprint_weldingjointinspection_aspx.__DataBindinghidNDTR_ID(Object sender, EventArgs e) 位置 e:\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\ContinuousPrint\WeldingJointInspection.aspx:行号 89 - 在 System.Web.UI.Control.OnDataBinding(EventArgs e) - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 System.Web.UI.Control.DataBindChildren() - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 FineUIPro.GridRow.NeyGkTAyBZXelPYcHqKACezTrQMaA() - 在 FineUIPro.Grid.NeyGkTAyBZXelPYcHqKACezTrQMaA(Int32 , Object ) - 在 FineUIPro.Grid.FmLkfIWGspEZkSaigqKtQvIROoZU(DataTable , Boolean ) - 在 FineUIPro.Grid.DataBind(Boolean keepCurrentRows) - 在 FineUIPro.Grid.OnRowClick(GridRowClickEventArgs e) - 在 FineUIPro.Grid.RaisePostBackEvent(String eventArgument) - 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) -出错时间:06/16/2025 11:31:09 -出错文件:http://localhost:64304/ContinuousPrint/WeldingJointInspection.aspx -IP地址:::1 -操作人员:管理员 - -出错时间:06/16/2025 11:31:09 - - -错误信息开始=====> -错误类型:HttpException -错误信息:DataBinding:“System.Data.DataRowView”不包含名为“NDTR_ID”的属性。 -错误堆栈: - 在 System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) - 在 System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) - 在 ASP.continuousprint_weldingjointinspection_aspx.__DataBindinghidNDTR_ID(Object sender, EventArgs e) 位置 e:\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\ContinuousPrint\WeldingJointInspection.aspx:行号 89 - 在 System.Web.UI.Control.OnDataBinding(EventArgs e) - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 System.Web.UI.Control.DataBindChildren() - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 FineUIPro.GridRow.NeyGkTAyBZXelPYcHqKACezTrQMaA() - 在 FineUIPro.Grid.NeyGkTAyBZXelPYcHqKACezTrQMaA(Int32 , Object ) - 在 FineUIPro.Grid.FmLkfIWGspEZkSaigqKtQvIROoZU(DataTable , Boolean ) - 在 FineUIPro.Grid.DataBind(Boolean keepCurrentRows) - 在 FineUIPro.Grid.OnRowClick(GridRowClickEventArgs e) - 在 FineUIPro.Grid.RaisePostBackEvent(String eventArgument) - 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) -出错时间:06/16/2025 11:31:11 -出错文件:http://localhost:64304/ContinuousPrint/WeldingJointInspection.aspx -IP地址:::1 -操作人员:管理员 - -出错时间:06/16/2025 11:31:11 - - -错误信息开始=====> -错误类型:HttpException -错误信息:DataBinding:“System.Data.DataRowView”不包含名为“NDTR_ID”的属性。 -错误堆栈: - 在 System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) - 在 System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) - 在 ASP.continuousprint_weldingjointinspection_aspx.__DataBindinghidNDTR_ID(Object sender, EventArgs e) 位置 e:\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\ContinuousPrint\WeldingJointInspection.aspx:行号 89 - 在 System.Web.UI.Control.OnDataBinding(EventArgs e) - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 System.Web.UI.Control.DataBindChildren() - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 FineUIPro.GridRow.NeyGkTAyBZXelPYcHqKACezTrQMaA() - 在 FineUIPro.Grid.NeyGkTAyBZXelPYcHqKACezTrQMaA(Int32 , Object ) - 在 FineUIPro.Grid.FmLkfIWGspEZkSaigqKtQvIROoZU(DataTable , Boolean ) - 在 FineUIPro.Grid.DataBind(Boolean keepCurrentRows) - 在 FineUIPro.Grid.OnRowClick(GridRowClickEventArgs e) - 在 FineUIPro.Grid.RaisePostBackEvent(String eventArgument) - 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) -出错时间:06/16/2025 11:31:13 -出错文件:http://localhost:64304/ContinuousPrint/WeldingJointInspection.aspx -IP地址:::1 -操作人员:管理员 - -出错时间:06/16/2025 11:31:13 - - -错误信息开始=====> -错误类型:HttpException -错误信息:DataBinding:“System.Data.DataRowView”不包含名为“NDTR_ID”的属性。 -错误堆栈: - 在 System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) - 在 System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) - 在 ASP.continuousprint_weldingjointinspection_aspx.__DataBindinghidNDTR_ID(Object sender, EventArgs e) 位置 e:\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\ContinuousPrint\WeldingJointInspection.aspx:行号 89 - 在 System.Web.UI.Control.OnDataBinding(EventArgs e) - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 System.Web.UI.Control.DataBindChildren() - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 FineUIPro.GridRow.NeyGkTAyBZXelPYcHqKACezTrQMaA() - 在 FineUIPro.Grid.NeyGkTAyBZXelPYcHqKACezTrQMaA(Int32 , Object ) - 在 FineUIPro.Grid.FmLkfIWGspEZkSaigqKtQvIROoZU(DataTable , Boolean ) - 在 FineUIPro.Grid.DataBind(Boolean keepCurrentRows) - 在 FineUIPro.Grid.OnRowClick(GridRowClickEventArgs e) - 在 FineUIPro.Grid.RaisePostBackEvent(String eventArgument) - 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) -出错时间:06/16/2025 11:31:15 -出错文件:http://localhost:64304/ContinuousPrint/WeldingJointInspection.aspx -IP地址:::1 -操作人员:管理员 - -出错时间:06/16/2025 11:31:15 - - -错误信息开始=====> -错误类型:HttpException -错误信息:DataBinding:“System.Data.DataRowView”不包含名为“NDTR_ID”的属性。 -错误堆栈: - 在 System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) - 在 System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) - 在 ASP.continuousprint_weldingjointinspection_aspx.__DataBindinghidNDTR_ID(Object sender, EventArgs e) 位置 e:\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\ContinuousPrint\WeldingJointInspection.aspx:行号 89 - 在 System.Web.UI.Control.OnDataBinding(EventArgs e) - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 System.Web.UI.Control.DataBindChildren() - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 FineUIPro.GridRow.NeyGkTAyBZXelPYcHqKACezTrQMaA() - 在 FineUIPro.Grid.NeyGkTAyBZXelPYcHqKACezTrQMaA(Int32 , Object ) - 在 FineUIPro.Grid.FmLkfIWGspEZkSaigqKtQvIROoZU(DataTable , Boolean ) - 在 FineUIPro.Grid.DataBind(Boolean keepCurrentRows) - 在 FineUIPro.Grid.OnRowClick(GridRowClickEventArgs e) - 在 FineUIPro.Grid.RaisePostBackEvent(String eventArgument) - 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) -出错时间:06/16/2025 11:31:18 -出错文件:http://localhost:64304/ContinuousPrint/WeldingJointInspection.aspx -IP地址:::1 -操作人员:管理员 - -出错时间:06/16/2025 11:31:18 - - -错误信息开始=====> -错误类型:HttpException -错误信息:DataBinding:“System.Data.DataRowView”不包含名为“NDTR_ID”的属性。 -错误堆栈: - 在 System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) - 在 System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) - 在 ASP.continuousprint_weldingjointinspection_aspx.__DataBindinghidNDTR_ID(Object sender, EventArgs e) 位置 e:\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\ContinuousPrint\WeldingJointInspection.aspx:行号 89 - 在 System.Web.UI.Control.OnDataBinding(EventArgs e) - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 System.Web.UI.Control.DataBindChildren() - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 FineUIPro.GridRow.NeyGkTAyBZXelPYcHqKACezTrQMaA() - 在 FineUIPro.Grid.NeyGkTAyBZXelPYcHqKACezTrQMaA(Int32 , Object ) - 在 FineUIPro.Grid.FmLkfIWGspEZkSaigqKtQvIROoZU(DataTable , Boolean ) - 在 FineUIPro.Grid.DataBind(Boolean keepCurrentRows) - 在 FineUIPro.Grid.OnRowClick(GridRowClickEventArgs e) - 在 FineUIPro.Grid.RaisePostBackEvent(String eventArgument) - 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) -出错时间:06/16/2025 11:31:20 -出错文件:http://localhost:64304/ContinuousPrint/WeldingJointInspection.aspx -IP地址:::1 -操作人员:管理员 - -出错时间:06/16/2025 11:31:20 - - -错误信息开始=====> -错误类型:HttpException -错误信息:DataBinding:“System.Data.DataRowView”不包含名为“NDTR_ID”的属性。 -错误堆栈: - 在 System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) - 在 System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) - 在 ASP.continuousprint_weldingjointinspection_aspx.__DataBindinghidNDTR_ID(Object sender, EventArgs e) 位置 e:\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\ContinuousPrint\WeldingJointInspection.aspx:行号 89 - 在 System.Web.UI.Control.OnDataBinding(EventArgs e) - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 System.Web.UI.Control.DataBindChildren() - 在 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) - 在 FineUIPro.GridRow.NeyGkTAyBZXelPYcHqKACezTrQMaA() - 在 FineUIPro.Grid.NeyGkTAyBZXelPYcHqKACezTrQMaA(Int32 , Object ) - 在 FineUIPro.Grid.FmLkfIWGspEZkSaigqKtQvIROoZU(DataTable , Boolean ) - 在 FineUIPro.Grid.DataBind(Boolean keepCurrentRows) - 在 FineUIPro.Grid.OnRowClick(GridRowClickEventArgs e) - 在 FineUIPro.Grid.RaisePostBackEvent(String eventArgument) - 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) -出错时间:06/16/2025 11:31:20 -出错文件:http://localhost:64304/ContinuousPrint/WeldingJointInspection.aspx -IP地址:::1 -操作人员:管理员 - -出错时间:06/16/2025 11:31:20 - - -错误信息开始=====> -错误类型:ViewStateException -错误信息:无效的视图状态。 - Client IP: ::1 - Port: 8742 - Referer: http://localhost:64304/ContinuousPrint/WeldingJointInspection.aspx - Path: /ContinuousPrint/WeldingJointInspection.aspx - User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0 - ViewState: /wEdADGnm4eusMgLI95ZcqpaSV8K+3GqxzG2J+U/g9/cRF+FhcCurPTiWy9daDa4Uu+xZs2OrJUAsVE+/SXcVFgGfTy1R1Gs9VzqQdsrcDHk38iP40dbnKKQjKuUZXtr6/Z5d0qe7XOxkUtMgefGofIRNAr2HBHGQjGpXVuLC49UfDySYsjlQKui4Hc5dQgJSnoYpDs3Z3I056Ac79PwQnyhFOYSqZTrH9cCRltmlIWllnygsyKrYrGqdqKi2qwFgRXmlBBTtjHnur+0tovaRs6n+I2rPgYKrAu00xIgQ0dDgbw+iRbmsWjnH8y/fbFALLs/oLVXDCMnc1gnI1/KnvWL9mfhrpEVymVMrEirjv+x+WqRJH0T+xR5U/yyGb9Q0SuQakQ2rjeVHZNT8lNoqBO01TSsAary/NBCOGB6teTRFWS9+/45gi1IyT/9KM3ZldJ1q0Li8AJm2tU38hOGyYRrqCUVwQXSBAdwWHC1B5IdZI1vA4xHDdZrmHe0qY8eXW6qXe1PnBqvn6SnA5+0qOT1Qkn28tVWnqw9hllXvrroeXoTQ/4DShPiaOg/F695Ody68UEIz3E0nC90SalNIdgxQWu5Dsqurg8Ec7R0WUNBH70082mm1s6XgB4CXaGofeTydOMFUKheZf19UlmK2O8CyWtid5ETiyReB7ueUsC/dyOf8RgK6kZaNeA3B/UGR+... -错误堆栈: - -出错时间:06/16/2025 15:29:37 -出错文件:http://localhost:64304/ContinuousPrint/WeldingJointInspection.aspx -IP地址:::1 -操作人员:管理员 - -出错时间:06/16/2025 15:29:37 - - -错误信息开始=====> -错误类型:NullReferenceException -错误信息:未将对象引用设置到对象的实例。 -错误堆栈: - 在 FineUIPro.Web._default.Page_Init(Object sender, EventArgs e) 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\default.aspx.cs:行号 114 - 在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) - 在 System.Web.UI.Control.OnInit(EventArgs e) - 在 System.Web.UI.Page.OnInit(EventArgs e) - 在 FineUIPro.Web.PageBase.OnInit(EventArgs e) 位置 D:\工作\鼎盛\HJGL_DS\HJGL_DS\FineUIPro.Web\common\PageBase.cs:行号 135 - 在 System.Web.UI.Control.InitRecursive(Control namingContainer) - 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) -出错时间:06/13/2025 16:47:46 -出错文件:http://localhost:64304/default.aspx?menuModule=6 -IP地址:::1 - -出错时间:06/13/2025 16:47:46 - + \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/管道轴测图附页.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/管道轴测图附页.frx index 8bcd508..4302c92 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/管道轴测图附页.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/管道轴测图附页.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -62,7 +62,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/NDTReport.aspx b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/NDTReport.aspx index 83a96be..45ef21d 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/NDTReport.aspx +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/NDTReport.aspx @@ -53,120 +53,88 @@ - + + - - + + + + + + + + + + + + + + + + + + + - - - - - + - - - + - - + + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - --%> diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/NDTReport.aspx.cs b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/NDTReport.aspx.cs index d4d338a..b5d8bb0 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/NDTReport.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingReport/NDTReport.aspx.cs @@ -54,30 +54,27 @@ namespace FineUIPro.Web.HJGL.WeldingReport DataTable newDataTable = new DataTable(); newDataTable.Columns.Add("NDT_ID", typeof(string)); newDataTable.Columns.Add("NDT_Code", typeof(string)); + newDataTable.Columns.Add("ProjectCode", typeof(string)); newDataTable.Columns.Add("ProjectName", typeof(string)); - newDataTable.Columns.Add("need_check_count_gd", typeof(int)); - newDataTable.Columns.Add("need_check_count_hd", typeof(int)); newDataTable.Columns.Add("need_check_count", typeof(int)); - newDataTable.Columns.Add("trust_count_current_gd", typeof(int)); - newDataTable.Columns.Add("trust_count_current_hd", typeof(int)); - newDataTable.Columns.Add("trust_count_total_gd", typeof(int)); - newDataTable.Columns.Add("trust_count_total_hd", typeof(int)); - newDataTable.Columns.Add("check_count_current_gd", typeof(int)); - newDataTable.Columns.Add("check_count_current_hd", typeof(int)); - newDataTable.Columns.Add("check_count_gd", typeof(int)); - newDataTable.Columns.Add("check_count_hd", typeof(int)); - newDataTable.Columns.Add("check_count_total", typeof(int)); + newDataTable.Columns.Add("trust_count_current", typeof(int)); + newDataTable.Columns.Add("trust_count_total", typeof(int)); + newDataTable.Columns.Add("check_count_current", typeof(int)); + newDataTable.Columns.Add("check_count", typeof(int)); + newDataTable.Columns.Add("total_check_Pass_count", typeof(int)); newDataTable.Columns.Add("check_count_film", typeof(int)); - newDataTable.Columns.Add("complete_check_gd_rate", typeof(string)); - newDataTable.Columns.Add("complete_check_hd_rate", typeof(string)); - newDataTable.Columns.Add("complete_check_total_rate", typeof(string)); - newDataTable.Columns.Add("check_one_pass_rate_count", typeof(string)); - newDataTable.Columns.Add("check_one_pass_rate_film", typeof(string)); - newDataTable.Columns.Add("total_check_noPass_count", typeof(int)); - newDataTable.Columns.Add("check_count_noPass_film", typeof(int)); - newDataTable.Columns.Add("check_count_current_film", typeof(int)); - newDataTable.Columns.Add("check_count_total_film", typeof(int)); - newDataTable.Columns.Add("check_count_repair_film", typeof(int)); + newDataTable.Columns.Add("check_count_Pass_film", typeof(int)); + newDataTable.Columns.Add("complated_check_rate", typeof(string)); + newDataTable.Columns.Add("check_onePass_rate", typeof(string)); + newDataTable.Columns.Add("check_onePass_film_rate", typeof(string)); + newDataTable.Columns.Add("check_noPass_count", typeof(int)); + newDataTable.Columns.Add("check_noPass_film_count", typeof(int)); + newDataTable.Columns.Add("repair_current_film", typeof(int)); + newDataTable.Columns.Add("repair_total_film", typeof(int)); + newDataTable.Columns.Add("pending_repair_film", typeof(int)); + newDataTable.Columns.Add("repair_current_count", typeof(int)); + newDataTable.Columns.Add("repair_total_count", typeof(int)); + newDataTable.Columns.Add("pending_repair_count", typeof(int)); //string projectIds = String.Join(",", drpProject.SelectedValueArray); foreach (var item in drpProject.SelectedValueArray) @@ -107,30 +104,27 @@ namespace FineUIPro.Web.HJGL.WeldingReport DataRow dr = newDataTable.NewRow(); dr["NDT_ID"] = tb1.Rows[i]["NDT_ID"]; dr["NDT_Code"] = tb1.Rows[i]["NDT_Code"]; + dr["ProjectCode"] = tb1.Rows[i]["ProjectCode"]; dr["ProjectName"] = tb1.Rows[i]["ProjectName"]; - dr["need_check_count_gd"] = tb1.Rows[i]["need_check_count_gd"]; - dr["need_check_count_hd"] = tb1.Rows[i]["need_check_count_hd"]; dr["need_check_count"] = tb1.Rows[i]["need_check_count"]; - dr["trust_count_current_gd"] = tb1.Rows[i]["trust_count_current_gd"]; - dr["trust_count_current_hd"] = tb1.Rows[i]["trust_count_current_hd"]; - dr["trust_count_total_gd"] = tb1.Rows[i]["trust_count_total_gd"]; - dr["trust_count_total_hd"] = tb1.Rows[i]["trust_count_total_hd"]; - dr["check_count_current_gd"] = tb1.Rows[i]["check_count_current_gd"]; - dr["check_count_current_hd"] = tb1.Rows[i]["check_count_current_hd"]; - dr["check_count_gd"] = tb1.Rows[i]["check_count_gd"]; - dr["check_count_hd"] = tb1.Rows[i]["check_count_hd"]; - dr["check_count_total"] = tb1.Rows[i]["check_count_total"]; + dr["trust_count_current"] = tb1.Rows[i]["trust_count_current"]; + dr["trust_count_total"] = tb1.Rows[i]["trust_count_total"]; + dr["check_count_current"] = tb1.Rows[i]["check_count_current"]; + dr["check_count"] = tb1.Rows[i]["check_count"]; + dr["total_check_Pass_count"] = tb1.Rows[i]["total_check_Pass_count"]; dr["check_count_film"] = tb1.Rows[i]["check_count_film"]; - dr["complete_check_gd_rate"] = tb1.Rows[i]["complete_check_gd_rate"]; - dr["complete_check_hd_rate"] = tb1.Rows[i]["complete_check_hd_rate"]; - dr["complete_check_total_rate"] = tb1.Rows[i]["complete_check_total_rate"]; - dr["check_one_pass_rate_count"] = tb1.Rows[i]["check_one_pass_rate_count"]; - dr["check_one_pass_rate_film"] = tb1.Rows[i]["check_one_pass_rate_film"]; - dr["check_count_noPass_film"] = tb1.Rows[i]["total_check_noPass_count"]; - dr["check_count_noPass_film"] = tb1.Rows[i]["check_count_noPass_film"]; - dr["check_count_current_film"] = tb1.Rows[i]["check_count_current_film"]; - dr["check_count_total_film"] = tb1.Rows[i]["check_count_total_film"]; - dr["check_count_repair_film"] = tb1.Rows[i]["check_count_repair_film"]; + dr["check_count_Pass_film"] = tb1.Rows[i]["check_count_Pass_film"]; + dr["complated_check_rate"] = tb1.Rows[i]["complated_check_rate"]; + dr["check_onePass_rate"] = tb1.Rows[i]["check_onePass_rate"]; + dr["check_onePass_film_rate"] = tb1.Rows[i]["check_onePass_film_rate"]; + dr["check_noPass_count"] = tb1.Rows[i]["check_noPass_count"]; + dr["check_noPass_film_count"] = tb1.Rows[i]["check_noPass_film_count"]; + dr["repair_current_film"] = tb1.Rows[i]["repair_current_film"]; + dr["repair_total_film"] = tb1.Rows[i]["repair_total_film"]; + dr["pending_repair_film"] = tb1.Rows[i]["pending_repair_film"]; + dr["repair_current_count"] = tb1.Rows[i]["repair_current_count"]; + dr["repair_total_count"] = tb1.Rows[i]["repair_total_count"]; + dr["pending_repair_count"] = tb1.Rows[i]["pending_repair_count"]; newDataTable.Rows.Add(dr); } }