修改进度报表导出格式

This commit is contained in:
高飞 2023-07-03 10:33:23 +08:00
parent c165519e80
commit 4186d98a14
6 changed files with 25 additions and 5 deletions

View File

@ -3144,7 +3144,7 @@ namespace BLL
/// <summary>
/// 施工进度报表模板文件原始虚拟路径
/// </summary>
public const string JDreportReportTemplateUrl = "File\\Excel\\DataIn\\施工进度报表.xlsx";
public const string JDreportReportTemplateUrl = "File\\Excel\\DataIn\\施工进度报表.xls";
#endregion
#region

View File

@ -0,0 +1,19 @@
错误信息开始=====>
错误类型:FileNotFoundException
错误信息:未能找到文件“E:\工作\五环施工平台\SGGL_CWCEC\SGGL\FineUIPro.Web\File\Excel\DataIn\施工进度报表模板.xls”。
错误堆栈:
在 FineUIPro.Web.JDGL.CostAnalysis.JDReport.btnOutExcel_Click(Object sender, EventArgs e) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\FineUIPro.Web\JDGL\CostAnalysis\JDReport.aspx.cs:行号 3480
在 FineUIPro.Button.OnClick(EventArgs e)
在 (Button , EventArgs )
在 FineUIPro.Button.RaisePostBackEvent(String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:07/03/2023 10:27:29
出错文件:http://localhost:9733/JDGL/CostAnalysis/JDReport.aspx
IP地址:::1
操作人员:JT
出错时间:07/03/2023 10:27:29

View File

@ -1924,13 +1924,13 @@ namespace FineUIPro.Web.JDGL.CostAnalysis
initTemplatePath = Const.JDreportReportTemplateUrl;
uploadfilepath = rootPath + initTemplatePath;
newUrl = uploadfilepath.Replace(".xlsx", "(" + this.txtMonths.Text.Trim() + ")" + ".xlsx");
newUrl = uploadfilepath.Replace(".xls", "(" + this.txtMonths.Text.Trim() + ")" + ".xls");
File.Copy(uploadfilepath, newUrl);
// 第一步:读取文件流
NPOI.SS.UserModel.IWorkbook workbook;
using (FileStream stream = new FileStream(newUrl, FileMode.Open, FileAccess.Read))
{
workbook = new NPOI.XSSF.UserModel.XSSFWorkbook(stream);
workbook = new NPOI.HSSF.UserModel.HSSFWorkbook(stream);
}
// 创建单元格样式
@ -2003,7 +2003,7 @@ namespace FineUIPro.Web.JDGL.CostAnalysis
cell = row.CreateCell(41);
cell.CellStyle = cellStyle1;
cell.SetCellValue("累计计划工作预算费用-BCWS");
rowCount += 1;
for (int i = 0; i < dt.Rows.Count; i++)
{
@ -3313,7 +3313,8 @@ namespace FineUIPro.Web.JDGL.CostAnalysis
cell.CellStyle = cellStyle;
cell.SetCellValue(cellValue5);
}
else {
else
{
//单位
cell = row.CreateCell(5);
cell.CellStyle = cellStyle;

Binary file not shown.