20240412 质量月报
This commit is contained in:
@@ -1196,12 +1196,42 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
isYm = true;
|
||||
numberIndex = 1;
|
||||
whileIndex = 13;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
//跳过页眉的表头
|
||||
while (isYm)
|
||||
{
|
||||
if (table.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = false;
|
||||
}
|
||||
}
|
||||
//创建行
|
||||
Row row = new Row(doc);
|
||||
row.Cells.Add(CreateCell(numberIndex.ToString(), doc, table.FirstRow.Cells[0].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[1].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell("", doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, row);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 10.现场质量共检数据
|
||||
|
||||
#region 10-1 土建
|
||||
var TJInspection = reportItem.Where(x => x.ReType == "10-4").ToList();
|
||||
var TJInspection = reportItem.Where(x => x.ReType == "10-1").ToList();
|
||||
if (TJInspection.Count > 0)
|
||||
{
|
||||
isYm = true;
|
||||
@@ -1290,6 +1320,42 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = true;
|
||||
numberIndex = 1;
|
||||
whileIndex = 14;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
//跳过页眉的表头
|
||||
while (isYm)
|
||||
{
|
||||
if (table.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = false;
|
||||
}
|
||||
}
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
double numcount0 = table.Rows[0].Cells[0].CellFormat.Width;
|
||||
double numcount1 = table.Rows[0].Cells[1].CellFormat.Width;
|
||||
double numcount2 = table.Rows[1].Cells[2].CellFormat.Width;
|
||||
double numcount3 = table.Rows[1].Cells[3].CellFormat.Width;
|
||||
double numcount4 = table.Rows[1].Cells[4].CellFormat.Width;
|
||||
double numcount5 = table.Rows[1].Cells[5].CellFormat.Width;
|
||||
double numcount6 = table.Rows[1].Cells[6].CellFormat.Width;
|
||||
double numcount7 = table.Rows[1].Cells[7].CellFormat.Width;
|
||||
double numcount = numcount0 + numcount1 + numcount2 + numcount3 + numcount4 + numcount5 + numcount6 + numcount7;
|
||||
rowhj.Cells.Add(CreateCell("暂无数据", doc, numcount));
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10-2 设备
|
||||
@@ -1382,6 +1448,42 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = true;
|
||||
numberIndex = 1;
|
||||
whileIndex = 15;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
//跳过页眉的表头
|
||||
while (isYm)
|
||||
{
|
||||
if (table.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = false;
|
||||
}
|
||||
}
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
double numcount0 = table.Rows[0].Cells[0].CellFormat.Width;
|
||||
double numcount1 = table.Rows[0].Cells[1].CellFormat.Width;
|
||||
double numcount2 = table.Rows[1].Cells[2].CellFormat.Width;
|
||||
double numcount3 = table.Rows[1].Cells[3].CellFormat.Width;
|
||||
double numcount4 = table.Rows[1].Cells[4].CellFormat.Width;
|
||||
double numcount5 = table.Rows[1].Cells[5].CellFormat.Width;
|
||||
double numcount6 = table.Rows[1].Cells[6].CellFormat.Width;
|
||||
double numcount7 = table.Rows[1].Cells[7].CellFormat.Width;
|
||||
double numcount = numcount0 + numcount1 + numcount2 + numcount3 + numcount4 + numcount5 + numcount6 + numcount7;
|
||||
rowhj.Cells.Add(CreateCell("暂无数据", doc, numcount));
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10-3 管道
|
||||
@@ -1474,6 +1576,42 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = true;
|
||||
numberIndex = 1;
|
||||
whileIndex = 16;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
//跳过页眉的表头
|
||||
while (isYm)
|
||||
{
|
||||
if (table.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = false;
|
||||
}
|
||||
}
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
double numcount0 = table.Rows[0].Cells[0].CellFormat.Width;
|
||||
double numcount1 = table.Rows[0].Cells[1].CellFormat.Width;
|
||||
double numcount2 = table.Rows[1].Cells[2].CellFormat.Width;
|
||||
double numcount3 = table.Rows[1].Cells[3].CellFormat.Width;
|
||||
double numcount4 = table.Rows[1].Cells[4].CellFormat.Width;
|
||||
double numcount5 = table.Rows[1].Cells[5].CellFormat.Width;
|
||||
double numcount6 = table.Rows[1].Cells[6].CellFormat.Width;
|
||||
double numcount7 = table.Rows[1].Cells[7].CellFormat.Width;
|
||||
double numcount = numcount0 + numcount1 + numcount2 + numcount3 + numcount4 + numcount5 + numcount6 + numcount7;
|
||||
rowhj.Cells.Add(CreateCell("暂无数据", doc, numcount));
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10-4 电气
|
||||
@@ -1566,6 +1704,42 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = true;
|
||||
numberIndex = 1;
|
||||
whileIndex = 17;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
//跳过页眉的表头
|
||||
while (isYm)
|
||||
{
|
||||
if (table.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = false;
|
||||
}
|
||||
}
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
double numcount0 = table.Rows[0].Cells[0].CellFormat.Width;
|
||||
double numcount1 = table.Rows[0].Cells[1].CellFormat.Width;
|
||||
double numcount2 = table.Rows[1].Cells[2].CellFormat.Width;
|
||||
double numcount3 = table.Rows[1].Cells[3].CellFormat.Width;
|
||||
double numcount4 = table.Rows[1].Cells[4].CellFormat.Width;
|
||||
double numcount5 = table.Rows[1].Cells[5].CellFormat.Width;
|
||||
double numcount6 = table.Rows[1].Cells[6].CellFormat.Width;
|
||||
double numcount7 = table.Rows[1].Cells[7].CellFormat.Width;
|
||||
double numcount = numcount0 + numcount1 + numcount2 + numcount3 + numcount4 + numcount5 + numcount6 + numcount7;
|
||||
rowhj.Cells.Add(CreateCell("暂无数据", doc, numcount));
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10-5.仪表
|
||||
@@ -1658,6 +1832,42 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = true;
|
||||
numberIndex = 1;
|
||||
whileIndex = 18;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
//跳过页眉的表头
|
||||
while (isYm)
|
||||
{
|
||||
if (table.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = false;
|
||||
}
|
||||
}
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
double numcount0 = table.Rows[0].Cells[0].CellFormat.Width;
|
||||
double numcount1 = table.Rows[0].Cells[1].CellFormat.Width;
|
||||
double numcount2 = table.Rows[1].Cells[2].CellFormat.Width;
|
||||
double numcount3 = table.Rows[1].Cells[3].CellFormat.Width;
|
||||
double numcount4 = table.Rows[1].Cells[4].CellFormat.Width;
|
||||
double numcount5 = table.Rows[1].Cells[5].CellFormat.Width;
|
||||
double numcount6 = table.Rows[1].Cells[6].CellFormat.Width;
|
||||
double numcount7 = table.Rows[1].Cells[7].CellFormat.Width;
|
||||
double numcount = numcount0 + numcount1 + numcount2 + numcount3 + numcount4 + numcount5 + numcount6 + numcount7;
|
||||
rowhj.Cells.Add(CreateCell("暂无数据", doc, numcount));
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10-6.防腐
|
||||
@@ -1750,6 +1960,42 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = true;
|
||||
numberIndex = 1;
|
||||
whileIndex = 19;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
//跳过页眉的表头
|
||||
while (isYm)
|
||||
{
|
||||
if (table.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = false;
|
||||
}
|
||||
}
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
double numcount0 = table.Rows[0].Cells[0].CellFormat.Width;
|
||||
double numcount1 = table.Rows[0].Cells[1].CellFormat.Width;
|
||||
double numcount2 = table.Rows[1].Cells[2].CellFormat.Width;
|
||||
double numcount3 = table.Rows[1].Cells[3].CellFormat.Width;
|
||||
double numcount4 = table.Rows[1].Cells[4].CellFormat.Width;
|
||||
double numcount5 = table.Rows[1].Cells[5].CellFormat.Width;
|
||||
double numcount6 = table.Rows[1].Cells[6].CellFormat.Width;
|
||||
double numcount7 = table.Rows[1].Cells[7].CellFormat.Width;
|
||||
double numcount = numcount0 + numcount1 + numcount2 + numcount3 + numcount4 + numcount5 + numcount6 + numcount7;
|
||||
rowhj.Cells.Add(CreateCell("暂无数据", doc, numcount));
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10-7.消防
|
||||
@@ -1842,6 +2088,42 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = true;
|
||||
numberIndex = 1;
|
||||
whileIndex = 20;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
//跳过页眉的表头
|
||||
while (isYm)
|
||||
{
|
||||
if (table.Range.Text.Substring(0, 2) != "序号")
|
||||
{
|
||||
whileIndex += 1;
|
||||
table = (Aspose.Words.Tables.Table)doc.GetChild(NodeType.Table, whileIndex, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
isYm = false;
|
||||
}
|
||||
}
|
||||
//创建合计
|
||||
Row rowhj = new Row(doc);
|
||||
double numcount0 = table.Rows[0].Cells[0].CellFormat.Width;
|
||||
double numcount1 = table.Rows[0].Cells[1].CellFormat.Width;
|
||||
double numcount2 = table.Rows[1].Cells[2].CellFormat.Width;
|
||||
double numcount3 = table.Rows[1].Cells[3].CellFormat.Width;
|
||||
double numcount4 = table.Rows[1].Cells[4].CellFormat.Width;
|
||||
double numcount5 = table.Rows[1].Cells[5].CellFormat.Width;
|
||||
double numcount6 = table.Rows[1].Cells[6].CellFormat.Width;
|
||||
double numcount7 = table.Rows[1].Cells[7].CellFormat.Width;
|
||||
double numcount = numcount0 + numcount1 + numcount2 + numcount3 + numcount4 + numcount5 + numcount6 + numcount7;
|
||||
rowhj.Cells.Add(CreateCell("暂无数据", doc, numcount));
|
||||
table.Rows.Insert(numberIndex + 1, rowhj);
|
||||
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 10.总数
|
||||
@@ -1897,6 +2179,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region 11.压力管道监检情况
|
||||
@@ -2066,7 +2349,6 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
//自动设置表格样式
|
||||
table.AutoFit(AutoFitBehavior.FixedColumnWidths);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 14.NCR管理情况
|
||||
@@ -2101,7 +2383,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
row.Cells.Add(CreateCell(item.ContentName, doc, table.FirstRow.Cells[1].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.MonthsCount.ToString(), doc, table.FirstRow.Cells[2].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.ProjectCount.ToString(), doc, table.FirstRow.Cells[3].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.TotalNoBackCount.HasValue ? item.TotalNoBackCount.ToString() : "0", doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.TotalNoBackCount.ToString(), doc, table.FirstRow.Cells[4].CellFormat.Width));
|
||||
row.Cells.Add(CreateCell(item.RectificationRate.ToString(), doc, table.FirstRow.Cells[5].CellFormat.Width));
|
||||
table.Rows.Insert(numberIndex, row);
|
||||
num1 += item.MonthsCount;
|
||||
@@ -2434,6 +2716,182 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 23.施工照片
|
||||
var imageUrl1 = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ImageUrl;
|
||||
if (!string.IsNullOrWhiteSpace(imageUrl1))
|
||||
{
|
||||
string rootPathUrl = rootPath.Replace("\\", "/");
|
||||
string url = rootPathUrl + imageUrl1;
|
||||
//DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("ImageUrl1");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl1, out JpgSize, out Wpx, out Hpx);
|
||||
//double w = 1;
|
||||
//w = JpgSize.Width / 50.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w);
|
||||
builder.InsertImage(url, 200, 150);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var imageUrl2 = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ImageUrl;
|
||||
if (!string.IsNullOrWhiteSpace(imageUrl2))
|
||||
{
|
||||
string rootPathUrl = rootPath.Replace("\\", "/");
|
||||
string url = rootPathUrl + imageUrl2;
|
||||
//DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("ImageUrl2");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl2, out JpgSize, out Wpx, out Hpx);
|
||||
//double w = 1;
|
||||
//w = JpgSize.Width / 50.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w);
|
||||
builder.InsertImage(url, 200, 150);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var imageUrl3 = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ImageUrl;
|
||||
if (!string.IsNullOrWhiteSpace(imageUrl3))
|
||||
{
|
||||
string rootPathUrl = rootPath.Replace("\\", "/");
|
||||
string url = rootPathUrl + imageUrl3;
|
||||
//DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("ImageUrl3");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl3, out JpgSize, out Wpx, out Hpx);
|
||||
//double w = 1;
|
||||
//w = JpgSize.Width / 50.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w);
|
||||
builder.InsertImage(url, 200, 150);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var imageUrl4 = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ImageUrl;
|
||||
if (!string.IsNullOrWhiteSpace(imageUrl4))
|
||||
{
|
||||
string rootPathUrl = rootPath.Replace("\\", "/");
|
||||
string url = rootPathUrl + imageUrl4;
|
||||
//DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("ImageUrl4");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl4, out JpgSize, out Wpx, out Hpx);
|
||||
//double w = 1;
|
||||
//w = JpgSize.Width / 50.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w);
|
||||
builder.InsertImage(url, 200, 150);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var imageUrl5 = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ImageUrl;
|
||||
if (!string.IsNullOrWhiteSpace(imageUrl5))
|
||||
{
|
||||
string rootPathUrl = rootPath.Replace("\\", "/");
|
||||
string url = rootPathUrl + imageUrl5;
|
||||
//DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("ImageUrl5");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl5, out JpgSize, out Wpx, out Hpx);
|
||||
//double w = 1;
|
||||
//w = JpgSize.Width / 50.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w);
|
||||
builder.InsertImage(url, 200, 150);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var imageUrl6 = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ImageUrl;
|
||||
if (!string.IsNullOrWhiteSpace(imageUrl6))
|
||||
{
|
||||
string rootPathUrl = rootPath.Replace("\\", "/");
|
||||
string url = rootPathUrl + imageUrl6;
|
||||
//DocumentBuilder builder = new DocumentBuilder(doc);
|
||||
builder.MoveToBookmark("ImageUrl6");
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
System.Drawing.Size JpgSize;
|
||||
float Wpx;
|
||||
float Hpx;
|
||||
UploadAttachmentService.getJpgSize(rootPathUrl + imageUrl6, out JpgSize, out Wpx, out Hpx);
|
||||
//double w = 1;
|
||||
//w = JpgSize.Width / 50.0;
|
||||
if (File.Exists(url))
|
||||
{
|
||||
//builder.InsertImage(url, JpgSize.Width / w, JpgSize.Height / w);
|
||||
builder.InsertImage(url, 200, 150);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bkmark = doc.Range.Bookmarks["ImageContent1"];
|
||||
if (bkmark != null)
|
||||
{
|
||||
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-1").ContentText;
|
||||
}
|
||||
|
||||
bkmark = doc.Range.Bookmarks["ImageContent2"];
|
||||
if (bkmark != null)
|
||||
{
|
||||
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-2").ContentText;
|
||||
}
|
||||
|
||||
bkmark = doc.Range.Bookmarks["ImageContent3"];
|
||||
if (bkmark != null)
|
||||
{
|
||||
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-3").ContentText;
|
||||
}
|
||||
|
||||
bkmark = doc.Range.Bookmarks["ImageContent4"];
|
||||
if (bkmark != null)
|
||||
{
|
||||
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-4").ContentText;
|
||||
}
|
||||
|
||||
bkmark = doc.Range.Bookmarks["ImageContent5"];
|
||||
if (bkmark != null)
|
||||
{
|
||||
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-5").ContentText;
|
||||
}
|
||||
|
||||
bkmark = doc.Range.Bookmarks["ImageContent6"];
|
||||
if (bkmark != null)
|
||||
{
|
||||
bkmark.Text = txtReportList.FirstOrDefault(x => x.ContentType == "23-6").ContentText;
|
||||
}
|
||||
#endregion
|
||||
|
||||
doc.Save(newUrl);
|
||||
string fileName = Path.GetFileName(newUrl);
|
||||
FileInfo info = new FileInfo(newUrl);
|
||||
|
||||
Reference in New Issue
Block a user