using OfficeOpenXml;
using OfficeOpenXml.Style;
public void ExportBLL(string modelFilePath, string saveFilePath)
{
//文件拷贝
File.Copy(modelFilePath, saveFilePath);
FileInfo saveFile = new FileInfo(saveFilePath);
//打开Excel编辑
using (ExcelPackage package = new ExcelPackage(saveFile))
{
ExcelWorksheet worksheet = null;
//新建编辑表单
//编辑
worksheet = package.Workbook.Worksheets.Copy("报价表", "报价清单");
if (dt_Product == null)
{
return;
}
//根据产品数量插入行
int num = dt_Product.Rows.Count;
decimal count = 0;
if (num > 1)
worksheet.InsertRow(8, num-1);
}
}
建议你重装下系统检查下cpu和内存,查看那个进程占用资源,杀掉进程:https://cloud.tencent.com/act/cps/redirect?redirect=1050&cps_key=0a97e47fbcf2f7190614f543494361a6&from=console
相似问题