| | |
| | | { |
| | | } |
| | | |
| | | //报告标题项目名称 |
| | | private string _title = "*********"; |
| | | |
| | | //项目情况介绍 一)系统概括中 |
| | | private string _Instructions = "*******************************************************************"; |
| | | |
| | | //文字描述运行模式介绍 二)运行情况与能耗分析中 "全年:"后 |
| | | private string _run_mode = "*******************************************************************"; |
| | | |
| | |
| | | return strem; |
| | | } |
| | | |
| | | protected void SetWordHander(Aspose.Words.Document doc) |
| | | protected void SetWordHander(Aspose.Words.Document doc, string title) |
| | | { |
| | | DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc); |
| | | builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary); |
| | | SimulationWordReportHelper Text_center_10_Gray = new SimulationWordReportHelper(builder) { fontalignment = ParagraphAlignment.Right, fontsize = 10, fontcolor = Color.Gray }; |
| | | Text_center_10_Gray.structureText(string.Format("{0}{1}", _title, "项目节能方案报告")); |
| | | Text_center_10_Gray.structureText(string.Format("{0}{1}", title, "项目节能方案报告")); |
| | | builder.InsertHorizontalRule(); |
| | | // 移动到下一行,以便继续添加其他内容 |
| | | builder.MoveToDocumentStart(); |
| | | } |
| | | |
| | | protected void SetWordFooter(Aspose.Words.Document doc) |
| | | protected void SetWordFooter(Aspose.Words.Document doc, string title) |
| | | { |
| | | DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc); |
| | | |
| | | builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary); |
| | | SimulationWordReportHelper Text_center_10_Gray = new SimulationWordReportHelper(builder) { fontalignment = ParagraphAlignment.Left, fontsize = 10, fontcolor = Color.Gray }; |
| | | builder.InsertHorizontalRule(); |
| | | Text_center_10_Gray.structureText(string.Format("{0}{1}", _title, "项目节能方案报告")); |
| | | Text_center_10_Gray.structureText(string.Format("{0}{1}", title, "项目节能方案报告")); |
| | | // 移动到下一行,以便继续添加其他内容 |
| | | builder.MoveToDocumentStart(); |
| | | } |
| | |
| | | SimulationWordReportHelper Text_left_15_black = new SimulationWordReportHelper(builder) { fontsize = 15, isblod = true };//一级标题 |
| | | SimulationWordReportHelper Text_left_12_black = new SimulationWordReportHelper(builder) { fontsize = 12 }; |
| | | SimulationWordReportHelper Text_reight_10_black = new SimulationWordReportHelper(builder) { fontalignment = ParagraphAlignment.Right, fontsize = 12 }; |
| | | SetWordHander(src); |
| | | SetWordFooter(src); |
| | | SetWordHander(src, reportViewModel.ProjectName); |
| | | SetWordFooter(src, reportViewModel.ProjectName); |
| | | |
| | | builder.ParagraphFormat.LineSpacingRule = LineSpacingRule.Multiple; |
| | | builder.ParagraphFormat.LineSpacing = 18; // 设置行距为1.5倍默认行距 |
| | |
| | | SimulationWordReportHelper Cell_h_merging_start = new SimulationWordReportHelper(builder) { horizontalMerge = Aspose.Words.Tables.CellMerge.First }; |
| | | SimulationWordReportHelper Cell_h_merging_end = new SimulationWordReportHelper(builder) { horizontalMerge = Aspose.Words.Tables.CellMerge.Previous }; |
| | | |
| | | Text_center_25_black.structureText(string.Format("{0}{1}", _title, "项目节能方案报告")); |
| | | Text_center_25_black.structureText(string.Format("{0}{1}", reportViewModel.ProjectName, "项目节能方案报告")); |
| | | Text_left_15_black.structureText("一、系统概述"); |
| | | Text_left_15_black.AddBlankLine(); |
| | | Text_left_15_black.AddBlankLine(); |
| | | Text_left_12_black.structureText(string.Format("{0}", _Instructions)); |
| | | Text_left_12_black.structureText(string.Format("{0}", reportViewModel.Description)); |
| | | Text_left_12_black.structureText("1.1、设备基本配置"); |
| | | |
| | | #region 设别基本配置表 |
| | |
| | | Cell.structureCell(item.Speed); |
| | | builder.EndRow(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | } |
| | | builder.EndTable(); |
| | | basic_config_table.AllowAutoFit = false; |
| | |
| | | Cell.structureCell(item.ReturnPressure); |
| | | builder.EndRow(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | } |
| | | |
| | | builder.EndTable(); |
| | |
| | | Cell.structureCell("年运行时间(h)"); |
| | | Cell.structureCell("年耗电量(万kW.h)"); |
| | | builder.EndRow(); |
| | | |
| | | double totalPower = 0; |
| | | int totalHour = 0; |
| | | double AnnualPower = 0; |
| | | if (reportViewModel.PowerConsumptionInfos != null) |
| | | { |
| | | foreach (var item in reportViewModel.PowerConsumptionInfos) |
| | | { |
| | | Cell.structureCell(item.RunMode); |
| | | Cell.structureCell(item.PreTechPowerConsumption); |
| | | if (double.TryParse(item.PreTechPowerConsumption, out double power)) |
| | | { |
| | | totalPower += power; |
| | | } |
| | | Cell.structureCell(item.AnnualRunningHours); |
| | | if (int.TryParse(item.AnnualRunningHours, out int hour)) |
| | | { |
| | | totalHour += hour; |
| | | } |
| | | Cell.structureCell(item.AnnualPowerConsumption); |
| | | if (double.TryParse(item.AnnualPowerConsumption, out double annualPower)) |
| | | { |
| | | AnnualPower += annualPower; |
| | | } |
| | | builder.EndRow(); |
| | | } |
| | | } |
| | | |
| | | Cell.structureCell("合计"); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | if (totalPower != 0) |
| | | { |
| | | Cell.structureCell(totalPower.ToString()); |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | } |
| | | if (totalHour != 0) |
| | | { |
| | | Cell.structureCell(totalHour.ToString()); |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | } |
| | | if (AnnualPower != 0) |
| | | { |
| | | Cell.structureCell(AnnualPower.ToString()); |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | } |
| | | builder.EndTable(); |
| | | actual_energy_consumption_table.AllowAutoFit = false; |
| | | Processing_pagination(src, builder, actual_energy_consumption_table); |
| | |
| | | Cell.structureCell(item.EquipmentName); |
| | | Cell.structureCell(item.EquipmentNumber); |
| | | Cell.structureCell(item.EquipmentMainName); |
| | | Cell.structureCell(item.Count); |
| | | Cell.structureCell(item.RatedFlow); |
| | | Cell.structureCell(item.RatedHead); |
| | | Cell.structureCell(item.TypeOfDrive); |
| | |
| | | Cell.structureCell(item.Speed); |
| | | builder.EndRow(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | } |
| | | builder.EndTable(); |
| | | Device_configuration_table.AllowAutoFit = false; |
| | |
| | | Cell.structureCell(item.ReturnPressure); |
| | | builder.EndRow(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | } |
| | | builder.EndTable(); |
| | | //estimated_running_table.AllowAutoFit = false; |
| | |
| | | Cell.structureCell("年运行时间(h)"); |
| | | Cell.structureCell("改后年耗电量(万kW.h)"); |
| | | builder.EndRow(); |
| | | |
| | | totalPower = 0; |
| | | totalHour = 0; |
| | | AnnualPower = 0; |
| | | if (reportViewModel.AfterPowerConsumptionInfos != null) |
| | | { |
| | | foreach (var item in reportViewModel.AfterPowerConsumptionInfos) |
| | | { |
| | | Cell.structureCell(item.RunMode); |
| | | Cell.structureCell(item.PreTechPowerConsumption); |
| | | if (double.TryParse(item.PreTechPowerConsumption, out double power)) |
| | | { |
| | | totalPower += power; |
| | | } |
| | | Cell.structureCell(item.AnnualRunningHours); |
| | | if (int.TryParse(item.AnnualRunningHours, out int hour)) |
| | | { |
| | | totalHour += hour; |
| | | } |
| | | Cell.structureCell(item.AnnualPowerConsumption); |
| | | if (double.TryParse(item.AnnualPowerConsumption, out double annualPower)) |
| | | { |
| | | AnnualPower += annualPower; |
| | | } |
| | | builder.EndRow(); |
| | | } |
| | | } |
| | | |
| | | Cell.structureCell("合计"); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | if (totalPower != 0) |
| | | { |
| | | Cell.structureCell(totalPower.ToString()); |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | } |
| | | if (totalHour != 0) |
| | | { |
| | | Cell.structureCell(totalHour.ToString()); |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | } |
| | | if (AnnualPower != 0) |
| | | { |
| | | Cell.structureCell(AnnualPower.ToString()); |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | } |
| | | builder.EndTable(); |
| | | expected_power_savings.AllowAutoFit = false; |
| | | Processing_pagination(src, builder, expected_power_savings); |
| | |
| | | Cell.structureCell("(%)"); |
| | | Cell.structureCell("(h)"); |
| | | builder.EndRow(); |
| | | |
| | | double savingRate = 0; |
| | | double runningTime = 0; |
| | | if (reportViewModel.PowerRelatedInfos != null) |
| | | { |
| | | foreach (var item in reportViewModel.PowerRelatedInfos) |
| | |
| | | Cell.structureCell(item.PostTechDesignedPower); |
| | | Cell.structureCell(item.HourlyPowerSaving); |
| | | Cell.structureCell(item.PowerSavingRate); |
| | | if (double.TryParse(item.PowerSavingRate, out double power)) |
| | | { |
| | | savingRate += power; |
| | | } |
| | | Cell.structureCell(item.RunningTime); |
| | | if (double.TryParse(item.RunningTime, out double time)) |
| | | { |
| | | runningTime += time; |
| | | } |
| | | builder.EndRow(); |
| | | } |
| | | } |
| | | |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | } |
| | | Cell_h_merging_start.structureCell("合计年节电量(万度)"); |
| | | Cell_h_merging_end.structureCell(""); |
| | | Cell_h_merging_end.structureCell(""); |
| | | Cell_h_merging_end.structureCell(""); |
| | | Cell_h_merging_start.structureCell(""); |
| | | Cell_h_merging_start.structureCell(""); |
| | | if (savingRate != 0) |
| | | { |
| | | Cell_h_merging_start.structureCell(savingRate.ToString()); |
| | | } |
| | | else |
| | | { |
| | | Cell_h_merging_start.structureCell(""); |
| | | } |
| | | if (runningTime != 0) |
| | | { |
| | | Cell_h_merging_start.structureCell(runningTime.ToString()); |
| | | } |
| | | else |
| | | { |
| | | Cell_h_merging_start.structureCell(""); |
| | | } |
| | | builder.EndTable(); |
| | | summary_table.AllowAutoFit = false; |
| | | Processing_pagination(src, builder, summary_table); |
| | |
| | | Cell.structureCell("改后年节电量\r\n(万度/年)"); |
| | | builder.EndRow(); |
| | | |
| | | double totalBeforePower = 0; |
| | | double totalSavingRate = 0; |
| | | double totalAfterAnnualPower = 0; |
| | | if (reportViewModel.AfterEquipmentPowers != null) |
| | | { |
| | | int i = 0; |
| | | foreach (var item in reportViewModel.AfterEquipmentPowers) |
| | | { |
| | | Cell.structureCell((i++).ToString()); |
| | | Cell.structureCell((++i).ToString()); |
| | | Cell.structureCell(item.EquipmentName); |
| | | Cell.structureCell(item.PowerConsumptionBeforeTech); |
| | | if (double.TryParse(item.PowerConsumptionBeforeTech, out double BeforePower)) |
| | | { |
| | | totalBeforePower += BeforePower; |
| | | } |
| | | Cell.structureCell(item.PowerSavingRate); |
| | | if (double.TryParse(item.PowerSavingRate, out double SavingRate)) |
| | | { |
| | | totalSavingRate += SavingRate; |
| | | } |
| | | Cell.structureCell(item.AnnualPowerSavingAfterTech); |
| | | if (double.TryParse(item.AnnualPowerSavingAfterTech, out double AfterAnnualPower)) |
| | | { |
| | | totalAfterAnnualPower += AfterAnnualPower; |
| | | } |
| | | builder.EndRow(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | builder.EndRow(); |
| | | } |
| | | |
| | | Cell.structureCell(""); |
| | | Cell.structureCell("合计"); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | Cell.structureCell(""); |
| | | if (totalBeforePower != 0) |
| | | { |
| | | Cell.structureCell(totalBeforePower.ToString()); |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | } |
| | | if (totalSavingRate != 0) |
| | | { |
| | | Cell.structureCell(totalSavingRate.ToString()); |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | } |
| | | if (totalAfterAnnualPower != 0) |
| | | { |
| | | Cell.structureCell(totalAfterAnnualPower.ToString()); |
| | | } |
| | | else |
| | | { |
| | | Cell.structureCell(""); |
| | | } |
| | | builder.EndRow(); |
| | | builder.EndTable(); |
| | | power_saving_effect_table.AllowAutoFit = false; |