replaced Chinese with English in Excel Exporters of API
parent
b353522578
commit
3cbecd9d14
|
@ -73,7 +73,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
data_font = Font(name='Franklin Gothic Book', size=11)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
|
@ -116,7 +116,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
ws['B3'].font = name_font
|
||||
ws['B3'].alignment = b_r_alignment
|
||||
ws['B3'] = '空间:'
|
||||
ws['B3'] = 'Space:'
|
||||
ws['C3'].border = b_border
|
||||
ws['C3'].alignment = b_c_alignment
|
||||
ws['C3'].font = name_font
|
||||
|
@ -124,7 +124,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
ws['F3'].font = name_font
|
||||
ws['F3'].alignment = b_r_alignment
|
||||
ws['F3'] = '日期:'
|
||||
ws['F3'] = 'Date:'
|
||||
ws['G3'].border = b_border
|
||||
ws['G3'].alignment = b_c_alignment
|
||||
ws['G3'].font = name_font
|
||||
|
@ -136,13 +136,13 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
ws['B6'].font = name_font
|
||||
ws['B6'].alignment = c_c_alignment
|
||||
ws['B6'].fill = table_fill
|
||||
ws['B6'] = '名称'
|
||||
ws['B6'] = 'Name'
|
||||
|
||||
ws['C6'].border = f_border
|
||||
ws['C6'].alignment = c_c_alignment
|
||||
ws['C6'].font = name_font
|
||||
ws['C6'].fill = table_fill
|
||||
ws['C6'] = '空间'
|
||||
ws['C6'] = 'Space'
|
||||
|
||||
ca_len = len(report['energycategories'])
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -165,7 +165,7 @@ def generate_excel(report,
|
|||
|
||||
if has_energy_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 报告期成本'
|
||||
ws['B6'] = name + ' ' + 'Reporting Period Costs'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
@ -176,12 +176,12 @@ def generate_excel(report,
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '成本'
|
||||
ws['B8'] = 'Cost'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '环比'
|
||||
ws['B9'] = 'Increment Rate'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -209,7 +209,7 @@ def generate_excel(report,
|
|||
ws[end_col + '7'].fill = table_fill
|
||||
ws[end_col + '7'].font = name_font
|
||||
ws[end_col + '7'].alignment = c_c_alignment
|
||||
ws[end_col + '7'] = "总计 (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + '7'] = "Total (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + '7'].border = f_border
|
||||
|
||||
ws[end_col + '8'].font = name_font
|
||||
|
@ -235,7 +235,7 @@ def generate_excel(report,
|
|||
|
||||
if has_ele_peak_flag:
|
||||
ws['B12'].font = title_font
|
||||
ws['B12'] = name + '分时用电成本'
|
||||
ws['B12'] = name + 'Electricity Cost by Time-Of-Use'
|
||||
|
||||
ws['B13'].fill = table_fill
|
||||
ws['B13'].font = name_font
|
||||
|
@ -246,20 +246,20 @@ def generate_excel(report,
|
|||
ws['C13'].font = name_font
|
||||
ws['C13'].alignment = c_c_alignment
|
||||
ws['C13'].border = f_border
|
||||
ws['C13'] = '分时用电成本'
|
||||
ws['C13'] = 'Electricity Cost by Time-Of-Use'
|
||||
|
||||
ws['D13'].fill = table_fill
|
||||
ws['D13'].font = name_font
|
||||
ws['D13'].alignment = c_c_alignment
|
||||
ws['D13'].border = f_border
|
||||
ws['D13'] = '分时用电成本占比'
|
||||
ws['D13'] = 'Electricity Cost Proportion by Time-Of-Use'
|
||||
|
||||
costsum = round(reporting_period_data['toppeaks'][0], 2) + round(reporting_period_data['onpeaks'][0], 2) + \
|
||||
round(reporting_period_data['midpeaks'][0], 2) + round(reporting_period_data['offpeaks'][0], 2)
|
||||
|
||||
ws['B14'].font = title_font
|
||||
ws['B14'].alignment = c_c_alignment
|
||||
ws['B14'] = '尖'
|
||||
ws['B14'] = 'TopPeak'
|
||||
ws['B14'].border = f_border
|
||||
|
||||
ws['C14'].font = title_font
|
||||
|
@ -275,7 +275,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B15'].font = title_font
|
||||
ws['B15'].alignment = c_c_alignment
|
||||
ws['B15'] = '峰'
|
||||
ws['B15'] = 'OnPeak'
|
||||
ws['B15'].border = f_border
|
||||
|
||||
ws['C15'].font = title_font
|
||||
|
@ -291,7 +291,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B16'].font = title_font
|
||||
ws['B16'].alignment = c_c_alignment
|
||||
ws['B16'] = '平'
|
||||
ws['B16'] = 'MidPeak'
|
||||
ws['B16'].border = f_border
|
||||
|
||||
ws['C16'].font = title_font
|
||||
|
@ -307,7 +307,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B17'].font = title_font
|
||||
ws['B17'].alignment = c_c_alignment
|
||||
ws['B17'] = '谷'
|
||||
ws['B17'] = 'OffPeak'
|
||||
ws['B17'].border = f_border
|
||||
|
||||
ws['C17'].font = title_font
|
||||
|
@ -322,7 +322,7 @@ def generate_excel(report,
|
|||
if costsum is not None and costsum != Decimal(0.0) else " "
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + '分时用电成本'
|
||||
pie.title = name + 'Electricity Cost by Time-Of-Use'
|
||||
labels = Reference(ws, min_col=2, min_row=14, max_row=17)
|
||||
pie_data = Reference(ws, min_col=3, min_row=13, max_row=17)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -352,7 +352,7 @@ def generate_excel(report,
|
|||
|
||||
if has_subtotals_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 成本占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Costs Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -367,13 +367,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '成本'
|
||||
ws['C' + str(current_row_number)] = 'Cost'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '成本占比'
|
||||
ws['D' + str(current_row_number)] = 'Costs Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -403,7 +403,7 @@ def generate_excel(report,
|
|||
table_end_row_number = current_row_number - 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 成本占比'
|
||||
pie.title = name + ' ' + 'Costs Proportion'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -445,7 +445,7 @@ def generate_excel(report,
|
|||
ca_len = len(report['reporting_period']['names'])
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
table_start_row_number = (current_row_number + 1) + ca_len * 6 + real_timestamps_len * 7
|
||||
current_row_number = table_start_row_number
|
||||
|
@ -463,7 +463,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'B'
|
||||
|
||||
|
@ -482,7 +482,7 @@ def generate_excel(report,
|
|||
ws[end_col + str(current_row_number)].fill = table_fill
|
||||
ws[end_col + str(current_row_number)].font = title_font
|
||||
ws[end_col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[end_col + str(current_row_number)] = "总计 (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + str(current_row_number)] = "Total (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + str(current_row_number)].border = f_border
|
||||
|
||||
current_row_number += 1
|
||||
|
@ -519,7 +519,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -533,7 +533,7 @@ def generate_excel(report,
|
|||
|
||||
# line
|
||||
line = LineChart()
|
||||
line.title = '报告期成本 - ' + ws.cell(column=3 + i, row=table_start_row_number).value
|
||||
line.title = 'Reporting Period Costs - ' + ws.cell(column=3 + i, row=table_start_row_number).value
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
line.add_data(line_data, titles_from_data=True)
|
||||
|
@ -583,7 +583,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 相关设备数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Associated Equipment Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -592,7 +592,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = name_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '相关设备'
|
||||
ws['B' + str(current_row_number)] = 'Associated Equipment'
|
||||
ca_len = len(associated_equipment['energy_category_names'])
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -609,7 +609,7 @@ def generate_excel(report,
|
|||
ws[end_col + str(current_row_number)].font = name_font
|
||||
ws[end_col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[end_col + str(current_row_number)].border = f_border
|
||||
ws[end_col + str(current_row_number)] = "总计" + " (" + reporting_period_data['units'][i] + ")"
|
||||
ws[end_col + str(current_row_number)] = "Total" + " (" + reporting_period_data['units'][i] + ")"
|
||||
|
||||
associated_equipment_len = len(associated_equipment['associated_equipment_names_array'][0])
|
||||
|
||||
|
@ -722,7 +722,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -778,7 +778,7 @@ def generate_excel(report,
|
|||
########################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -170,7 +170,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期累积效率'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Cumulative Efficiency'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -198,7 +198,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '累积效率'
|
||||
ws['B' + str(current_row_number)] = 'Cumulative Efficiency'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -215,7 +215,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -272,7 +272,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期累积效率'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Cumulative Efficiency'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -286,7 +286,7 @@ def generate_excel(report,
|
|||
current_row_number += 6*real_timestamps_len + 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -297,7 +297,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -334,7 +334,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -370,7 +370,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期累积效率 - ' + \
|
||||
line.title = 'Reporting Period Cumulative Efficiency - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -463,7 +463,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -519,7 +519,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -156,7 +156,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 能耗分析
|
||||
# First: Consumption
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~10 table_data
|
||||
|
@ -173,7 +173,7 @@ def generate_excel(report,
|
|||
|
||||
if has_energy_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name+' 能耗分析'
|
||||
ws['B6'] = name + ' ' + 'Consumption'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
@ -184,12 +184,12 @@ def generate_excel(report,
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '能耗'
|
||||
ws['B8'] = 'Consumption'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '环比'
|
||||
ws['B9'] = 'Increment Rate'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -222,7 +222,7 @@ def generate_excel(report,
|
|||
ws[tce_col + '7'].fill = table_fill
|
||||
ws[tce_col + '7'].font = name_font
|
||||
ws[tce_col + '7'].alignment = c_c_alignment
|
||||
ws[tce_col + '7'] = "吨标准煤 (TCE)"
|
||||
ws[tce_col + '7'] = 'Ton of Standard Coal (TCE)'
|
||||
ws[tce_col + '7'].border = f_border
|
||||
|
||||
ws[tce_col + '8'].font = name_font
|
||||
|
@ -242,7 +242,7 @@ def generate_excel(report,
|
|||
ws[tco2e_col + '7'].fill = table_fill
|
||||
ws[tco2e_col + '7'].font = name_font
|
||||
ws[tco2e_col + '7'].alignment = c_c_alignment
|
||||
ws[tco2e_col + '7'] = "吨二氧化碳排放 (TCO2E)"
|
||||
ws[tco2e_col + '7'] = 'Ton of Carbon Dioxide Emissions (TCO2E)'
|
||||
ws[tco2e_col + '7'].border = f_border
|
||||
|
||||
ws[tco2e_col + '8'].font = name_font
|
||||
|
@ -260,7 +260,7 @@ def generate_excel(report,
|
|||
for i in range(6, 9 + 1):
|
||||
ws.row_dimensions[i].height = 0.1
|
||||
####################################################################################################################
|
||||
# Second: 分时电耗
|
||||
# Second: Electricity Consumption by Time-Of-Use
|
||||
# 12: title
|
||||
# 13: table title
|
||||
# 14~17 table_data
|
||||
|
@ -274,7 +274,7 @@ def generate_excel(report,
|
|||
|
||||
if has_ele_peak_flag:
|
||||
ws['B12'].font = title_font
|
||||
ws['B12'] = name+' 分时电耗'
|
||||
ws['B12'] = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws.row_dimensions[13].height = 60
|
||||
ws['B13'].fill = table_fill
|
||||
|
@ -286,11 +286,11 @@ def generate_excel(report,
|
|||
ws['C13'].font = name_font
|
||||
ws['C13'].alignment = c_c_alignment
|
||||
ws['C13'].border = f_border
|
||||
ws['C13'] = '分时电耗'
|
||||
ws['C13'] = 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws['B14'].font = title_font
|
||||
ws['B14'].alignment = c_c_alignment
|
||||
ws['B14'] = '尖'
|
||||
ws['B14'] = 'TopPeak'
|
||||
ws['B14'].border = f_border
|
||||
|
||||
ws['C14'].font = title_font
|
||||
|
@ -300,7 +300,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B15'].font = title_font
|
||||
ws['B15'].alignment = c_c_alignment
|
||||
ws['B15'] = '峰'
|
||||
ws['B15'] = 'OnPeak'
|
||||
ws['B15'].border = f_border
|
||||
|
||||
ws['C15'].font = title_font
|
||||
|
@ -310,7 +310,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B16'].font = title_font
|
||||
ws['B16'].alignment = c_c_alignment
|
||||
ws['B16'] = '平'
|
||||
ws['B16'] = 'MidPeak'
|
||||
ws['B16'].border = f_border
|
||||
|
||||
ws['C16'].font = title_font
|
||||
|
@ -320,7 +320,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B17'].font = title_font
|
||||
ws['B17'].alignment = c_c_alignment
|
||||
ws['B17'] = '谷'
|
||||
ws['B17'] = 'OffPeak'
|
||||
ws['B17'].border = f_border
|
||||
|
||||
ws['C17'].font = title_font
|
||||
|
@ -329,7 +329,7 @@ def generate_excel(report,
|
|||
ws['C17'] = round(reporting_period_data['offpeaks'][0], 2)
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name+' 分时电耗'
|
||||
pie.title = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
labels = Reference(ws, min_col=2, min_row=14, max_row=17)
|
||||
pie_data = Reference(ws, min_col=3, min_row=13, max_row=17)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -349,7 +349,7 @@ def generate_excel(report,
|
|||
ws.row_dimensions[i].height = 0.1
|
||||
|
||||
####################################################################################################################
|
||||
# Fourth: 能耗详情
|
||||
# Fourth: Detailed Data
|
||||
# current_row_number: title
|
||||
# current_row_number+1 ~ current_row_number+1+ca_len*6-1: line
|
||||
# current_row_number+1+ca_len*6: table title
|
||||
|
@ -370,14 +370,14 @@ def generate_excel(report,
|
|||
|
||||
if has_detail_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name+' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[table_row].height = 60
|
||||
ws['B'+str(table_row)].fill = table_fill
|
||||
ws['B' + str(table_row)].font = title_font
|
||||
ws['B'+str(table_row)].border = f_border
|
||||
ws['B'+str(table_row)].alignment = c_c_alignment
|
||||
ws['B'+str(table_row)] = '日期时间'
|
||||
ws['B'+str(table_row)] = 'Datetime'
|
||||
time = times[0]
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -424,7 +424,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -436,7 +436,7 @@ def generate_excel(report,
|
|||
# line
|
||||
# 39~: line
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + ws.cell(column=3+i, row=table_row).value
|
||||
line.title = 'Reporting Period Consumption - ' + ws.cell(column=3+i, row=table_row).value
|
||||
labels = Reference(ws, min_col=2, min_row=table_row+1, max_row=max_row)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_row, max_row=max_row) # openpyxl bug
|
||||
line.add_data(line_data, titles_from_data=True)
|
||||
|
@ -473,7 +473,7 @@ def generate_excel(report,
|
|||
associated_equipment = report['associated_equipment']
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 相关设备数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Associated Equipment Data'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -483,7 +483,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = name_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '相关设备'
|
||||
ws['B' + str(current_row_number)] = 'Associated Equipment'
|
||||
ca_len = len(associated_equipment['energy_category_names'])
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -598,7 +598,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -653,7 +653,7 @@ def generate_excel(report,
|
|||
########################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -169,7 +169,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期消耗'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Consumption'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -215,7 +215,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -237,8 +237,8 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = \
|
||||
name + ' ' + category_dict_name + ' (' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') 分项消耗占比'
|
||||
name + ' ' + category_dict_name + ' ' + '(' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') by Energy Item'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -271,8 +271,8 @@ def generate_excel(report,
|
|||
|
||||
pie = PieChart()
|
||||
pie.title = \
|
||||
name + ' ' + category_dict_name + ' (' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') 分项消耗占比'
|
||||
name + ' ' + category_dict_name + ' ' + '(' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') by Energy Item'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -312,7 +312,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -326,7 +326,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -363,7 +363,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -399,7 +399,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + \
|
||||
line.title = 'Reporting Period Consumption - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -439,7 +439,7 @@ def generate_excel(report,
|
|||
associated_equipment = report['associated_equipment']
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 相关设备数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Associated Equipment Data'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -449,7 +449,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = name_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '相关设备'
|
||||
ws['B' + str(current_row_number)] = 'Associated Equipment'
|
||||
ca_len = len(associated_equipment['energy_item_names'])
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -563,7 +563,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -619,7 +619,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -169,7 +169,7 @@ def generate_excel(report,
|
|||
|
||||
if has_cost_data_flag:
|
||||
ws['B5'].font = title_font
|
||||
ws['B5'] = name + ' 报告期收入'
|
||||
ws['B5'] = name + ' ' + 'Reporting Period Income'
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
||||
|
@ -179,12 +179,12 @@ def generate_excel(report,
|
|||
|
||||
ws['B7'].font = title_font
|
||||
ws['B7'].alignment = c_c_alignment
|
||||
ws['B7'] = '报告期收入'
|
||||
ws['B7'] = 'Reporting Period Income'
|
||||
ws['B7'].border = f_border
|
||||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '环比'
|
||||
ws['B8'] = 'Increment Rate'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -214,7 +214,7 @@ def generate_excel(report,
|
|||
ws[col + '6'].fill = table_fill
|
||||
ws[col + '6'].font = name_font
|
||||
ws[col + '6'].alignment = c_c_alignment
|
||||
ws[col + '6'] = "总计 (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[col + '6'] = "Total (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[col + '6'].border = f_border
|
||||
|
||||
ws[col + '7'].font = name_font
|
||||
|
@ -241,7 +241,7 @@ def generate_excel(report,
|
|||
|
||||
if has_subtotals_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 收入占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Incomes by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -256,13 +256,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '收入'
|
||||
ws['C' + str(current_row_number)] = 'Incomes'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '收入占比'
|
||||
ws['D' + str(current_row_number)] = 'Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -293,7 +293,7 @@ def generate_excel(report,
|
|||
table_end_row_number = current_row_number - 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 收入占比'
|
||||
pie.title = name + ' ' + 'Incomes by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -330,14 +330,14 @@ def generate_excel(report,
|
|||
|
||||
if has_detail_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[table_row].height = 60
|
||||
ws['B' + str(table_row)].fill = table_fill
|
||||
ws['B' + str(table_row)].font = title_font
|
||||
ws['B' + str(table_row)].border = f_border
|
||||
ws['B' + str(table_row)].alignment = c_c_alignment
|
||||
ws['B' + str(table_row)] = '日期时间'
|
||||
ws['B' + str(table_row)] = 'Datetime'
|
||||
time = times[0]
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -378,7 +378,7 @@ def generate_excel(report,
|
|||
|
||||
line = LineChart()
|
||||
line.title = \
|
||||
'报告期收入 - ' + reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
'Reporting Period Income - ' + reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_row + 1, max_row=max_row)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_row, max_row=max_row)
|
||||
line.add_data(line_data, titles_from_data=True)
|
||||
|
@ -402,7 +402,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + row].font = title_font
|
||||
ws['B' + row].alignment = c_c_alignment
|
||||
ws['B' + row] = '小计'
|
||||
ws['B' + row] = 'Subtotal'
|
||||
ws['B' + row].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -420,7 +420,7 @@ def generate_excel(report,
|
|||
ws[col + str(table_row)].fill = table_fill
|
||||
ws[col + str(table_row)].font = title_font
|
||||
ws[col + str(table_row)].alignment = c_c_alignment
|
||||
ws[col + str(table_row)] = '总计 (' + report['reporting_period']['total_unit'] + ')'
|
||||
ws[col + str(table_row)] = 'Total (' + report['reporting_period']['total_unit'] + ')'
|
||||
ws[col + str(table_row)].border = f_border
|
||||
|
||||
total_sum = 0
|
||||
|
@ -463,7 +463,7 @@ def generate_excel(report,
|
|||
associated_equipment = report['associated_equipment']
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 相关设备数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Associated Equipment Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -472,7 +472,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = name_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '相关设备'
|
||||
ws['B' + str(current_row_number)] = 'Associated Equipment'
|
||||
ca_len = len(associated_equipment['energy_category_names'])
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -489,7 +489,7 @@ def generate_excel(report,
|
|||
ws[col_subtotal + str(current_row_number)].font = name_font
|
||||
ws[col_subtotal + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col_subtotal + str(current_row_number)].border = f_border
|
||||
ws[col_subtotal + str(current_row_number)] = '总计 (' + report['reporting_period']['total_unit'] + ')'
|
||||
ws[col_subtotal + str(current_row_number)] = 'Total (' + report['reporting_period']['total_unit'] + ')'
|
||||
|
||||
associated_equipment_len = len(associated_equipment['associated_equipment_names_array'][0])
|
||||
|
||||
|
@ -602,7 +602,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -658,7 +658,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -152,7 +152,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 负荷分析
|
||||
# First: Load
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~2*ca_len table_data
|
||||
|
@ -168,7 +168,7 @@ def generate_excel(report,
|
|||
return filename
|
||||
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 负荷分析'
|
||||
ws['B6'] = name + ' ' + 'Load'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -176,22 +176,22 @@ def generate_excel(report,
|
|||
ws['B7'].fill = table_fill
|
||||
ws['B7'].font = title_font
|
||||
ws['B7'].alignment = c_c_alignment
|
||||
ws['B7'] = '报告期'
|
||||
ws['B7'] = 'Reporting Period'
|
||||
ws['B7'].border = f_border
|
||||
|
||||
ws['C7'].font = title_font
|
||||
ws['C7'].alignment = c_c_alignment
|
||||
ws['C7'] = '平均负荷'
|
||||
ws['C7'] = 'Average Load'
|
||||
ws['C7'].border = f_border
|
||||
|
||||
ws['D7'].font = title_font
|
||||
ws['D7'].alignment = c_c_alignment
|
||||
ws['D7'] = '最大负荷'
|
||||
ws['D7'] = 'Maximum Load'
|
||||
ws['D7'].border = f_border
|
||||
|
||||
ws['E7'].font = title_font
|
||||
ws['E7'].alignment = c_c_alignment
|
||||
ws['E7'] = '负荷系数'
|
||||
ws['E7'] = 'Load Factor'
|
||||
ws['E7'].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -205,7 +205,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(row + 1)].font = name_font
|
||||
ws['B' + str(row + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(row + 1)] = "环比"
|
||||
ws['B' + str(row + 1)] = 'Increment Rate'
|
||||
ws['B' + str(row + 1)].border = f_border
|
||||
|
||||
ws['C' + str(row)].font = name_font
|
||||
|
@ -248,7 +248,7 @@ def generate_excel(report,
|
|||
ws['E' + str(row + 1)].border = f_border
|
||||
|
||||
####################################################################################################################
|
||||
# Third: 详细数据
|
||||
# Third: Detailed Data
|
||||
# analysis_end_row_number~ analysis_end_row_number + 6*cal_len: line
|
||||
# detailed_start_row_number: table title
|
||||
# detailed_start_row_number + 1~: table_data
|
||||
|
@ -270,12 +270,12 @@ def generate_excel(report,
|
|||
detailed_start_row_number = analysis_end_row_number + line_charts_row_number + 1 + real_timestamps_len * 7
|
||||
|
||||
ws['B' + str(detailed_start_row_number)].font = title_font
|
||||
ws['B' + str(detailed_start_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(detailed_start_row_number)] = name + ' ' + 'Detailed Data'
|
||||
# table_title
|
||||
ws['B' + str(detailed_start_row_number + 1)].fill = table_fill
|
||||
ws['B' + str(detailed_start_row_number + 1)].font = name_font
|
||||
ws['B' + str(detailed_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(detailed_start_row_number + 1)] = "日期时间"
|
||||
ws['B' + str(detailed_start_row_number + 1)] = "Datetime"
|
||||
ws['B' + str(detailed_start_row_number + 1)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -285,13 +285,13 @@ def generate_excel(report,
|
|||
ws[col_average + str(detailed_start_row_number + 1)].font = name_font
|
||||
ws[col_average + str(detailed_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws[col_average + str(detailed_start_row_number + 1)] = \
|
||||
names[i] + " 平均负荷(" + reporting_period_data['units'][i] + "/H)"
|
||||
names[i] + " Average Load(" + reporting_period_data['units'][i] + "/H)"
|
||||
ws[col_average + str(detailed_start_row_number + 1)].border = f_border
|
||||
|
||||
ws[col_maximum + str(detailed_start_row_number + 1)].font = name_font
|
||||
ws[col_maximum + str(detailed_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws[col_maximum + str(detailed_start_row_number + 1)] = \
|
||||
names[i] + " 最大负荷(" + reporting_period_data['units'][i] + "/H)"
|
||||
names[i] + " Maximum Load(" + reporting_period_data['units'][i] + "/H)"
|
||||
ws[col_maximum + str(detailed_start_row_number + 1)].border = f_border
|
||||
# table_date
|
||||
for i in range(0, time_len):
|
||||
|
@ -327,7 +327,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = "报告期 最大负荷 - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.title = "Reporting Period Maximum Load - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.style = 10
|
||||
line.x_axis.majorTickMark = 'in'
|
||||
line.y_axis.majorTickMark = 'in'
|
||||
|
@ -370,7 +370,7 @@ def generate_excel(report,
|
|||
associated_equipment = report['associated_equipment']
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 相关设备数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Associated Equipment Data'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -380,7 +380,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = name_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '相关设备'
|
||||
ws['B' + str(current_row_number)] = 'Associated Equipment'
|
||||
ca_len = len(associated_equipment['energy_category_names'])
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -389,13 +389,13 @@ def generate_excel(report,
|
|||
|
||||
ws[col_average + str(current_row_number)].font = name_font
|
||||
ws[col_average + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col_average + str(current_row_number)] = names[i] + " 平均负荷(" + \
|
||||
ws[col_average + str(current_row_number)] = names[i] + " Average Load(" + \
|
||||
reporting_period_data['units'][i] + "/H)"
|
||||
ws[col_average + str(current_row_number)].border = f_border
|
||||
|
||||
ws[col_maximum + str(current_row_number)].font = name_font
|
||||
ws[col_maximum + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col_maximum + str(current_row_number)] = names[i] + " 最大负荷(" + \
|
||||
ws[col_maximum + str(current_row_number)] = names[i] + " Maximum Load(" + \
|
||||
reporting_period_data['units'][i] + "/H)"
|
||||
ws[col_maximum + str(current_row_number)].border = f_border
|
||||
|
||||
|
@ -514,7 +514,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -570,7 +570,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -169,7 +169,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期产出'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Output'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -197,7 +197,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '产出'
|
||||
ws['B' + str(current_row_number)] = 'Output'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -214,7 +214,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -251,7 +251,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -265,7 +265,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -302,7 +302,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -338,7 +338,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期产出 - ' + \
|
||||
line.title = 'Reporting Period Output - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -379,7 +379,7 @@ def generate_excel(report,
|
|||
associated_equipment = report['associated_equipment']
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 相关设备数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Associated Equipment Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -388,7 +388,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = name_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '相关设备'
|
||||
ws['B' + str(current_row_number)] = 'Associated Equipment'
|
||||
ca_len = len(associated_equipment['energy_category_names'])
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -502,7 +502,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -558,7 +558,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -171,7 +171,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期节约'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Savings'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -190,7 +190,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = \
|
||||
reporting_period_data['names'][i] + " (基线-实际) (" + reporting_period_data['units'][i] + ")"
|
||||
reporting_period_data['names'][i] + ' ' + '(Baseline - Actual)(' + reporting_period_data['units'][i] + ")"
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -198,7 +198,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '吨标准煤 (基线-实际) (TCE)'
|
||||
ws[col + str(current_row_number)] = 'Ton of Standard Coal(Baseline - Actual)(TCE)'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -206,7 +206,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '吨二氧化碳排放 (基线-实际) (TCO2E)'
|
||||
ws[col + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions(Baseline - Actual)(TCO2E)'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -215,7 +215,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '节约'
|
||||
ws['B' + str(current_row_number)] = 'Savings'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -246,7 +246,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -281,7 +281,7 @@ def generate_excel(report,
|
|||
current_row_number += 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨标准煤(TCE)占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -295,13 +295,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '节约'
|
||||
ws['C' + str(current_row_number)] = 'Savings'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '吨标准煤(TCE) 节约占比'
|
||||
ws['D' + str(current_row_number)] = 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -335,7 +335,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 吨标准煤(TCE)占比'
|
||||
pie.title = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -350,7 +350,7 @@ def generate_excel(report,
|
|||
ws.add_chart(pie, 'E' + str(chart_start_row_number))
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨二氧化碳排放(TCO2E)占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -364,13 +364,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '节约'
|
||||
ws['C' + str(current_row_number)] = 'Savings'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '吨二氧化碳排放(TCO2E) 节约占比'
|
||||
ws['D' + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -404,7 +404,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 吨二氧化碳排放(TCO2E)占比'
|
||||
pie.title = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -439,7 +439,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -453,7 +453,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -490,7 +490,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -526,7 +526,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期节约 - ' + \
|
||||
line.title = 'Reporting Period Savings - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -566,7 +566,7 @@ def generate_excel(report,
|
|||
associated_equipment = report['associated_equipment']
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 相关设备数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Associated Equipment Data'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -576,7 +576,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = name_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '相关设备'
|
||||
ws['B' + str(current_row_number)] = 'Associated Equipment'
|
||||
ca_len = len(associated_equipment['energy_category_names'])
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -692,7 +692,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -748,7 +748,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -153,7 +153,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 统计分析
|
||||
# First: Statistics
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~ca_len table_data
|
||||
|
@ -168,7 +168,7 @@ def generate_excel(report,
|
|||
return filename
|
||||
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 统计分析'
|
||||
ws['B6'] = name + ' ' + 'Statistics'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -176,37 +176,37 @@ def generate_excel(report,
|
|||
ws['B7'].fill = table_fill
|
||||
ws['B7'].font = title_font
|
||||
ws['B7'].alignment = c_c_alignment
|
||||
ws['B7'] = '报告期'
|
||||
ws['B7'] = 'Reporting Period'
|
||||
ws['B7'].border = f_border
|
||||
|
||||
ws['C7'].font = title_font
|
||||
ws['C7'].alignment = c_c_alignment
|
||||
ws['C7'] = '算术平均数'
|
||||
ws['C7'] = 'Arithmetic Mean'
|
||||
ws['C7'].border = f_border
|
||||
|
||||
ws['D7'].font = title_font
|
||||
ws['D7'].alignment = c_c_alignment
|
||||
ws['D7'] = '中位数'
|
||||
ws['D7'] = 'Median (Middle Value)'
|
||||
ws['D7'].border = f_border
|
||||
|
||||
ws['E7'].font = title_font
|
||||
ws['E7'].alignment = c_c_alignment
|
||||
ws['E7'] = '最小值'
|
||||
ws['E7'] = 'Minimum Value'
|
||||
ws['E7'].border = f_border
|
||||
|
||||
ws['F7'].font = title_font
|
||||
ws['F7'].alignment = c_c_alignment
|
||||
ws['F7'] = '最大值'
|
||||
ws['F7'] = 'Maximum Value'
|
||||
ws['F7'].border = f_border
|
||||
|
||||
ws['G7'].font = title_font
|
||||
ws['G7'].alignment = c_c_alignment
|
||||
ws['G7'] = '样本标准差'
|
||||
ws['G7'] = 'Sample Standard Deviation'
|
||||
ws['G7'].border = f_border
|
||||
|
||||
ws['H7'].font = title_font
|
||||
ws['H7'].alignment = c_c_alignment
|
||||
ws['H7'] = '样本方差'
|
||||
ws['H7'] = 'Sample Variance'
|
||||
ws['H7'].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -220,7 +220,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(row + 1)].font = name_font
|
||||
ws['B' + str(row + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(row + 1)] = "环比"
|
||||
ws['B' + str(row + 1)] = 'Increment Rate'
|
||||
ws['B' + str(row + 1)].border = f_border
|
||||
|
||||
ws['C' + str(row)].font = name_font
|
||||
|
@ -302,7 +302,7 @@ def generate_excel(report,
|
|||
ws['H' + str(row + 1)].border = f_border
|
||||
|
||||
####################################################################################################################
|
||||
# Second: 详细数据
|
||||
# Second: Detailed Data
|
||||
# analysis_end_row_number+1~ analysis_end_row_number+1+line_charts_row_number+: line
|
||||
# detailed_start_row_number~ : the detailed data table
|
||||
####################################################################################################################
|
||||
|
@ -325,12 +325,12 @@ def generate_excel(report,
|
|||
detailed_start_row_number = analysis_end_row_number + line_charts_row_number + real_timestamps_len * 7
|
||||
|
||||
ws['B' + str(detailed_start_row_number)].font = title_font
|
||||
ws['B' + str(detailed_start_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(detailed_start_row_number)] = name + ' ' + 'Detailed Data'
|
||||
# the detailed table_title
|
||||
ws['B' + str(detailed_start_row_number + 1)].fill = table_fill
|
||||
ws['B' + str(detailed_start_row_number + 1)].font = name_font
|
||||
ws['B' + str(detailed_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(detailed_start_row_number + 1)] = "时间"
|
||||
ws['B' + str(detailed_start_row_number + 1)] = 'Datetime'
|
||||
ws['B' + str(detailed_start_row_number + 1)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -358,11 +358,11 @@ def generate_excel(report,
|
|||
ws[col + str(rows)].number_format = '0.00'
|
||||
ws[col + str(rows)].border = f_border
|
||||
|
||||
# 小计
|
||||
# Subtotal
|
||||
row_subtotals = detailed_start_row_number + 2 + time_len
|
||||
ws['B' + str(row_subtotals)].font = name_font
|
||||
ws['B' + str(row_subtotals)].alignment = c_c_alignment
|
||||
ws['B' + str(row_subtotals)] = "小计"
|
||||
ws['B' + str(row_subtotals)] = 'Subtotal'
|
||||
ws['B' + str(row_subtotals)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -381,9 +381,10 @@ def generate_excel(report,
|
|||
####################################################################################################################
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = "报告期消耗" + " - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.title = "Reporting Period Consumption" + " - " + names[i] + \
|
||||
"(" + reporting_period_data['units'][i] + ")"
|
||||
line.style = 10
|
||||
line.height = 8.40 # cm 1.05*8 1.05cm = 30 pt
|
||||
line.height = 8.40
|
||||
line.width = 24
|
||||
line.x_axis.majorTickMark = 'in'
|
||||
line.y_axis.majorTickMark = 'in'
|
||||
|
@ -420,7 +421,7 @@ def generate_excel(report,
|
|||
current_row_number = detailed_start_row_number + 4 + time_len
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 相关设备数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Associated Equipment Data'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -430,7 +431,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = name_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '相关设备'
|
||||
ws['B' + str(current_row_number)] = 'Associated Equipment'
|
||||
ca_len = len(associated_equipment['energy_category_names'])
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -544,7 +545,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -600,7 +601,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
data_font = Font(name='Franklin Gothic Book', size=11)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
|
@ -116,7 +116,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
ws['B3'].font = name_font
|
||||
ws['B3'].alignment = b_r_alignment
|
||||
ws['B3'] = '空间:'
|
||||
ws['B3'] = 'Space:'
|
||||
ws['C3'].border = b_border
|
||||
ws['C3'].alignment = b_c_alignment
|
||||
ws['C3'].font = name_font
|
||||
|
@ -124,7 +124,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
ws['F3'].font = name_font
|
||||
ws['F3'].alignment = b_r_alignment
|
||||
ws['F3'] = '日期:'
|
||||
ws['F3'] = 'Datetime:'
|
||||
ws['G3'].border = b_border
|
||||
ws['G3'].alignment = b_c_alignment
|
||||
ws['G3'].font = name_font
|
||||
|
@ -136,13 +136,13 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
ws['B6'].font = name_font
|
||||
ws['B6'].alignment = c_c_alignment
|
||||
ws['B6'].fill = table_fill
|
||||
ws['B6'] = '名称'
|
||||
ws['B6'] = 'Name'
|
||||
|
||||
ws['C6'].border = f_border
|
||||
ws['C6'].alignment = c_c_alignment
|
||||
ws['C6'].font = name_font
|
||||
ws['C6'].fill = table_fill
|
||||
ws['C6'] = '空间'
|
||||
ws['C6'] = 'Space'
|
||||
|
||||
ca_len = len(report['energycategories'])
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -155,7 +155,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 报告期成本分析
|
||||
# First: Reporting Period Costs
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~10 table_data
|
||||
|
@ -172,7 +172,7 @@ def generate_excel(report,
|
|||
|
||||
if has_energy_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name+' 报告期成本分析'
|
||||
ws['B6'] = name + ' ' + 'Reporting Period Costs'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
@ -183,12 +183,12 @@ def generate_excel(report,
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '成本'
|
||||
ws['B8'] = 'Cost'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '环比'
|
||||
ws['B9'] = 'Increment Rate'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -219,7 +219,7 @@ def generate_excel(report,
|
|||
ws[col + '7'].fill = table_fill
|
||||
ws[col + '7'].font = name_font
|
||||
ws[col + '7'].alignment = c_c_alignment
|
||||
ws[col + '7'] = "总计 (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[col + '7'] = "Total (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[col + '7'].border = f_border
|
||||
|
||||
ws[col + '8'].font = name_font
|
||||
|
@ -237,7 +237,7 @@ def generate_excel(report,
|
|||
for i in range(6, 8 + 1):
|
||||
ws.row_dimensions[i].height = 0.1
|
||||
####################################################################################################################
|
||||
# Second: 分时用电成本
|
||||
# Second: Electricity Cost by Time-Of-Use
|
||||
# 12: title
|
||||
# 13: table title
|
||||
# 14~17 table_data
|
||||
|
@ -251,7 +251,7 @@ def generate_excel(report,
|
|||
|
||||
if has_ele_peak_flag:
|
||||
ws['B12'].font = title_font
|
||||
ws['B12'] = name+' 分时用电成本'
|
||||
ws['B12'] = name + ' ' + 'Electricity Cost by Time-Of-Use'
|
||||
|
||||
ws.row_dimensions[13].height = 60
|
||||
ws['B13'].fill = table_fill
|
||||
|
@ -263,11 +263,11 @@ def generate_excel(report,
|
|||
ws['C13'].font = name_font
|
||||
ws['C13'].alignment = c_c_alignment
|
||||
ws['C13'].border = f_border
|
||||
ws['C13'] = '分时用电成本'
|
||||
ws['C13'] = 'Electricity Cost by Time-Of-Use'
|
||||
|
||||
ws['B14'].font = title_font
|
||||
ws['B14'].alignment = c_c_alignment
|
||||
ws['B14'] = '尖'
|
||||
ws['B14'] = 'TopPeak'
|
||||
ws['B14'].border = f_border
|
||||
|
||||
ws['C14'].font = title_font
|
||||
|
@ -277,7 +277,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B15'].font = title_font
|
||||
ws['B15'].alignment = c_c_alignment
|
||||
ws['B15'] = '峰'
|
||||
ws['B15'] = 'OnPeak'
|
||||
ws['B15'].border = f_border
|
||||
|
||||
ws['C15'].font = title_font
|
||||
|
@ -287,7 +287,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B16'].font = title_font
|
||||
ws['B16'].alignment = c_c_alignment
|
||||
ws['B16'] = '平'
|
||||
ws['B16'] = 'MidPeak'
|
||||
ws['B16'].border = f_border
|
||||
|
||||
ws['C16'].font = title_font
|
||||
|
@ -297,7 +297,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B17'].font = title_font
|
||||
ws['B17'].alignment = c_c_alignment
|
||||
ws['B17'] = '谷'
|
||||
ws['B17'] = 'OffPeak'
|
||||
ws['B17'].border = f_border
|
||||
|
||||
ws['C17'].font = title_font
|
||||
|
@ -306,7 +306,7 @@ def generate_excel(report,
|
|||
ws['C17'] = round(reporting_period_data['offpeaks'][0], 2)
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name+' 分时用电成本'
|
||||
pie.title = name + ' ' + 'Electricity Cost by Time-Of-Use'
|
||||
labels = Reference(ws, min_col=2, min_row=14, max_row=17)
|
||||
pie_data = Reference(ws, min_col=3, min_row=13, max_row=17)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -327,7 +327,7 @@ def generate_excel(report,
|
|||
# end_row 10
|
||||
# start_row 12
|
||||
####################################################################################################################
|
||||
# Second: 成本占比
|
||||
# Second: Costs Proportion by Energy Category
|
||||
####################################################################################################################
|
||||
current_row_number = 19
|
||||
|
||||
|
@ -339,7 +339,7 @@ def generate_excel(report,
|
|||
|
||||
if has_subtotals_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 成本占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Costs Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -353,7 +353,7 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '成本占比'
|
||||
ws['C' + str(current_row_number)] = 'Costs Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -377,7 +377,7 @@ def generate_excel(report,
|
|||
table_end_row_number = current_row_number - 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 成本占比'
|
||||
pie.title = name + ' ' + 'Costs Proportion'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -398,7 +398,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
####################################################################################################################
|
||||
# Fourth: 成本详情
|
||||
# Fourth: Detailed Data
|
||||
# current_row_number: title
|
||||
# current_row_number+1 ~ current_row_number+1+ca_len*6-1: line
|
||||
# current_row_number+1+ca_len*6: table title
|
||||
|
@ -418,14 +418,14 @@ def generate_excel(report,
|
|||
|
||||
if has_detail_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name+' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[table_row].height = 60
|
||||
ws['B'+str(table_row)].fill = table_fill
|
||||
ws['B' + str(table_row)].font = title_font
|
||||
ws['B'+str(table_row)].border = f_border
|
||||
ws['B'+str(table_row)].alignment = c_c_alignment
|
||||
ws['B'+str(table_row)] = '日期时间'
|
||||
ws['B'+str(table_row)] = 'Datetime'
|
||||
time = times[0]
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -471,7 +471,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -483,7 +483,7 @@ def generate_excel(report,
|
|||
# line
|
||||
# 39~: line
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + ws.cell(column=3+i, row=table_row).value
|
||||
line.title = 'Reporting Period Consumption - ' + ws.cell(column=3+i, row=table_row).value
|
||||
labels = Reference(ws, min_col=2, min_row=table_row+1, max_row=max_row)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_row, max_row=max_row) # openpyxl bug
|
||||
line.add_data(line_data, titles_from_data=True)
|
||||
|
@ -587,7 +587,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -643,7 +643,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -168,7 +168,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期累积效率'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Cumulative Efficiency'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -196,7 +196,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '累积效率'
|
||||
ws['B' + str(current_row_number)] = 'Cumulative Efficiency'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -213,7 +213,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -270,7 +270,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期累积效率'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Cumulative Efficiency'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -284,7 +284,7 @@ def generate_excel(report,
|
|||
current_row_number += 6*real_timestamps_len + 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -295,7 +295,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -332,7 +332,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -368,7 +368,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期累积效率 - ' + \
|
||||
line.title = 'Reporting Period Cumulative Efficiency - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -461,7 +461,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -517,7 +517,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -155,7 +155,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 能耗分析
|
||||
# First: Consumption
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~10 table_data
|
||||
|
@ -172,7 +172,7 @@ def generate_excel(report,
|
|||
|
||||
if has_energy_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name+' 能耗分析'
|
||||
ws['B6'] = name + ' ' + 'Consumption'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
@ -183,12 +183,12 @@ def generate_excel(report,
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '能耗'
|
||||
ws['B8'] = 'Consumption'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '环比'
|
||||
ws['B9'] = 'Increment Rate'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -221,7 +221,7 @@ def generate_excel(report,
|
|||
ws[tce_col + '7'].fill = table_fill
|
||||
ws[tce_col + '7'].font = name_font
|
||||
ws[tce_col + '7'].alignment = c_c_alignment
|
||||
ws[tce_col + '7'] = "吨标准煤 (TCE)"
|
||||
ws[tce_col + '7'] = 'Ton of Standard Coal (TCE)'
|
||||
ws[tce_col + '7'].border = f_border
|
||||
|
||||
ws[tce_col + '8'].font = name_font
|
||||
|
@ -240,7 +240,7 @@ def generate_excel(report,
|
|||
ws[tco2e_col + '7'].fill = table_fill
|
||||
ws[tco2e_col + '7'].font = name_font
|
||||
ws[tco2e_col + '7'].alignment = c_c_alignment
|
||||
ws[tco2e_col + '7'] = "吨二氧化碳排放 (TCO2E)"
|
||||
ws[tco2e_col + '7'] = 'Ton of Carbon Dioxide Emissions (TCO2E)'
|
||||
ws[tco2e_col + '7'].border = f_border
|
||||
|
||||
ws[tco2e_col + '8'].font = name_font
|
||||
|
@ -257,7 +257,7 @@ def generate_excel(report,
|
|||
for i in range(6, 9 + 1):
|
||||
ws.row_dimensions[i].height = 0.1
|
||||
####################################################################################################################
|
||||
# Second: 分时电耗
|
||||
# Second: Electricity Consumption by Time-Of-Use
|
||||
# 12: title
|
||||
# 13: table title
|
||||
# 14~17 table_data
|
||||
|
@ -271,7 +271,7 @@ def generate_excel(report,
|
|||
|
||||
if has_ele_peak_flag:
|
||||
ws['B12'].font = title_font
|
||||
ws['B12'] = name+' 分时电耗'
|
||||
ws['B12'] = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws.row_dimensions[13].height = 60
|
||||
ws['B13'].fill = table_fill
|
||||
|
@ -283,11 +283,11 @@ def generate_excel(report,
|
|||
ws['C13'].font = name_font
|
||||
ws['C13'].alignment = c_c_alignment
|
||||
ws['C13'].border = f_border
|
||||
ws['C13'] = '分时电耗'
|
||||
ws['C13'] = 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws['B14'].font = title_font
|
||||
ws['B14'].alignment = c_c_alignment
|
||||
ws['B14'] = '尖'
|
||||
ws['B14'] = 'TopPeak'
|
||||
ws['B14'].border = f_border
|
||||
|
||||
ws['C14'].font = title_font
|
||||
|
@ -297,7 +297,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B15'].font = title_font
|
||||
ws['B15'].alignment = c_c_alignment
|
||||
ws['B15'] = '峰'
|
||||
ws['B15'] = 'OnPeak'
|
||||
ws['B15'].border = f_border
|
||||
|
||||
ws['C15'].font = title_font
|
||||
|
@ -307,7 +307,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B16'].font = title_font
|
||||
ws['B16'].alignment = c_c_alignment
|
||||
ws['B16'] = '平'
|
||||
ws['B16'] = 'MidPeak'
|
||||
ws['B16'].border = f_border
|
||||
|
||||
ws['C16'].font = title_font
|
||||
|
@ -317,7 +317,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B17'].font = title_font
|
||||
ws['B17'].alignment = c_c_alignment
|
||||
ws['B17'] = '谷'
|
||||
ws['B17'] = 'OffPeak'
|
||||
ws['B17'].border = f_border
|
||||
|
||||
ws['C17'].font = title_font
|
||||
|
@ -326,7 +326,7 @@ def generate_excel(report,
|
|||
ws['C17'] = round(reporting_period_data['offpeaks'][0], 2)
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name+' 分时电耗'
|
||||
pie.title = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
labels = Reference(ws, min_col=2, min_row=14, max_row=17)
|
||||
pie_data = Reference(ws, min_col=3, min_row=13, max_row=17)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -347,7 +347,7 @@ def generate_excel(report,
|
|||
# end_row 10
|
||||
# start_row 12
|
||||
####################################################################################################################
|
||||
# Third: 子空间能耗
|
||||
# Third: Child Spaces Data
|
||||
# 19: title
|
||||
# 20: table title
|
||||
# 21~24 table_data
|
||||
|
@ -372,7 +372,7 @@ def generate_excel(report,
|
|||
child_subtotals = child['subtotals_array'][0]
|
||||
|
||||
ws['B19'].font = title_font
|
||||
ws['B19'] = name+' 子空间能耗'
|
||||
ws['B19'] = name + ' ' + 'Child Spaces Data'
|
||||
|
||||
ws.row_dimensions[20].height = 60
|
||||
ws['B20'].fill = table_fill
|
||||
|
@ -387,7 +387,7 @@ def generate_excel(report,
|
|||
ws[row + '20'].font = title_font
|
||||
ws[row + '20'].alignment = c_c_alignment
|
||||
ws[row + '20'].border = f_border
|
||||
ws[row + '20'] = child['energy_category_names'][i] + ' (' + child['units'][i] + ')'
|
||||
ws[row + '20'] = child['energy_category_names'][i] + ' ' + '(' + child['units'][i] + ')'
|
||||
|
||||
space_len = len(child['child_space_names_array'][0])
|
||||
|
||||
|
@ -440,7 +440,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
####################################################################################################################
|
||||
# Fourth: 能耗详情
|
||||
# Fourth: Detailed Data
|
||||
# current_row_number: title
|
||||
# current_row_number+1 ~ current_row_number+1+ca_len*6-1: line
|
||||
# current_row_number+1+ca_len*6: table title
|
||||
|
@ -460,14 +460,14 @@ def generate_excel(report,
|
|||
|
||||
if has_detail_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name+' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[table_row].height = 60
|
||||
ws['B'+str(table_row)].fill = table_fill
|
||||
ws['B' + str(table_row)].font = title_font
|
||||
ws['B'+str(table_row)].border = f_border
|
||||
ws['B'+str(table_row)].alignment = c_c_alignment
|
||||
ws['B'+str(table_row)] = '日期时间'
|
||||
ws['B'+str(table_row)] = 'Datetime'
|
||||
time = times[0]
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -513,7 +513,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -525,7 +525,7 @@ def generate_excel(report,
|
|||
# line
|
||||
# 39~: line
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + ws.cell(column=3+i, row=table_row).value
|
||||
line.title = 'Reporting Period Consumption - ' + ws.cell(column=3+i, row=table_row).value
|
||||
labels = Reference(ws, min_col=2, min_row=table_row+1, max_row=max_row)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_row, max_row=max_row) # openpyxl bug
|
||||
line.add_data(line_data, titles_from_data=True)
|
||||
|
@ -629,7 +629,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -685,7 +685,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -167,7 +167,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期消耗'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Consumption'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -213,7 +213,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -235,8 +235,8 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = \
|
||||
name + ' ' + category_dict_name + ' (' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') 分项消耗占比'
|
||||
name + ' ' + category_dict_name + ' ' + '(' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') by Energy Item'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -269,8 +269,8 @@ def generate_excel(report,
|
|||
|
||||
pie = PieChart()
|
||||
pie.title = \
|
||||
name + ' ' + category_dict_name + ' (' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') 分项消耗占比'
|
||||
name + ' ' + category_dict_name + ' ' + '(' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') by Energy Item'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -310,7 +310,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -324,7 +324,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -361,7 +361,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -397,7 +397,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + \
|
||||
line.title = 'Reporting Period Consumption - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -504,7 +504,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -560,7 +560,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -166,7 +166,7 @@ def generate_excel(report,
|
|||
|
||||
if has_cost_data_flag:
|
||||
ws['B5'].font = title_font
|
||||
ws['B5'] = name + ' 报告期收入'
|
||||
ws['B5'] = name + ' ' + 'Reporting Period Income'
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
||||
|
@ -176,12 +176,12 @@ def generate_excel(report,
|
|||
|
||||
ws['B7'].font = title_font
|
||||
ws['B7'].alignment = c_c_alignment
|
||||
ws['B7'] = '报告期收入'
|
||||
ws['B7'] = 'Reporting Period Income'
|
||||
ws['B7'].border = f_border
|
||||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '环比'
|
||||
ws['B8'] = 'Increment Rate'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -211,7 +211,7 @@ def generate_excel(report,
|
|||
ws[col + '6'].fill = table_fill
|
||||
ws[col + '6'].font = name_font
|
||||
ws[col + '6'].alignment = c_c_alignment
|
||||
ws[col + '6'] = "总计 (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[col + '6'] = "Total (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[col + '6'].border = f_border
|
||||
|
||||
ws[col + '7'].font = name_font
|
||||
|
@ -238,7 +238,7 @@ def generate_excel(report,
|
|||
|
||||
if has_subtotals_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 收入占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Incomes by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -253,13 +253,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '收入'
|
||||
ws['C' + str(current_row_number)] = 'Incomes'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '收入占比'
|
||||
ws['D' + str(current_row_number)] = 'Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -291,7 +291,7 @@ def generate_excel(report,
|
|||
table_end_row_number = current_row_number - 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 收入占比'
|
||||
pie.title = name + ' ' + 'Incomes by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -328,14 +328,14 @@ def generate_excel(report,
|
|||
|
||||
if has_detail_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[table_row].height = 60
|
||||
ws['B' + str(table_row)].fill = table_fill
|
||||
ws['B' + str(table_row)].font = title_font
|
||||
ws['B' + str(table_row)].border = f_border
|
||||
ws['B' + str(table_row)].alignment = c_c_alignment
|
||||
ws['B' + str(table_row)] = '日期时间'
|
||||
ws['B' + str(table_row)] = 'Datetime'
|
||||
time = times[0]
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -376,7 +376,7 @@ def generate_excel(report,
|
|||
|
||||
line = LineChart()
|
||||
line.title = \
|
||||
'报告期收入 - ' + reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
'Reporting Period Income - ' + reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_row + 1, max_row=max_row)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_row, max_row=max_row)
|
||||
line.add_data(line_data, titles_from_data=True)
|
||||
|
@ -399,7 +399,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + row].font = title_font
|
||||
ws['B' + row].alignment = c_c_alignment
|
||||
ws['B' + row] = '小计'
|
||||
ws['B' + row] = 'Subtotal'
|
||||
ws['B' + row].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -417,7 +417,7 @@ def generate_excel(report,
|
|||
ws[col + str(table_row)].fill = table_fill
|
||||
ws[col + str(table_row)].font = title_font
|
||||
ws[col + str(table_row)].alignment = c_c_alignment
|
||||
ws[col + str(table_row)] = '总计 (' + report['reporting_period']['total_unit'] + ')'
|
||||
ws[col + str(table_row)] = 'Total (' + report['reporting_period']['total_unit'] + ')'
|
||||
ws[col + str(table_row)].border = f_border
|
||||
|
||||
total_sum = 0
|
||||
|
@ -525,7 +525,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -581,7 +581,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
@ -632,7 +632,7 @@ def generate_excel(report,
|
|||
|
||||
|
||||
def reporting_period_values_periodic_sum(reporting_period_data, periodic_index, ca_len):
|
||||
periodic_sum = 0.0
|
||||
periodic_sum = Decimal(0.0)
|
||||
for i in range(0, ca_len):
|
||||
periodic_sum += reporting_period_data['values'][i][periodic_index]
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -150,7 +150,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 统计分析
|
||||
# First: Statistics
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~2*ca_len table_data
|
||||
|
@ -165,7 +165,7 @@ def generate_excel(report,
|
|||
return filename
|
||||
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 统计分析'
|
||||
ws['B6'] = name + ' ' + 'Statistics'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -173,22 +173,22 @@ def generate_excel(report,
|
|||
ws['B7'].fill = table_fill
|
||||
ws['B7'].font = title_font
|
||||
ws['B7'].alignment = c_c_alignment
|
||||
ws['B7'] = '报告期'
|
||||
ws['B7'] = 'Reporting Period'
|
||||
ws['B7'].border = f_border
|
||||
|
||||
ws['C7'].font = title_font
|
||||
ws['C7'].alignment = c_c_alignment
|
||||
ws['C7'] = '平均负荷'
|
||||
ws['C7'] = 'Average Load'
|
||||
ws['C7'].border = f_border
|
||||
|
||||
ws['D7'].font = title_font
|
||||
ws['D7'].alignment = c_c_alignment
|
||||
ws['D7'] = '最大负荷'
|
||||
ws['D7'] = 'Maximum Load'
|
||||
ws['D7'].border = f_border
|
||||
|
||||
ws['E7'].font = title_font
|
||||
ws['E7'].alignment = c_c_alignment
|
||||
ws['E7'] = '负荷系数'
|
||||
ws['E7'] = 'Load Factor'
|
||||
ws['E7'].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -202,7 +202,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(row + 1)].font = name_font
|
||||
ws['B' + str(row + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(row + 1)] = "环比"
|
||||
ws['B' + str(row + 1)] = 'Increment Rate'
|
||||
ws['B' + str(row + 1)].border = f_border
|
||||
|
||||
ws['C' + str(row)].font = name_font
|
||||
|
@ -245,7 +245,7 @@ def generate_excel(report,
|
|||
ws['E' + str(row + 1)].border = f_border
|
||||
|
||||
####################################################################################################################
|
||||
# Third: 详细数据
|
||||
# Third: Detailed Data
|
||||
# row_sat~ row_sat + 6*cal_len: line
|
||||
# row_da: table title
|
||||
# row_da + 1~: table_data
|
||||
|
@ -270,12 +270,12 @@ def generate_excel(report,
|
|||
row_da = row_sat + row_lines + real_timestamps_len * 7 + 2
|
||||
|
||||
ws['B' + str(row_da)].font = title_font
|
||||
ws['B' + str(row_da)] = name + ' 详细数据'
|
||||
ws['B' + str(row_da)] = name + ' ' + 'Detailed Data'
|
||||
# table_title
|
||||
ws['B' + str(row_da + 1)].fill = table_fill
|
||||
ws['B' + str(row_da + 1)].font = name_font
|
||||
ws['B' + str(row_da + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(row_da + 1)] = "日期时间"
|
||||
ws['B' + str(row_da + 1)] = "Datetime"
|
||||
ws['B' + str(row_da + 1)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -284,13 +284,13 @@ def generate_excel(report,
|
|||
|
||||
ws[col_average + str(row_da + 1)].font = name_font
|
||||
ws[col_average + str(row_da + 1)].alignment = c_c_alignment
|
||||
ws[col_average + str(row_da + 1)] = names[i] + " 平均负荷(" + reporting_period_data['units'][
|
||||
ws[col_average + str(row_da + 1)] = names[i] + " Average Load(" + reporting_period_data['units'][
|
||||
i] + "/H)"
|
||||
ws[col_average + str(row_da + 1)].border = f_border
|
||||
|
||||
ws[col_maximum + str(row_da + 1)].font = name_font
|
||||
ws[col_maximum + str(row_da + 1)].alignment = c_c_alignment
|
||||
ws[col_maximum + str(row_da + 1)] = names[i] + " 最大负荷(" + reporting_period_data['units'][
|
||||
ws[col_maximum + str(row_da + 1)] = names[i] + " Maximum Load(" + reporting_period_data['units'][
|
||||
i] + "/H)"
|
||||
ws[col_maximum + str(row_da + 1)].border = f_border
|
||||
# table_date
|
||||
|
@ -324,7 +324,7 @@ def generate_excel(report,
|
|||
# LineChart
|
||||
for i in range(0, ca_len):
|
||||
lc = LineChart()
|
||||
lc.title = "报告期 最大负荷"
|
||||
lc.title = "Reporting Period Maximum Load"
|
||||
lc.style = 10
|
||||
lc.x_axis.majorTickMark = 'in'
|
||||
lc.y_axis.majorTickMark = 'in'
|
||||
|
@ -432,7 +432,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -488,7 +488,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -167,7 +167,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期产出'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Output'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -195,7 +195,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '产出'
|
||||
ws['B' + str(current_row_number)] = 'Output'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -212,7 +212,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -249,7 +249,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -263,7 +263,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -300,7 +300,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -336,7 +336,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期产出 - ' + \
|
||||
line.title = 'Reporting Period Output - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -443,7 +443,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -499,7 +499,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -169,7 +169,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期节约'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Savings'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -188,7 +188,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = \
|
||||
reporting_period_data['names'][i] + " (基线-实际) (" + reporting_period_data['units'][i] + ")"
|
||||
reporting_period_data['names'][i] + " (Baseline - Actual) (" + reporting_period_data['units'][i] + ")"
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -196,7 +196,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '吨标准煤 (基线-实际) (TCE)'
|
||||
ws[col + str(current_row_number)] = 'Ton of Standard Coal (Baseline - Actual) (TCE)'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -204,7 +204,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '吨二氧化碳排放 (基线-实际) (TCO2E)'
|
||||
ws[col + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions (Baseline - Actual) (TCO2E)'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -213,7 +213,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '节约'
|
||||
ws['B' + str(current_row_number)] = 'Savings'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -244,7 +244,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -279,7 +279,7 @@ def generate_excel(report,
|
|||
current_row_number += 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨标准煤(TCE)占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -293,13 +293,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '节约'
|
||||
ws['C' + str(current_row_number)] = 'Savings'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '吨标准煤(TCE) 节约占比'
|
||||
ws['D' + str(current_row_number)] = 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -333,7 +333,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 吨标准煤(TCE)占比'
|
||||
pie.title = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -348,7 +348,7 @@ def generate_excel(report,
|
|||
ws.add_chart(pie, 'E' + str(chart_start_row_number))
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨二氧化碳排放(TCO2E)占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -362,13 +362,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '节约'
|
||||
ws['C' + str(current_row_number)] = 'Savings'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '吨二氧化碳排放(TCO2E) 节约占比'
|
||||
ws['D' + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -402,7 +402,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 吨二氧化碳排放(TCO2E)占比'
|
||||
pie.title = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -437,7 +437,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -451,7 +451,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -488,7 +488,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -524,7 +524,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期节约 - ' + \
|
||||
line.title = 'Reporting Period Savings - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -631,7 +631,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -687,7 +687,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -151,7 +151,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 统计分析
|
||||
# First: Statistics
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~ca_len table_data
|
||||
|
@ -166,7 +166,7 @@ def generate_excel(report,
|
|||
return filename
|
||||
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 统计分析'
|
||||
ws['B6'] = name + ' ' + 'Statistics'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -174,37 +174,37 @@ def generate_excel(report,
|
|||
ws['B7'].fill = table_fill
|
||||
ws['B7'].font = title_font
|
||||
ws['B7'].alignment = c_c_alignment
|
||||
ws['B7'] = '报告期'
|
||||
ws['B7'] = 'Reporting Period'
|
||||
ws['B7'].border = f_border
|
||||
|
||||
ws['C7'].font = title_font
|
||||
ws['C7'].alignment = c_c_alignment
|
||||
ws['C7'] = '算术平均数'
|
||||
ws['C7'] = 'Arithmetic Mean'
|
||||
ws['C7'].border = f_border
|
||||
|
||||
ws['D7'].font = title_font
|
||||
ws['D7'].alignment = c_c_alignment
|
||||
ws['D7'] = '中位数'
|
||||
ws['D7'] = 'Median (Middle Value)'
|
||||
ws['D7'].border = f_border
|
||||
|
||||
ws['E7'].font = title_font
|
||||
ws['E7'].alignment = c_c_alignment
|
||||
ws['E7'] = '最小值'
|
||||
ws['E7'] = 'Minimum Value'
|
||||
ws['E7'].border = f_border
|
||||
|
||||
ws['F7'].font = title_font
|
||||
ws['F7'].alignment = c_c_alignment
|
||||
ws['F7'] = '最大值'
|
||||
ws['F7'] = 'Maximum Value'
|
||||
ws['F7'].border = f_border
|
||||
|
||||
ws['G7'].font = title_font
|
||||
ws['G7'].alignment = c_c_alignment
|
||||
ws['G7'] = '样本标准差'
|
||||
ws['G7'] = 'Sample Standard Deviation'
|
||||
ws['G7'].border = f_border
|
||||
|
||||
ws['H7'].font = title_font
|
||||
ws['H7'].alignment = c_c_alignment
|
||||
ws['H7'] = '样本方差'
|
||||
ws['H7'] = 'Sample Variance'
|
||||
ws['H7'].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -218,7 +218,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(row + 1)].font = name_font
|
||||
ws['B' + str(row + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(row + 1)] = "环比"
|
||||
ws['B' + str(row + 1)] = 'Increment Rate'
|
||||
ws['B' + str(row + 1)].border = f_border
|
||||
|
||||
ws['C' + str(row)].font = name_font
|
||||
|
@ -300,7 +300,7 @@ def generate_excel(report,
|
|||
ws['H' + str(row + 1)].border = f_border
|
||||
|
||||
####################################################################################################################
|
||||
# Second: 详细数据
|
||||
# Second: Detailed Data
|
||||
# a+1~ analysis_end_row_number+1+line_charts_row_number+: line
|
||||
# detailed_start_row_number~ : the detailed data table
|
||||
####################################################################################################################
|
||||
|
@ -323,12 +323,12 @@ def generate_excel(report,
|
|||
detailed_start_row_number = analysis_end_row_number + line_charts_row_number + 1 + real_timestamps_len * 7
|
||||
|
||||
ws['B' + str(detailed_start_row_number)].font = title_font
|
||||
ws['B' + str(detailed_start_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(detailed_start_row_number)] = name + ' ' + 'Detailed Data'
|
||||
# the detailed table_title
|
||||
ws['B' + str(detailed_start_row_number + 1)].fill = table_fill
|
||||
ws['B' + str(detailed_start_row_number + 1)].font = name_font
|
||||
ws['B' + str(detailed_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(detailed_start_row_number + 1)] = "时间"
|
||||
ws['B' + str(detailed_start_row_number + 1)] = 'Datetime'
|
||||
ws['B' + str(detailed_start_row_number + 1)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -356,11 +356,11 @@ def generate_excel(report,
|
|||
ws[col + str(rows)].number_format = '0.00'
|
||||
ws[col + str(rows)].border = f_border
|
||||
|
||||
# 小计
|
||||
# Subtotal
|
||||
row_subtotals = detailed_start_row_number + 2 + time_len
|
||||
ws['B' + str(row_subtotals)].font = name_font
|
||||
ws['B' + str(row_subtotals)].alignment = c_c_alignment
|
||||
ws['B' + str(row_subtotals)] = "小计"
|
||||
ws['B' + str(row_subtotals)] = 'Subtotal'
|
||||
ws['B' + str(row_subtotals)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -379,7 +379,7 @@ def generate_excel(report,
|
|||
####################################################################################################################
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = "报告期消耗" + " - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.title = "Reporting Period Consumption" + " - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.style = 10
|
||||
line.height = 8.40
|
||||
line.width = 24
|
||||
|
@ -483,7 +483,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -539,7 +539,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ def generate_excel(report, space_name):
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
right=Side(border_style='medium', color='00000000'),
|
||||
|
@ -95,22 +95,22 @@ def generate_excel(report, space_name):
|
|||
ws['B3'].border = f_border
|
||||
ws['B3'].font = name_font
|
||||
ws['B3'].alignment = b_c_alignment
|
||||
ws['B3'] = '名称'
|
||||
ws['B3'] = 'Name'
|
||||
|
||||
ws['C3'].border = f_border
|
||||
ws['C3'].alignment = b_c_alignment
|
||||
ws['C3'].font = name_font
|
||||
ws['C3'] = '空间'
|
||||
ws['C3'] = 'Space'
|
||||
|
||||
ws['D3'].border = f_border
|
||||
ws['D3'].font = name_font
|
||||
ws['D3'].alignment = b_c_alignment
|
||||
ws['D3'] = '成本中心'
|
||||
ws['D3'] = 'Cost Center'
|
||||
|
||||
ws['E3'].border = f_border
|
||||
ws['E3'].alignment = b_c_alignment
|
||||
ws['E3'].font = name_font
|
||||
ws['E3'] = '描述'
|
||||
ws['E3'] = 'Description'
|
||||
|
||||
current_row_number = 4
|
||||
for i in range(0, len(report['equipments'])):
|
||||
|
|
|
@ -73,7 +73,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
data_font = Font(name='Franklin Gothic Book', size=11)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
|
@ -116,7 +116,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
ws['B3'].font = name_font
|
||||
ws['B3'].alignment = b_r_alignment
|
||||
ws['B3'] = '空间:'
|
||||
ws['B3'] = 'Space:'
|
||||
ws['C3'].border = b_border
|
||||
ws['C3'].alignment = b_c_alignment
|
||||
ws['C3'].font = name_font
|
||||
|
@ -124,7 +124,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
ws['F3'].font = name_font
|
||||
ws['F3'].alignment = b_r_alignment
|
||||
ws['F3'] = '日期:'
|
||||
ws['F3'] = 'Datetime:'
|
||||
ws['G3'].border = b_border
|
||||
ws['G3'].alignment = b_c_alignment
|
||||
ws['G3'].font = name_font
|
||||
|
|
|
@ -77,7 +77,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -158,7 +158,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
if has_cost_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + '报告期成本'
|
||||
ws['B6'] = name + 'Reporting Period Costs'
|
||||
|
||||
reporting_period_data = report['reporting_period']
|
||||
category = report['meter']['energy_category_name']
|
||||
|
@ -170,12 +170,12 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '成本'
|
||||
ws['B8'] = 'Cost'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '环比'
|
||||
ws['B9'] = 'Increment Rate'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -207,7 +207,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[tce_col + '7'].fill = table_fill
|
||||
ws[tce_col + '7'].font = name_font
|
||||
ws[tce_col + '7'].alignment = c_c_alignment
|
||||
ws[tce_col + '7'] = "吨标准煤 (TCE)"
|
||||
ws[tce_col + '7'] = 'Ton of Standard Coal (TCE)'
|
||||
ws[tce_col + '7'].border = f_border
|
||||
|
||||
ws[tce_col + '8'].font = name_font
|
||||
|
@ -226,7 +226,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[tco2e_col + '7'].fill = table_fill
|
||||
ws[tco2e_col + '7'].font = name_font
|
||||
ws[tco2e_col + '7'].alignment = c_c_alignment
|
||||
ws[tco2e_col + '7'] = "吨二氧化碳排放 (TCO2E)"
|
||||
ws[tco2e_col + '7'] = 'Ton of Carbon Dioxide Emissions (TCO2E)'
|
||||
ws[tco2e_col + '7'].border = f_border
|
||||
|
||||
ws[tco2e_col + '8'].font = name_font
|
||||
|
@ -266,14 +266,14 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
start_detail_data_row_number = 13 + (parameters_parameters_datas_len + ca_len) * 6
|
||||
|
||||
ws['B11'].font = title_font
|
||||
ws['B11'] = name + '详细数据'
|
||||
ws['B11'] = name + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[start_detail_data_row_number].height = 60
|
||||
ws['B' + str(start_detail_data_row_number)].fill = table_fill
|
||||
ws['B' + str(start_detail_data_row_number)].font = title_font
|
||||
ws['B' + str(start_detail_data_row_number)].border = f_border
|
||||
ws['B' + str(start_detail_data_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(start_detail_data_row_number)] = '日期时间'
|
||||
ws['B' + str(start_detail_data_row_number)] = 'Datetime'
|
||||
time = times
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -297,7 +297,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
ws['B' + str(end_data_row_number + 1)].font = title_font
|
||||
ws['B' + str(end_data_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(end_data_row_number + 1)] = '总计'
|
||||
ws['B' + str(end_data_row_number + 1)] = 'Total'
|
||||
ws['B' + str(end_data_row_number + 1)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -328,7 +328,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[col + str(end_data_row_number + 1)].border = f_border
|
||||
|
||||
line = LineChart()
|
||||
line.title = '报告期成本 - ' + report['meter']['energy_category_name'] + \
|
||||
line.title = 'Reporting Period Costs - ' + report['meter']['energy_category_name'] + \
|
||||
" (" + report['meter']['unit_of_measure'] + ")"
|
||||
line_data = Reference(ws, min_col=3, min_row=start_detail_data_row_number, max_row=max_row)
|
||||
line.series.append(Series(line_data, title_from_data=True))
|
||||
|
@ -435,7 +435,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -491,7 +491,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -146,7 +146,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 能耗分析
|
||||
# First: Consumption
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~9 table_data
|
||||
|
@ -158,7 +158,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
if has_energy_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + '能耗分析'
|
||||
ws['B6'] = name + 'Consumption'
|
||||
|
||||
reporting_period_data = report['reporting_period']
|
||||
|
||||
|
@ -172,12 +172,12 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '能耗'
|
||||
ws['B8'] = 'Consumption'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '环比'
|
||||
ws['B9'] = 'Increment Rate'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -210,7 +210,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[tce_col + '7'].fill = table_fill
|
||||
ws[tce_col + '7'].font = name_font
|
||||
ws[tce_col + '7'].alignment = c_c_alignment
|
||||
ws[tce_col + '7'] = "吨标准煤 (TCE)"
|
||||
ws[tce_col + '7'] = 'Ton of Standard Coal (TCE)'
|
||||
ws[tce_col + '7'].border = f_border
|
||||
|
||||
ws[tce_col + '8'].font = name_font
|
||||
|
@ -229,7 +229,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[tco2e_col + '7'].fill = table_fill
|
||||
ws[tco2e_col + '7'].font = name_font
|
||||
ws[tco2e_col + '7'].alignment = c_c_alignment
|
||||
ws[tco2e_col + '7'] = "吨二氧化碳排放 (TCO2E)"
|
||||
ws[tco2e_col + '7'] = 'Ton of Carbon Dioxide Emissions (TCO2E)'
|
||||
ws[tco2e_col + '7'].border = f_border
|
||||
|
||||
ws[tco2e_col + '8'].font = name_font
|
||||
|
@ -246,7 +246,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
for i in range(6, 9 + 1):
|
||||
ws.row_dimensions[i].height = 0.1
|
||||
####################################################################################################################
|
||||
# Second: 能耗详情
|
||||
# Second: Detailed Data
|
||||
# 11: title
|
||||
# 12 ~ 16: chart
|
||||
# 18: table title
|
||||
|
@ -272,7 +272,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
parameters_parameters_datas_len += 1
|
||||
start_detail_data_row_num = 13 + (parameters_parameters_datas_len + ca_len) * 6
|
||||
ws['B11'].font = title_font
|
||||
ws['B11'] = name + '详细数据'
|
||||
ws['B11'] = name + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[start_detail_data_row_num].height = 60
|
||||
|
||||
|
@ -280,7 +280,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(start_detail_data_row_num)].font = title_font
|
||||
ws['B' + str(start_detail_data_row_num)].border = f_border
|
||||
ws['B' + str(start_detail_data_row_num)].alignment = c_c_alignment
|
||||
ws['B' + str(start_detail_data_row_num)] = '日期时间'
|
||||
ws['B' + str(start_detail_data_row_num)] = 'Datetime'
|
||||
time = times
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -323,7 +323,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
# line
|
||||
# 13~: line
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + report['meter']['energy_category_name'] + \
|
||||
line.title = 'Reporting Period Consumption - ' + report['meter']['energy_category_name'] + \
|
||||
" (" + report['meter']['unit_of_measure'] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=start_detail_data_row_num + 1, max_row=max_row)
|
||||
bar_data = Reference(ws, min_col=3, min_row=start_detail_data_row_num, max_row=max_row)
|
||||
|
@ -347,7 +347,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
ws[col + row].font = title_font
|
||||
ws[col + row].alignment = c_c_alignment
|
||||
ws[col + row] = '总计'
|
||||
ws[col + row] = 'Total'
|
||||
ws[col + row].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -450,7 +450,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -506,7 +506,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -158,7 +158,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
category = report['meter']['energy_category_name']
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -179,7 +179,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '总表消耗'
|
||||
ws['B' + str(current_row_number)] = 'Master Meter Consumption'
|
||||
|
||||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
|
@ -191,7 +191,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '分表消耗'
|
||||
ws['B' + str(current_row_number)] = 'Submeters Consumption'
|
||||
|
||||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
|
@ -203,7 +203,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '差值'
|
||||
ws['B' + str(current_row_number)] = 'Difference'
|
||||
|
||||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
|
@ -215,7 +215,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '差值百分比'
|
||||
ws['B' + str(current_row_number)] = 'Percentage Difference'
|
||||
|
||||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
|
@ -240,7 +240,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
if has_time_data_flag:
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
chart_start_number = current_row_number
|
||||
|
@ -253,7 +253,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
ws['C' + str(current_row_number)].fill = table_fill
|
||||
ws['C' + str(current_row_number)].font = title_font
|
||||
|
@ -280,7 +280,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
table_end_number = current_row_number - 1
|
||||
|
||||
line = LineChart()
|
||||
line.title = '报告期差值 - ' + report['meter']['energy_category_name'] + " (" + report['meter'][
|
||||
line.title = 'Difference - ' + report['meter']['energy_category_name'] + " (" + report['meter'][
|
||||
'unit_of_measure'] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_number + 1, max_row=table_end_number)
|
||||
line_data = Reference(ws, min_col=3, min_row=table_start_number, max_row=table_end_number)
|
||||
|
@ -294,13 +294,13 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
line.width = 24
|
||||
line.dLbls = DataLabelList()
|
||||
line.dLbls.dLblPos = 't'
|
||||
line.dLbls.showVal = True # 数量显示
|
||||
line.dLbls.showVal = True
|
||||
ws.add_chart(line, "B" + str(chart_start_number))
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '总计'
|
||||
ws['B' + str(current_row_number)] = 'Total'
|
||||
|
||||
ws['C' + str(current_row_number)].font = title_font
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
|
@ -400,7 +400,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -456,7 +456,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -135,43 +135,43 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
ws['B6'].font = name_font
|
||||
ws['B6'].alignment = c_c_alignment
|
||||
ws['B6'].fill = table_fill
|
||||
ws['B6'] = '名称'
|
||||
ws['B6'] = 'Name'
|
||||
|
||||
ws['C6'].border = f_border
|
||||
ws['C6'].alignment = c_c_alignment
|
||||
ws['C6'].font = name_font
|
||||
ws['C6'].fill = table_fill
|
||||
ws['C6'] = '空间'
|
||||
ws['C6'] = 'Space'
|
||||
|
||||
ws['D6'].border = f_border
|
||||
ws['D6'].font = name_font
|
||||
ws['D6'].alignment = c_c_alignment
|
||||
ws['D6'].fill = table_fill
|
||||
ws['D6'] = '成本中心'
|
||||
ws['D6'] = 'Cost Center'
|
||||
|
||||
ws['E6'].border = f_border
|
||||
ws['E6'].alignment = c_c_alignment
|
||||
ws['E6'].font = name_font
|
||||
ws['E6'].fill = table_fill
|
||||
ws['E6'] = '能耗分类'
|
||||
ws['E6'] = 'Energy Category'
|
||||
|
||||
ws['F6'].border = f_border
|
||||
ws['F6'].font = name_font
|
||||
ws['F6'].alignment = c_c_alignment
|
||||
ws['F6'].fill = table_fill
|
||||
ws['F6'] = ' 描述'
|
||||
ws['F6'] = 'Description'
|
||||
|
||||
ws['G6'].border = f_border
|
||||
ws['G6'].font = name_font
|
||||
ws['G6'].alignment = c_c_alignment
|
||||
ws['G6'].fill = table_fill
|
||||
ws['G6'] = '开始值'
|
||||
ws['G6'] = 'Start Value'
|
||||
|
||||
ws['H6'].border = f_border
|
||||
ws['H6'].font = name_font
|
||||
ws['H6'].alignment = c_c_alignment
|
||||
ws['H6'].fill = table_fill
|
||||
ws['H6'] = ' 结束值'
|
||||
ws['H6'] = 'End Value'
|
||||
|
||||
current_row_number = 7
|
||||
for i in range(0, len(report['meters'])):
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
data_font = Font(name='Franklin Gothic Book', size=11)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
|
@ -199,14 +199,14 @@ def generate_excel(report,
|
|||
|
||||
max_row = start_detail_data_row_num + len(time)
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 趋势'
|
||||
ws['B6'] = name + ' ' + '趋势'
|
||||
|
||||
ws.row_dimensions[start_detail_data_row_num - 1].height = 60
|
||||
ws['B' + str(start_detail_data_row_num - 1)].fill = table_fill
|
||||
ws['B' + str(start_detail_data_row_num - 1)].font = title_font
|
||||
ws['B' + str(start_detail_data_row_num - 1)].border = f_border
|
||||
ws['B' + str(start_detail_data_row_num - 1)].alignment = c_c_alignment
|
||||
ws['B' + str(start_detail_data_row_num - 1)] = '日期时间'
|
||||
ws['B' + str(start_detail_data_row_num - 1)] = 'Datetime'
|
||||
|
||||
for i in range(0, len(time)):
|
||||
col = 'B'
|
||||
|
@ -336,7 +336,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -392,7 +392,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -157,7 +157,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
if has_cost_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + '报告期成本'
|
||||
ws['B6'] = name + 'Reporting Period Costs'
|
||||
|
||||
reporting_period_data = report['reporting_period']
|
||||
category = report['offline_meter']['energy_category_name']
|
||||
|
@ -169,12 +169,12 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '成本'
|
||||
ws['B8'] = 'Cost'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '环比'
|
||||
ws['B9'] = 'Increment Rate'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -207,7 +207,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[tce_col + '7'].fill = table_fill
|
||||
ws[tce_col + '7'].font = name_font
|
||||
ws[tce_col + '7'].alignment = c_c_alignment
|
||||
ws[tce_col + '7'] = "吨标准煤 (TCE)"
|
||||
ws[tce_col + '7'] = 'Ton of Standard Coal (TCE)'
|
||||
ws[tce_col + '7'].border = f_border
|
||||
|
||||
ws[tce_col + '8'].font = name_font
|
||||
|
@ -226,7 +226,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[tco2e_col + '7'].fill = table_fill
|
||||
ws[tco2e_col + '7'].font = name_font
|
||||
ws[tco2e_col + '7'].alignment = c_c_alignment
|
||||
ws[tco2e_col + '7'] = "吨二氧化碳排放 (TCO2E)"
|
||||
ws[tco2e_col + '7'] = 'Ton of Carbon Dioxide Emissions (TCO2E)'
|
||||
ws[tco2e_col + '7'].border = f_border
|
||||
|
||||
ws[tco2e_col + '8'].font = name_font
|
||||
|
@ -257,14 +257,14 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
if has_cost_datail_flag:
|
||||
ws['B11'].font = title_font
|
||||
ws['B11'] = name + '详细数据'
|
||||
ws['B11'] = name + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[18].height = 60
|
||||
ws['B18'].fill = table_fill
|
||||
ws['B18'].font = title_font
|
||||
ws['B18'].border = f_border
|
||||
ws['B18'].alignment = c_c_alignment
|
||||
ws['B18'] = '日期时间'
|
||||
ws['B18'] = 'Datetime'
|
||||
time = times
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -288,7 +288,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
ws['B' + str(end_data_row_number + 1)].font = title_font
|
||||
ws['B' + str(end_data_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(end_data_row_number + 1)] = '总计'
|
||||
ws['B' + str(end_data_row_number + 1)] = 'Total'
|
||||
ws['B' + str(end_data_row_number + 1)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -319,7 +319,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[col + str(end_data_row_number + 1)].border = f_border
|
||||
|
||||
line = LineChart()
|
||||
line.title = '报告期成本 - ' + report['offline_meter']['energy_category_name'] + \
|
||||
line.title = 'Reporting Period Costs - ' + report['offline_meter']['energy_category_name'] + \
|
||||
" (" + report['offline_meter']['unit_of_measure'] + ")"
|
||||
line_data = Reference(ws, min_col=3, min_row=18, max_row=max_row)
|
||||
line.series.append(Series(line_data, title_from_data=True))
|
||||
|
|
|
@ -73,7 +73,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -154,7 +154,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
if has_energy_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + '能耗分析'
|
||||
ws['B6'] = name + 'Consumption'
|
||||
|
||||
reporting_period_data = report['reporting_period']
|
||||
category = report['offline_meter']['energy_category_name']
|
||||
|
@ -167,12 +167,12 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '能耗'
|
||||
ws['B8'] = 'Consumption'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '环比'
|
||||
ws['B9'] = 'Increment Rate'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -206,7 +206,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[tce_col + '7'].fill = table_fill
|
||||
ws[tce_col + '7'].font = name_font
|
||||
ws[tce_col + '7'].alignment = c_c_alignment
|
||||
ws[tce_col + '7'] = "吨标准煤 (TCE)"
|
||||
ws[tce_col + '7'] = 'Ton of Standard Coal (TCE)'
|
||||
ws[tce_col + '7'].border = f_border
|
||||
|
||||
ws[tce_col + '8'].font = name_font
|
||||
|
@ -225,7 +225,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[tco2e_col + '7'].fill = table_fill
|
||||
ws[tco2e_col + '7'].font = name_font
|
||||
ws[tco2e_col + '7'].alignment = c_c_alignment
|
||||
ws[tco2e_col + '7'] = "吨二氧化碳排放 (TCO2E)"
|
||||
ws[tco2e_col + '7'] = 'Ton of Carbon Dioxide Emissions (TCO2E)'
|
||||
ws[tco2e_col + '7'].border = f_border
|
||||
|
||||
ws[tco2e_col + '8'].font = name_font
|
||||
|
@ -257,7 +257,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ca_len = len(category)
|
||||
|
||||
ws['B11'].font = title_font
|
||||
ws['B11'] = name + '详细数据'
|
||||
ws['B11'] = name + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[18].height = 60
|
||||
|
||||
|
@ -265,7 +265,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B18'].font = title_font
|
||||
ws['B18'].border = f_border
|
||||
ws['B18'].alignment = c_c_alignment
|
||||
ws['B18'] = '日期时间'
|
||||
ws['B18'] = 'Datetime'
|
||||
time = times
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -304,7 +304,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[col + row].border = f_border
|
||||
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + report['offline_meter']['energy_category_name'] + \
|
||||
line.title = 'Reporting Period Consumption - ' + report['offline_meter']['energy_category_name'] + \
|
||||
" (" + report['offline_meter']['unit_of_measure'] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=19, max_row=max_row)
|
||||
bar_data = Reference(ws, min_col=3, min_row=18, max_row=max_row)
|
||||
|
@ -328,7 +328,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
ws[col + row].font = title_font
|
||||
ws[col + row].alignment = c_c_alignment
|
||||
ws[col + row] = '总计'
|
||||
ws[col + row] = 'Total'
|
||||
ws[col + row].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
|
|
@ -73,7 +73,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
data_font = Font(name='Franklin Gothic Book', size=11)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
|
@ -116,7 +116,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
ws['B3'].font = name_font
|
||||
ws['B3'].alignment = b_r_alignment
|
||||
ws['B3'] = '空间:'
|
||||
ws['B3'] = 'Space:'
|
||||
ws['C3'].border = b_border
|
||||
ws['C3'].alignment = b_c_alignment
|
||||
ws['C3'].font = name_font
|
||||
|
@ -124,7 +124,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
ws['F3'].font = name_font
|
||||
ws['F3'].alignment = b_r_alignment
|
||||
ws['F3'] = '日期:'
|
||||
ws['F3'] = 'Datetime:'
|
||||
ws['G3'].border = b_border
|
||||
ws['G3'].alignment = b_c_alignment
|
||||
ws['G3'].font = name_font
|
||||
|
@ -136,13 +136,13 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
ws['B6'].font = name_font
|
||||
ws['B6'].alignment = c_c_alignment
|
||||
ws['B6'].fill = table_fill
|
||||
ws['B6'] = '名称'
|
||||
ws['B6'] = 'Name'
|
||||
|
||||
ws['C6'].border = f_border
|
||||
ws['C6'].alignment = c_c_alignment
|
||||
ws['C6'].font = name_font
|
||||
ws['C6'].fill = table_fill
|
||||
ws['C6'] = '空间'
|
||||
ws['C6'] = 'Space'
|
||||
|
||||
ca_len = len(report['energycategories'])
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import base64
|
||||
import uuid
|
||||
import os
|
||||
from decimal import Decimal
|
||||
from openpyxl.chart import PieChart, LineChart, Reference
|
||||
from openpyxl.styles import PatternFill, Border, Side, Alignment, Font
|
||||
from openpyxl.drawing.image import Image
|
||||
|
@ -83,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -166,7 +167,7 @@ def generate_excel(report,
|
|||
|
||||
if has_energy_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 报告期成本'
|
||||
ws['B6'] = name + ' ' + 'Reporting Period Costs'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
@ -177,17 +178,17 @@ def generate_excel(report,
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '成本'
|
||||
ws['B8'] = 'Cost'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '单位面积值'
|
||||
ws['B9'] = 'Per Unit Area'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
ws['B10'].font = title_font
|
||||
ws['B10'].alignment = c_c_alignment
|
||||
ws['B10'] = '环比'
|
||||
ws['B10'] = 'Increment Rate'
|
||||
ws['B10'].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -220,7 +221,7 @@ def generate_excel(report,
|
|||
ws[end_col + '7'].fill = table_fill
|
||||
ws[end_col + '7'].font = name_font
|
||||
ws[end_col + '7'].alignment = c_c_alignment
|
||||
ws[end_col + '7'] = "总计 (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + '7'] = "Total (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + '7'].border = f_border
|
||||
|
||||
ws[end_col + '8'].font = name_font
|
||||
|
@ -253,7 +254,7 @@ def generate_excel(report,
|
|||
|
||||
if has_ele_peak_flag:
|
||||
ws['B12'].font = title_font
|
||||
ws['B12'] = name + '分时用电成本'
|
||||
ws['B12'] = name + 'Electricity Cost by Time-Of-Use'
|
||||
|
||||
ws['B13'].fill = table_fill
|
||||
ws['B13'].font = name_font
|
||||
|
@ -264,20 +265,20 @@ def generate_excel(report,
|
|||
ws['C13'].font = name_font
|
||||
ws['C13'].alignment = c_c_alignment
|
||||
ws['C13'].border = f_border
|
||||
ws['C13'] = '分时用电成本'
|
||||
ws['C13'] = 'Electricity Cost by Time-Of-Use'
|
||||
|
||||
ws['D13'].fill = table_fill
|
||||
ws['D13'].font = name_font
|
||||
ws['D13'].alignment = c_c_alignment
|
||||
ws['D13'].border = f_border
|
||||
ws['D13'] = '分时用电成本占比'
|
||||
ws['D13'] = 'Electricity Cost Proportion by Time-Of-Use'
|
||||
|
||||
wssum = round(reporting_period_data['toppeaks'][0], 2) + round(reporting_period_data['onpeaks'][0], 2) + round(
|
||||
reporting_period_data['midpeaks'][0], 2) + round(reporting_period_data['offpeaks'][0], 2)
|
||||
|
||||
ws['B14'].font = title_font
|
||||
ws['B14'].alignment = c_c_alignment
|
||||
ws['B14'] = '尖'
|
||||
ws['B14'] = 'TopPeak'
|
||||
ws['B14'].border = f_border
|
||||
|
||||
ws['C14'].font = title_font
|
||||
|
@ -293,7 +294,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B15'].font = title_font
|
||||
ws['B15'].alignment = c_c_alignment
|
||||
ws['B15'] = '峰'
|
||||
ws['B15'] = 'OnPeak'
|
||||
ws['B15'].border = f_border
|
||||
|
||||
ws['C15'].font = title_font
|
||||
|
@ -309,7 +310,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B16'].font = title_font
|
||||
ws['B16'].alignment = c_c_alignment
|
||||
ws['B16'] = '平'
|
||||
ws['B16'] = 'MidPeak'
|
||||
ws['B16'].border = f_border
|
||||
|
||||
ws['C16'].font = title_font
|
||||
|
@ -325,7 +326,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B17'].font = title_font
|
||||
ws['B17'].alignment = c_c_alignment
|
||||
ws['B17'] = '谷'
|
||||
ws['B17'] = 'OffPeak'
|
||||
ws['B17'].border = f_border
|
||||
|
||||
ws['C17'].font = title_font
|
||||
|
@ -340,7 +341,7 @@ def generate_excel(report,
|
|||
if wssum is not None and wssum != 0 else "0.00%"
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + '分时用电成本'
|
||||
pie.title = name + 'Electricity Cost by Time-Of-Use'
|
||||
labels = Reference(ws, min_col=2, min_row=14, max_row=17)
|
||||
pie_data = Reference(ws, min_col=3, min_row=13, max_row=17)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -370,7 +371,7 @@ def generate_excel(report,
|
|||
|
||||
if has_subtotals_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 成本占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Costs Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -385,13 +386,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '成本'
|
||||
ws['C' + str(current_row_number)] = 'Cost'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '成本占比'
|
||||
ws['D' + str(current_row_number)] = 'Costs Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -421,7 +422,7 @@ def generate_excel(report,
|
|||
table_end_row_number = current_row_number - 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 成本占比'
|
||||
pie.title = name + ' ' + 'Costs Proportion'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -469,7 +470,7 @@ def generate_excel(report,
|
|||
parameters_parameters_datas_len += 1
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
detail_data_table_start_row_number = current_row_number + (ca_len + parameters_parameters_datas_len) * 6 + 3
|
||||
current_row_number = detail_data_table_start_row_number
|
||||
|
@ -487,7 +488,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'B'
|
||||
|
||||
|
@ -506,7 +507,7 @@ def generate_excel(report,
|
|||
ws[end_col + str(current_row_number)].fill = table_fill
|
||||
ws[end_col + str(current_row_number)].font = title_font
|
||||
ws[end_col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[end_col + str(current_row_number)] = "总计 (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + str(current_row_number)] = "Total (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + str(current_row_number)].border = f_border
|
||||
|
||||
current_row_number += 1
|
||||
|
@ -519,7 +520,7 @@ def generate_excel(report,
|
|||
|
||||
col = 'B'
|
||||
|
||||
periodic_sum = 0.0
|
||||
periodic_sum = Decimal(0.0)
|
||||
|
||||
for j in range(0, ca_len):
|
||||
col = chr(ord('C') + j)
|
||||
|
@ -543,7 +544,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -557,7 +558,7 @@ def generate_excel(report,
|
|||
|
||||
# line
|
||||
line = LineChart()
|
||||
line.title = '报告期成本 - ' + \
|
||||
line.title = 'Reporting Period Costs - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=detail_data_table_start_row_number + 1,
|
||||
max_row=table_end_row_number)
|
||||
|
@ -678,7 +679,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -734,7 +735,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -156,7 +156,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 能耗分析
|
||||
# First: Consumption
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~10 table_data
|
||||
|
@ -173,7 +173,7 @@ def generate_excel(report,
|
|||
|
||||
if has_energy_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name+' 能耗分析'
|
||||
ws['B6'] = name + ' ' + 'Consumption'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
@ -184,17 +184,17 @@ def generate_excel(report,
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '能耗'
|
||||
ws['B8'] = 'Consumption'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '单位面积能耗'
|
||||
ws['B9'] = 'Per Unit Area'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
ws['B10'].font = title_font
|
||||
ws['B10'].alignment = c_c_alignment
|
||||
ws['B10'] = '环比'
|
||||
ws['B10'] = 'Increment Rate'
|
||||
ws['B10'].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -232,7 +232,7 @@ def generate_excel(report,
|
|||
ws[tce_col + '7'].fill = table_fill
|
||||
ws[tce_col + '7'].font = name_font
|
||||
ws[tce_col + '7'].alignment = c_c_alignment
|
||||
ws[tce_col + '7'] = "吨标准煤 (TCE)"
|
||||
ws[tce_col + '7'] = 'Ton of Standard Coal (TCE)'
|
||||
ws[tce_col + '7'].border = f_border
|
||||
|
||||
ws[tce_col + '8'].font = name_font
|
||||
|
@ -256,7 +256,7 @@ def generate_excel(report,
|
|||
ws[tco2e_col + '7'].fill = table_fill
|
||||
ws[tco2e_col + '7'].font = name_font
|
||||
ws[tco2e_col + '7'].alignment = c_c_alignment
|
||||
ws[tco2e_col + '7'] = "吨二氧化碳排放 (TCO2E)"
|
||||
ws[tco2e_col + '7'] = 'Ton of Carbon Dioxide Emissions (TCO2E)'
|
||||
ws[tco2e_col + '7'].border = f_border
|
||||
|
||||
ws[tco2e_col + '8'].font = name_font
|
||||
|
@ -278,7 +278,7 @@ def generate_excel(report,
|
|||
for i in range(6, 10 + 1):
|
||||
ws.row_dimensions[i].height = 0.1
|
||||
####################################################################################################################
|
||||
# Second: 分时电耗
|
||||
# Second: Electricity Consumption by Time-Of-Use
|
||||
# 12: title
|
||||
# 13: table title
|
||||
# 14~17 table_data
|
||||
|
@ -292,7 +292,7 @@ def generate_excel(report,
|
|||
|
||||
if has_ele_peak_flag:
|
||||
ws['B12'].font = title_font
|
||||
ws['B12'] = name+' 分时电耗'
|
||||
ws['B12'] = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws.row_dimensions[13].height = 60
|
||||
ws['B13'].fill = table_fill
|
||||
|
@ -304,11 +304,11 @@ def generate_excel(report,
|
|||
ws['C13'].font = name_font
|
||||
ws['C13'].alignment = c_c_alignment
|
||||
ws['C13'].border = f_border
|
||||
ws['C13'] = '分时电耗'
|
||||
ws['C13'] = 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws['B14'].font = title_font
|
||||
ws['B14'].alignment = c_c_alignment
|
||||
ws['B14'] = '尖'
|
||||
ws['B14'] = 'TopPeak'
|
||||
ws['B14'].border = f_border
|
||||
|
||||
ws['C14'].font = title_font
|
||||
|
@ -318,7 +318,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B15'].font = title_font
|
||||
ws['B15'].alignment = c_c_alignment
|
||||
ws['B15'] = '峰'
|
||||
ws['B15'] = 'OnPeak'
|
||||
ws['B15'].border = f_border
|
||||
|
||||
ws['C15'].font = title_font
|
||||
|
@ -328,7 +328,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B16'].font = title_font
|
||||
ws['B16'].alignment = c_c_alignment
|
||||
ws['B16'] = '平'
|
||||
ws['B16'] = 'MidPeak'
|
||||
ws['B16'].border = f_border
|
||||
|
||||
ws['C16'].font = title_font
|
||||
|
@ -338,7 +338,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B17'].font = title_font
|
||||
ws['B17'].alignment = c_c_alignment
|
||||
ws['B17'] = '谷'
|
||||
ws['B17'] = 'OffPeak'
|
||||
ws['B17'].border = f_border
|
||||
|
||||
ws['C17'].font = title_font
|
||||
|
@ -347,7 +347,7 @@ def generate_excel(report,
|
|||
ws['C17'] = round(reporting_period_data['offpeaks'][0], 2)
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name+' 分时电耗'
|
||||
pie.title = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
labels = Reference(ws, min_col=2, min_row=14, max_row=17)
|
||||
pie_data = Reference(ws, min_col=3, min_row=13, max_row=17)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -367,7 +367,7 @@ def generate_excel(report,
|
|||
ws.row_dimensions[i].height = 0.1
|
||||
|
||||
####################################################################################################################
|
||||
# Fourth: 能耗详情
|
||||
# Fourth: Detailed Data
|
||||
# current_row_number: title
|
||||
# current_row_number+1 ~ current_row_number+1+ca_len*6-1: line
|
||||
# current_row_number+1+ca_len*6: table title
|
||||
|
@ -393,14 +393,14 @@ def generate_excel(report,
|
|||
|
||||
if has_detail_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name+' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[table_row].height = 60
|
||||
ws['B'+str(table_row)].fill = table_fill
|
||||
ws['B' + str(table_row)].font = title_font
|
||||
ws['B'+str(table_row)].border = f_border
|
||||
ws['B'+str(table_row)].alignment = c_c_alignment
|
||||
ws['B'+str(table_row)] = '日期时间'
|
||||
ws['B'+str(table_row)] = 'Datetime'
|
||||
time = times[0]
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -447,7 +447,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -459,7 +459,7 @@ def generate_excel(report,
|
|||
# line
|
||||
# 39~: line
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + ws.cell(column=3+i, row=table_row).value
|
||||
line.title = 'Reporting Period Consumption - ' + ws.cell(column=3+i, row=table_row).value
|
||||
labels = Reference(ws, min_col=2, min_row=table_row+1, max_row=max_row)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_row, max_row=max_row) # openpyxl bug
|
||||
line.add_data(line_data, titles_from_data=True)
|
||||
|
@ -565,7 +565,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -621,7 +621,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -168,7 +168,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期消耗'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Consumption'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -214,7 +214,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '单位面积值'
|
||||
ws['B' + str(current_row_number)] = 'Per Unit Area'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -231,7 +231,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -253,8 +253,8 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = \
|
||||
name + ' ' + category_dict_name + ' (' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') 分项消耗占比'
|
||||
name + ' ' + category_dict_name + ' ' + '(' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') by Energy Item'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -287,8 +287,8 @@ def generate_excel(report,
|
|||
|
||||
pie = PieChart()
|
||||
pie.title = \
|
||||
name + ' ' + category_dict_name + ' (' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') 分项消耗占比'
|
||||
name + ' ' + category_dict_name + ' ' + '(' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') by Energy Item'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -332,7 +332,7 @@ def generate_excel(report,
|
|||
parameters_parameters_datas_len = 0
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
for i in range(0, parameters_names_len):
|
||||
if len(report['parameters']['timestamps'][i]) == 0:
|
||||
|
@ -346,7 +346,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -383,7 +383,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -419,7 +419,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + \
|
||||
line.title = 'Reporting Period Consumption - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -528,7 +528,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -584,7 +584,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -152,7 +152,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 统计分析
|
||||
# First: Statistics
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~ca_len table_data
|
||||
|
@ -167,7 +167,7 @@ def generate_excel(report,
|
|||
return filename
|
||||
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 统计分析'
|
||||
ws['B6'] = name + ' ' + 'Statistics'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -175,22 +175,22 @@ def generate_excel(report,
|
|||
ws['B7'].fill = table_fill
|
||||
ws['B7'].font = title_font
|
||||
ws['B7'].alignment = c_c_alignment
|
||||
ws['B7'] = '报告期'
|
||||
ws['B7'] = 'Reporting Period'
|
||||
ws['B7'].border = f_border
|
||||
|
||||
ws['C7'].font = title_font
|
||||
ws['C7'].alignment = c_c_alignment
|
||||
ws['C7'] = '平均负荷'
|
||||
ws['C7'] = 'Average Load'
|
||||
ws['C7'].border = f_border
|
||||
|
||||
ws['D7'].font = title_font
|
||||
ws['D7'].alignment = c_c_alignment
|
||||
ws['D7'] = '最大负荷'
|
||||
ws['D7'] = 'Maximum Load'
|
||||
ws['D7'].border = f_border
|
||||
|
||||
ws['E7'].font = title_font
|
||||
ws['E7'].alignment = c_c_alignment
|
||||
ws['E7'] = '负荷系数'
|
||||
ws['E7'] = 'Load Factor'
|
||||
ws['E7'].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -204,7 +204,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(row + 1)].font = name_font
|
||||
ws['B' + str(row + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(row + 1)] = "环比"
|
||||
ws['B' + str(row + 1)] = 'Increment Rate'
|
||||
ws['B' + str(row + 1)].border = f_border
|
||||
|
||||
ws['C' + str(row)].font = name_font
|
||||
|
@ -247,7 +247,7 @@ def generate_excel(report,
|
|||
ws['E' + str(row + 1)].border = f_border
|
||||
|
||||
####################################################################################################################
|
||||
# Second: 报告期单位面积消耗
|
||||
# Second: Per Unit Area
|
||||
# 9 + ca_len * 2: title
|
||||
# 10 + ca_len * 2: table title
|
||||
# per_unit_area_start_row_number + 2 ~ per_unit_area_start_row_number + 2 + ca_len : table_data
|
||||
|
@ -258,7 +258,7 @@ def generate_excel(report,
|
|||
per_unit_area_start_row_number = 9 + ca_len * 2
|
||||
|
||||
ws['B' + str(per_unit_area_start_row_number)].font = title_font
|
||||
ws['B' + str(per_unit_area_start_row_number)] = name + ' 单位面积值' + str(report['shopfloor']['area']) + 'M²'
|
||||
ws['B' + str(per_unit_area_start_row_number)] = name + ' ' + 'Per Unit Area' + str(report['shopfloor']['area']) + 'M²'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -266,17 +266,17 @@ def generate_excel(report,
|
|||
ws['B' + str(per_unit_area_start_row_number + 1)].fill = table_fill
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)] = '报告期'
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)] = 'Reporting Period'
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)] = '平均负荷'
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)] = 'Average Load'
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)] = '最大负荷'
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)] = 'Maximum Load'
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -306,7 +306,7 @@ def generate_excel(report,
|
|||
ws['D' + str(row_data)].number_format = '0.00'
|
||||
|
||||
####################################################################################################################
|
||||
# Third: 详细数据
|
||||
# Third: Detailed Data
|
||||
# analysis_end_row_number~ analysis_end_row_number + 6*cal_len: line
|
||||
# detailed_start_row_number: table title
|
||||
# detailed_start_row_number + 1~: table_data
|
||||
|
@ -333,12 +333,12 @@ def generate_excel(report,
|
|||
detail_data_table_start_row_number = current_row_number + (ca_len + parameters_parameters_datas_len) * 6 + 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
# table_title
|
||||
ws['B' + str(detail_data_table_start_row_number)].fill = table_fill
|
||||
ws['B' + str(detail_data_table_start_row_number)].font = name_font
|
||||
ws['B' + str(detail_data_table_start_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(detail_data_table_start_row_number)] = "日期时间"
|
||||
ws['B' + str(detail_data_table_start_row_number)] = "Datetime"
|
||||
ws['B' + str(detail_data_table_start_row_number)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -348,13 +348,13 @@ def generate_excel(report,
|
|||
ws[col_average + str(detail_data_table_start_row_number)].font = name_font
|
||||
ws[col_average + str(detail_data_table_start_row_number)].alignment = c_c_alignment
|
||||
ws[col_average + str(detail_data_table_start_row_number)] = \
|
||||
names[i] + " 平均负荷(" + reporting_period_data['units'][i] + "/H)"
|
||||
names[i] + " Average Load(" + reporting_period_data['units'][i] + "/H)"
|
||||
ws[col_average + str(detail_data_table_start_row_number)].border = f_border
|
||||
|
||||
ws[col_maximum + str(detail_data_table_start_row_number)].font = name_font
|
||||
ws[col_maximum + str(detail_data_table_start_row_number)].alignment = c_c_alignment
|
||||
ws[col_maximum + str(detail_data_table_start_row_number)] = \
|
||||
names[i] + " 最大负荷(" + reporting_period_data['units'][i] + "/H)"
|
||||
names[i] + " Maximum Load(" + reporting_period_data['units'][i] + "/H)"
|
||||
ws[col_maximum + str(detail_data_table_start_row_number)].border = f_border
|
||||
# table_date
|
||||
for i in range(0, time_len):
|
||||
|
@ -390,7 +390,7 @@ def generate_excel(report,
|
|||
####################################################################################################################
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = "报告期 最大负荷 - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.title = "Reporting Period Maximum Load - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.style = 10
|
||||
line.x_axis.majorTickMark = 'in'
|
||||
line.y_axis.majorTickMark = 'in'
|
||||
|
@ -501,7 +501,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -557,7 +557,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -171,7 +171,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期节约'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Savings'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -190,7 +190,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = \
|
||||
reporting_period_data['names'][i] + " (基线-实际) (" + reporting_period_data['units'][i] + ")"
|
||||
reporting_period_data['names'][i] + " (Baseline - Actual) (" + reporting_period_data['units'][i] + ")"
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -198,7 +198,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '吨标准煤 (基线-实际) (TCE)'
|
||||
ws[col + str(current_row_number)] = 'Ton of Standard Coal (Baseline - Actual) (TCE)'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -206,7 +206,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '吨二氧化碳排放 (基线-实际) (TCO2E)'
|
||||
ws[col + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions (Baseline - Actual) (TCO2E)'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -215,7 +215,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '节约'
|
||||
ws['B' + str(current_row_number)] = 'Savings'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -246,7 +246,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '单位面积值'
|
||||
ws['B' + str(current_row_number)] = 'Per Unit Area'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -278,7 +278,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -313,7 +313,7 @@ def generate_excel(report,
|
|||
current_row_number += 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨标准煤(TCE)占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -327,13 +327,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '节约'
|
||||
ws['C' + str(current_row_number)] = 'Savings'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '吨标准煤(TCE) 节约占比'
|
||||
ws['D' + str(current_row_number)] = 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -367,7 +367,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 吨标准煤(TCE)占比'
|
||||
pie.title = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -382,7 +382,7 @@ def generate_excel(report,
|
|||
ws.add_chart(pie, 'E' + str(chart_start_row_number))
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨二氧化碳排放(TCO2E)占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -396,13 +396,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '节约'
|
||||
ws['C' + str(current_row_number)] = 'Savings'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '吨二氧化碳排放(TCO2E) 节约占比'
|
||||
ws['D' + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -436,7 +436,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 吨二氧化碳排放(TCO2E)占比'
|
||||
pie.title = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -475,7 +475,7 @@ def generate_excel(report,
|
|||
parameters_parameters_datas_len = 0
|
||||
|
||||
ws['B' + str(current_row_number - 1)].font = title_font
|
||||
ws['B' + str(current_row_number - 1)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number - 1)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
for i in range(0, parameters_names_len):
|
||||
if len(report['parameters']['timestamps'][i]) == 0:
|
||||
|
@ -490,7 +490,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -527,7 +527,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -563,7 +563,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期节约 - ' + \
|
||||
line.title = 'Reporting Period Savings - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -673,7 +673,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -729,7 +729,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -150,7 +150,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 统计分析
|
||||
# First: Statistics
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~ca_len table_data
|
||||
|
@ -165,7 +165,7 @@ def generate_excel(report,
|
|||
return filename
|
||||
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 统计分析'
|
||||
ws['B6'] = name + ' ' + 'Statistics'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -173,37 +173,37 @@ def generate_excel(report,
|
|||
ws['B7'].fill = table_fill
|
||||
ws['B7'].font = title_font
|
||||
ws['B7'].alignment = c_c_alignment
|
||||
ws['B7'] = '报告期'
|
||||
ws['B7'] = 'Reporting Period'
|
||||
ws['B7'].border = f_border
|
||||
|
||||
ws['C7'].font = title_font
|
||||
ws['C7'].alignment = c_c_alignment
|
||||
ws['C7'] = '算术平均数'
|
||||
ws['C7'] = 'Arithmetic Mean'
|
||||
ws['C7'].border = f_border
|
||||
|
||||
ws['D7'].font = title_font
|
||||
ws['D7'].alignment = c_c_alignment
|
||||
ws['D7'] = '中位数'
|
||||
ws['D7'] = 'Median (Middle Value)'
|
||||
ws['D7'].border = f_border
|
||||
|
||||
ws['E7'].font = title_font
|
||||
ws['E7'].alignment = c_c_alignment
|
||||
ws['E7'] = '最小值'
|
||||
ws['E7'] = 'Minimum Value'
|
||||
ws['E7'].border = f_border
|
||||
|
||||
ws['F7'].font = title_font
|
||||
ws['F7'].alignment = c_c_alignment
|
||||
ws['F7'] = '最大值'
|
||||
ws['F7'] = 'Maximum Value'
|
||||
ws['F7'].border = f_border
|
||||
|
||||
ws['G7'].font = title_font
|
||||
ws['G7'].alignment = c_c_alignment
|
||||
ws['G7'] = '样本标准差'
|
||||
ws['G7'] = 'Sample Standard Deviation'
|
||||
ws['G7'].border = f_border
|
||||
|
||||
ws['H7'].font = title_font
|
||||
ws['H7'].alignment = c_c_alignment
|
||||
ws['H7'] = '样本方差'
|
||||
ws['H7'] = 'Sample Variance'
|
||||
ws['H7'].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -217,7 +217,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(row + 1)].font = name_font
|
||||
ws['B' + str(row + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(row + 1)] = "环比"
|
||||
ws['B' + str(row + 1)] = 'Increment Rate'
|
||||
ws['B' + str(row + 1)].border = f_border
|
||||
|
||||
ws['C' + str(row)].font = name_font
|
||||
|
@ -298,7 +298,7 @@ def generate_excel(report,
|
|||
if reporting_period_data['variances_increment_rate'][i] is not None else '0.00%'
|
||||
ws['H' + str(row + 1)].border = f_border
|
||||
####################################################################################################################
|
||||
# Second: 报告期消耗
|
||||
# Second: Reporting Period Consumption
|
||||
# 9 + ca_len * 2: title
|
||||
# 10 + ca_len * 2: table title
|
||||
# per_unit_area_start_row_number + 2 ~ per_unit_area_start_row_number + 2 + ca_len : table_data
|
||||
|
@ -310,7 +310,7 @@ def generate_excel(report,
|
|||
per_unit_area_start_row_number = 9 + ca_len * 2
|
||||
|
||||
ws['B' + str(per_unit_area_start_row_number)].font = title_font
|
||||
ws['B' + str(per_unit_area_start_row_number)] = name + ' 单位面积值' + str(report['shopfloor']['area']) + 'M²'
|
||||
ws['B' + str(per_unit_area_start_row_number)] = name + ' ' + 'Per Unit Area' + str(report['shopfloor']['area']) + 'M²'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -318,37 +318,37 @@ def generate_excel(report,
|
|||
ws['B' + str(per_unit_area_start_row_number + 1)].fill = table_fill
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)] = '报告期'
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)] = 'Reporting Period'
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)] = '算术平均数'
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)] = 'Arithmetic Mean'
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)] = '中位数'
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)] = 'Median (Middle Value)'
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)] = '最小值'
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)] = 'Minimum Value'
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)] = '最大值'
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)] = 'Maximum Value'
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)] = '样本标准差'
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)] = 'Sample Standard Deviation'
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)] = '样本方差'
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)] = 'Sample Variance'
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -410,7 +410,7 @@ def generate_excel(report,
|
|||
ws['H' + str(row_data)].number_format = '0.00'
|
||||
|
||||
####################################################################################################################
|
||||
# Third: 详细数据
|
||||
# Third: Detailed Data
|
||||
# detailed_start_row_number~ detailed_start_row_number+time_len: line
|
||||
# detailed_start_row_number+1: table title
|
||||
# i + analysis_end_row_number + 2 + 6 * ca_len~: table_data
|
||||
|
@ -438,12 +438,12 @@ def generate_excel(report,
|
|||
detail_data_table_start_row_number = current_row_number + (ca_len + parameters_parameters_datas_len) * 6 + 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
# table_title
|
||||
ws['B' + str(detail_data_table_start_row_number)].fill = table_fill
|
||||
ws['B' + str(detail_data_table_start_row_number)].font = name_font
|
||||
ws['B' + str(detail_data_table_start_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(detail_data_table_start_row_number)] = "时间"
|
||||
ws['B' + str(detail_data_table_start_row_number)] = 'Datetime'
|
||||
ws['B' + str(detail_data_table_start_row_number)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -472,11 +472,11 @@ def generate_excel(report,
|
|||
ws[col + str(rows)].number_format = '0.00'
|
||||
ws[col + str(rows)].border = f_border
|
||||
|
||||
# 小计
|
||||
# Subtotal
|
||||
row_subtotals = detail_data_table_start_row_number + 1 + time_len
|
||||
ws['B' + str(row_subtotals)].font = name_font
|
||||
ws['B' + str(row_subtotals)].alignment = c_c_alignment
|
||||
ws['B' + str(row_subtotals)] = "小计"
|
||||
ws['B' + str(row_subtotals)] = 'Subtotal'
|
||||
ws['B' + str(row_subtotals)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -496,7 +496,7 @@ def generate_excel(report,
|
|||
for i in range(0, ca_len):
|
||||
|
||||
line = LineChart()
|
||||
line.title = "报告期消耗" + " - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.title = "Reporting Period Consumption" + " - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.style = 10
|
||||
line.x_axis.majorTickMark = 'in'
|
||||
line.y_axis.majorTickMark = 'in'
|
||||
|
@ -606,7 +606,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -662,7 +662,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -169,7 +169,7 @@ def generate_excel(report,
|
|||
|
||||
if has_cost_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 报告期成本'
|
||||
ws['B6'] = name + ' ' + 'Reporting Period Costs'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
@ -180,17 +180,17 @@ def generate_excel(report,
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '成本'
|
||||
ws['B8'] = 'Cost'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '单位面积值'
|
||||
ws['B9'] = 'Per Unit Area'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
ws['B10'].font = title_font
|
||||
ws['B10'].alignment = c_c_alignment
|
||||
ws['B10'] = '环比'
|
||||
ws['B10'] = 'Increment Rate'
|
||||
ws['B10'].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -225,7 +225,7 @@ def generate_excel(report,
|
|||
ws[col + '7'].fill = table_fill
|
||||
ws[col + '7'].font = name_font
|
||||
ws[col + '7'].alignment = c_c_alignment
|
||||
ws[col + '7'] = "总计 (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[col + '7'] = "Total (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[col + '7'].border = f_border
|
||||
|
||||
ws[col + '8'].font = name_font
|
||||
|
@ -258,7 +258,7 @@ def generate_excel(report,
|
|||
|
||||
if has_ele_peak_flag:
|
||||
ws['B12'].font = title_font
|
||||
ws['B12'] = name + ' 分时用电成本'
|
||||
ws['B12'] = name + ' ' + 'Electricity Cost by Time-Of-Use'
|
||||
|
||||
ws.row_dimensions[13].height = 60
|
||||
ws['B13'].fill = table_fill
|
||||
|
@ -270,11 +270,11 @@ def generate_excel(report,
|
|||
ws['C13'].font = name_font
|
||||
ws['C13'].alignment = c_c_alignment
|
||||
ws['C13'].border = f_border
|
||||
ws['C13'] = '分时用电成本'
|
||||
ws['C13'] = 'Electricity Cost by Time-Of-Use'
|
||||
|
||||
ws['B14'].font = title_font
|
||||
ws['B14'].alignment = c_c_alignment
|
||||
ws['B14'] = '尖'
|
||||
ws['B14'] = 'TopPeak'
|
||||
ws['B14'].border = f_border
|
||||
|
||||
ws['C14'].font = title_font
|
||||
|
@ -284,7 +284,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B15'].font = title_font
|
||||
ws['B15'].alignment = c_c_alignment
|
||||
ws['B15'] = '峰'
|
||||
ws['B15'] = 'OnPeak'
|
||||
ws['B15'].border = f_border
|
||||
|
||||
ws['C15'].font = title_font
|
||||
|
@ -294,7 +294,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B16'].font = title_font
|
||||
ws['B16'].alignment = c_c_alignment
|
||||
ws['B16'] = '平'
|
||||
ws['B16'] = 'MidPeak'
|
||||
ws['B16'].border = f_border
|
||||
|
||||
ws['C16'].font = title_font
|
||||
|
@ -304,7 +304,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B17'].font = title_font
|
||||
ws['B17'].alignment = c_c_alignment
|
||||
ws['B17'] = '谷'
|
||||
ws['B17'] = 'OffPeak'
|
||||
ws['B17'].border = f_border
|
||||
|
||||
ws['C17'].font = title_font
|
||||
|
@ -313,7 +313,7 @@ def generate_excel(report,
|
|||
ws['C17'] = round(reporting_period_data['offpeaks'][0], 2)
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + '分时用电成本'
|
||||
pie.title = name + 'Electricity Cost by Time-Of-Use'
|
||||
labels = Reference(ws, min_col=2, min_row=14, max_row=17)
|
||||
pie_data = Reference(ws, min_col=3, min_row=13, max_row=17)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -344,7 +344,7 @@ def generate_excel(report,
|
|||
|
||||
if has_subtotals_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 成本占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Costs Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -358,7 +358,7 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '成本占比'
|
||||
ws['C' + str(current_row_number)] = 'Costs Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -382,7 +382,7 @@ def generate_excel(report,
|
|||
table_end_row_number = current_row_number - 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 成本占比'
|
||||
pie.title = name + ' ' + 'Costs Proportion'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -418,14 +418,14 @@ def generate_excel(report,
|
|||
|
||||
if has_detail_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[table_row].height = 60
|
||||
ws['B' + str(table_row)].fill = table_fill
|
||||
ws['B' + str(table_row)].font = title_font
|
||||
ws['B' + str(table_row)].border = f_border
|
||||
ws['B' + str(table_row)].alignment = c_c_alignment
|
||||
ws['B' + str(table_row)] = '日期时间'
|
||||
ws['B' + str(table_row)] = 'Datetime'
|
||||
time = times[0]
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -466,7 +466,7 @@ def generate_excel(report,
|
|||
|
||||
line = LineChart()
|
||||
line.title = \
|
||||
'报告期成本 - ' + reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
'Reporting Period Costs - ' + reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_row + 1, max_row=max_row)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_row, max_row=max_row)
|
||||
line.add_data(line_data, titles_from_data=True)
|
||||
|
@ -490,7 +490,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + row].font = title_font
|
||||
ws['B' + row].alignment = c_c_alignment
|
||||
ws['B' + row] = '小计'
|
||||
ws['B' + row] = 'Subtotal'
|
||||
ws['B' + row].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -508,7 +508,7 @@ def generate_excel(report,
|
|||
ws[col + str(table_row)].fill = table_fill
|
||||
ws[col + str(table_row)].font = title_font
|
||||
ws[col + str(table_row)].alignment = c_c_alignment
|
||||
ws[col + str(table_row)] = '总计 (' + report['reporting_period']['total_unit'] + ')'
|
||||
ws[col + str(table_row)] = 'Total (' + report['reporting_period']['total_unit'] + ')'
|
||||
ws[col + str(table_row)].border = f_border
|
||||
|
||||
total_sum = 0
|
||||
|
@ -546,7 +546,7 @@ def generate_excel(report,
|
|||
child = report['child_space']
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 子空间数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Child Spaces Data'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -556,7 +556,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = name_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '子空间'
|
||||
ws['B' + str(current_row_number)] = 'Child Space'
|
||||
ca_len = len(child['energy_category_names'])
|
||||
|
||||
col = ''
|
||||
|
@ -567,14 +567,14 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = child['energy_category_names'][i] + ' (' + child['units'][i] + ')'
|
||||
ws[col + str(current_row_number)] = child['energy_category_names'][i] + ' ' + '(' + child['units'][i] + ')'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
ws[col + str(current_row_number)].fill = table_fill
|
||||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '总计 (' + report['reporting_period']['total_unit'] + ')'
|
||||
ws[col + str(current_row_number)] = 'Total (' + report['reporting_period']['total_unit'] + ')'
|
||||
|
||||
space_len = len(child['child_space_names_array'][0])
|
||||
|
||||
|
@ -722,7 +722,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -778,7 +778,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -170,7 +170,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期累积效率'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Cumulative Efficiency'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -198,7 +198,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '累积效率'
|
||||
ws['B' + str(current_row_number)] = 'Cumulative Efficiency'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -216,7 +216,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -273,7 +273,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期累积效率'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Cumulative Efficiency'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -287,7 +287,7 @@ def generate_excel(report,
|
|||
current_row_number += 6*real_timestamps_len + 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -298,7 +298,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -335,7 +335,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -372,7 +372,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期累积效率 - ' + \
|
||||
line.title = 'Reporting Period Cumulative Efficiency - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -465,7 +465,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -521,7 +521,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -169,7 +169,7 @@ def generate_excel(report,
|
|||
|
||||
if has_energy_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name+' 报告期消耗'
|
||||
ws['B6'] = name + ' ' + 'Reporting Period Consumption'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
@ -179,17 +179,17 @@ def generate_excel(report,
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '能耗'
|
||||
ws['B8'] = 'Consumption'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '单位面积值'
|
||||
ws['B9'] = 'Per Unit Area'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
ws['B10'].font = title_font
|
||||
ws['B10'].alignment = c_c_alignment
|
||||
ws['B10'] = '环比'
|
||||
ws['B10'] = 'Increment Rate'
|
||||
ws['B10'].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -225,7 +225,7 @@ def generate_excel(report,
|
|||
ws[tce_col + '7'].fill = table_fill
|
||||
ws[tce_col + '7'].font = name_font
|
||||
ws[tce_col + '7'].alignment = c_c_alignment
|
||||
ws[tce_col + '7'] = "吨标准煤 (TCE)"
|
||||
ws[tce_col + '7'] = 'Ton of Standard Coal (TCE)'
|
||||
ws[tce_col + '7'].border = f_border
|
||||
|
||||
ws[tce_col + '8'].font = name_font
|
||||
|
@ -249,7 +249,7 @@ def generate_excel(report,
|
|||
ws[tco2e_col + '7'].fill = table_fill
|
||||
ws[tco2e_col + '7'].font = name_font
|
||||
ws[tco2e_col + '7'].alignment = c_c_alignment
|
||||
ws[tco2e_col + '7'] = "吨二氧化碳排放 (TCO2E)"
|
||||
ws[tco2e_col + '7'] = 'Ton of Carbon Dioxide Emissions (TCO2E)'
|
||||
ws[tco2e_col + '7'].border = f_border
|
||||
|
||||
ws[tco2e_col + '8'].font = name_font
|
||||
|
@ -281,7 +281,7 @@ def generate_excel(report,
|
|||
|
||||
if has_ele_peak_flag:
|
||||
ws['B12'].font = title_font
|
||||
ws['B12'] = name+' 分时电耗'
|
||||
ws['B12'] = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws['B13'].fill = table_fill
|
||||
ws['B13'].font = name_font
|
||||
|
@ -292,11 +292,11 @@ def generate_excel(report,
|
|||
ws['C13'].font = name_font
|
||||
ws['C13'].alignment = c_c_alignment
|
||||
ws['C13'].border = f_border
|
||||
ws['C13'] = '分时电耗'
|
||||
ws['C13'] = 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws['B14'].font = title_font
|
||||
ws['B14'].alignment = c_c_alignment
|
||||
ws['B14'] = '尖'
|
||||
ws['B14'] = 'TopPeak'
|
||||
ws['B14'].border = f_border
|
||||
|
||||
ws['C14'].font = title_font
|
||||
|
@ -306,7 +306,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B15'].font = title_font
|
||||
ws['B15'].alignment = c_c_alignment
|
||||
ws['B15'] = '峰'
|
||||
ws['B15'] = 'OnPeak'
|
||||
ws['B15'].border = f_border
|
||||
|
||||
ws['C15'].font = title_font
|
||||
|
@ -316,7 +316,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B16'].font = title_font
|
||||
ws['B16'].alignment = c_c_alignment
|
||||
ws['B16'] = '平'
|
||||
ws['B16'] = 'MidPeak'
|
||||
ws['B16'].border = f_border
|
||||
|
||||
ws['C16'].font = title_font
|
||||
|
@ -326,7 +326,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B17'].font = title_font
|
||||
ws['B17'].alignment = c_c_alignment
|
||||
ws['B17'] = '谷'
|
||||
ws['B17'] = 'OffPeak'
|
||||
ws['B17'].border = f_border
|
||||
|
||||
ws['C17'].font = title_font
|
||||
|
@ -335,7 +335,7 @@ def generate_excel(report,
|
|||
ws['C17'] = round(reporting_period_data['offpeaks'][0], 2)
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 分时电耗'
|
||||
pie.title = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
labels = Reference(ws, min_col=2, min_row=14, max_row=17)
|
||||
pie_data = Reference(ws, min_col=3, min_row=13, max_row=17)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -365,7 +365,7 @@ def generate_excel(report,
|
|||
|
||||
if has_kgce_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨标准煤 (TCE) 占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -380,7 +380,7 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '吨标准煤 (TCE) 占比'
|
||||
ws['C' + str(current_row_number)] = 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -433,7 +433,7 @@ def generate_excel(report,
|
|||
|
||||
if has_kgco2e_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨二氧化碳排放 (TCO2E) 占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -448,7 +448,7 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '吨二氧化碳排放 (TCO2E) 占比'
|
||||
ws['C' + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -503,7 +503,7 @@ def generate_excel(report,
|
|||
child = report['child_space']
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 子空间占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Child Spaces Data'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -513,7 +513,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = name_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '子空间'
|
||||
ws['B' + str(current_row_number)] = 'Child Space'
|
||||
ca_len = len(child['energy_category_names'])
|
||||
|
||||
col = ''
|
||||
|
@ -524,7 +524,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = child['energy_category_names'][i] + ' (' + child['units'][i] + ')'
|
||||
ws[col + str(current_row_number)] = child['energy_category_names'][i] + ' ' + '(' + child['units'][i] + ')'
|
||||
|
||||
space_len = len(child['child_space_names_array'][0])
|
||||
|
||||
|
@ -590,7 +590,7 @@ def generate_excel(report,
|
|||
ca_len = len(report['reporting_period']['names'])
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
table_start_row_number = (current_row_number + 2) + ca_len * 6 + real_timestamps_len * 7
|
||||
current_row_number = table_start_row_number
|
||||
|
@ -608,7 +608,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -642,7 +642,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -654,7 +654,7 @@ def generate_excel(report,
|
|||
|
||||
# line
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + ws.cell(column=3+i, row=table_start_row_number).value
|
||||
line.title = 'Reporting Period Consumption - ' + ws.cell(column=3+i, row=table_start_row_number).value
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
line.add_data(line_data, titles_from_data=True)
|
||||
|
@ -760,7 +760,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -816,7 +816,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -170,7 +170,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期消耗'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Consumption'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -216,7 +216,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '单位面积值'
|
||||
ws['B' + str(current_row_number)] = 'Per Unit Area'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -233,7 +233,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -255,8 +255,8 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = \
|
||||
name + ' ' + category_dict_name + ' (' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') 分项消耗占比'
|
||||
name + ' ' + category_dict_name + ' ' + '(' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') by Energy Item'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -289,8 +289,8 @@ def generate_excel(report,
|
|||
|
||||
pie = PieChart()
|
||||
pie.title = \
|
||||
name + ' ' + category_dict_name + ' (' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') 分项消耗占比'
|
||||
name + ' ' + category_dict_name + ' ' + '(' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') by Energy Item'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -330,7 +330,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -344,7 +344,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -381,7 +381,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -417,7 +417,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + \
|
||||
line.title = 'Reporting Period Consumption - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -456,7 +456,7 @@ def generate_excel(report,
|
|||
child = report['child_space']
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 子空间数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Child Spaces Data'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -466,7 +466,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = name_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '子空间'
|
||||
ws['B' + str(current_row_number)] = 'Child Space'
|
||||
ca_len = len(child['energy_item_names'])
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -614,7 +614,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -670,7 +670,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -169,7 +169,7 @@ def generate_excel(report,
|
|||
|
||||
if has_cost_data_flag:
|
||||
ws['B5'].font = title_font
|
||||
ws['B5'] = name + ' 报告期收入'
|
||||
ws['B5'] = name + ' ' + 'Reporting Period Income'
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
||||
|
@ -179,17 +179,17 @@ def generate_excel(report,
|
|||
|
||||
ws['B7'].font = title_font
|
||||
ws['B7'].alignment = c_c_alignment
|
||||
ws['B7'] = '报告期收入总计'
|
||||
ws['B7'] = 'Total'
|
||||
ws['B7'].border = f_border
|
||||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '单位面积值'
|
||||
ws['B8'] = 'Per Unit Area'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '环比'
|
||||
ws['B9'] = 'Increment Rate'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -224,7 +224,7 @@ def generate_excel(report,
|
|||
ws[col + '6'].fill = table_fill
|
||||
ws[col + '6'].font = name_font
|
||||
ws[col + '6'].alignment = c_c_alignment
|
||||
ws[col + '6'] = "总计 (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[col + '6'] = "Total (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[col + '6'].border = f_border
|
||||
|
||||
ws[col + '7'].font = name_font
|
||||
|
@ -256,7 +256,7 @@ def generate_excel(report,
|
|||
|
||||
if has_subtotals_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 收入占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Incomes by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -271,13 +271,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '收入'
|
||||
ws['C' + str(current_row_number)] = 'Incomes'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '收入占比'
|
||||
ws['D' + str(current_row_number)] = 'Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -308,7 +308,7 @@ def generate_excel(report,
|
|||
table_end_row_number = current_row_number - 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 收入占比'
|
||||
pie.title = name + ' ' + 'Incomes by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -345,14 +345,14 @@ def generate_excel(report,
|
|||
if has_detail_data_flag:
|
||||
current_end_row_number += ca_len * 6 + 1
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[table_row].height = 60
|
||||
ws['B' + str(table_row)].fill = table_fill
|
||||
ws['B' + str(table_row)].font = title_font
|
||||
ws['B' + str(table_row)].border = f_border
|
||||
ws['B' + str(table_row)].alignment = c_c_alignment
|
||||
ws['B' + str(table_row)] = '日期时间'
|
||||
ws['B' + str(table_row)] = 'Datetime'
|
||||
time = times[0]
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -394,7 +394,7 @@ def generate_excel(report,
|
|||
|
||||
line = LineChart()
|
||||
line.title = \
|
||||
'报告期收入 - ' + reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
'Reporting Period Income - ' + reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_row + 1, max_row=max_row)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_row, max_row=max_row)
|
||||
line.add_data(line_data, titles_from_data=True)
|
||||
|
@ -418,7 +418,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + row].font = title_font
|
||||
ws['B' + row].alignment = c_c_alignment
|
||||
ws['B' + row] = '小计'
|
||||
ws['B' + row] = 'Subtotal'
|
||||
ws['B' + row].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -436,7 +436,7 @@ def generate_excel(report,
|
|||
ws[col + str(table_row)].fill = table_fill
|
||||
ws[col + str(table_row)].font = title_font
|
||||
ws[col + str(table_row)].alignment = c_c_alignment
|
||||
ws[col + str(table_row)] = '总计 (' + report['reporting_period']['total_unit'] + ')'
|
||||
ws[col + str(table_row)] = 'Total (' + report['reporting_period']['total_unit'] + ')'
|
||||
ws[col + str(table_row)].border = f_border
|
||||
|
||||
total_sum = Decimal(0.0)
|
||||
|
@ -474,7 +474,7 @@ def generate_excel(report,
|
|||
child = report['child_space']
|
||||
current_row_number = int(row) + 1
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 子空间数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Child Spaces Data'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -484,7 +484,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = name_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '子空间'
|
||||
ws['B' + str(current_row_number)] = 'Child Space'
|
||||
ca_len = len(child['energy_category_names'])
|
||||
|
||||
col = ''
|
||||
|
@ -495,14 +495,14 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = child['energy_category_names'][i] + ' (' + child['units'][i] + ')'
|
||||
ws[col + str(current_row_number)] = child['energy_category_names'][i] + ' ' + '(' + child['units'][i] + ')'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
ws[col + str(current_row_number)].fill = table_fill
|
||||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '总计 (' + report['reporting_period']['total_unit'] + ')'
|
||||
ws[col + str(current_row_number)] = 'Total (' + report['reporting_period']['total_unit'] + ')'
|
||||
|
||||
space_len = len(child['child_space_names_array'][0])
|
||||
|
||||
|
@ -653,7 +653,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -709,7 +709,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -165,7 +165,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ca_len = len(category)
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + '报告期平均负荷'
|
||||
ws['B' + str(current_row_number)] = name + 'Reporting Period Average Load'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -186,7 +186,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '平均负荷'
|
||||
ws['B' + str(current_row_number)] = 'Average Load'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -201,7 +201,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '单位面积值'
|
||||
ws['B' + str(current_row_number)] = 'Per Unit Area'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -216,7 +216,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -230,7 +230,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
current_row_number += 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + '报告期最大负荷'
|
||||
ws['B' + str(current_row_number)] = name + 'Reporting Period Maximum Load'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -251,7 +251,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '最大负荷'
|
||||
ws['B' + str(current_row_number)] = 'Maximum Load'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -266,7 +266,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '单位面积值'
|
||||
ws['B' + str(current_row_number)] = 'Per Unit Area'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -281,7 +281,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -295,7 +295,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
current_row_number += 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + '报告期负荷系数'
|
||||
ws['B' + str(current_row_number)] = name + 'Reporting Period Load Factor'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -315,7 +315,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '负荷系数'
|
||||
ws['B' + str(current_row_number)] = 'Load Factor'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -330,7 +330,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -360,7 +360,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
time = times[0]
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + '详细数据'
|
||||
ws['B' + str(current_row_number)] = name + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
chart_start_number = current_row_number
|
||||
|
@ -378,7 +378,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -389,7 +389,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = reporting_period_data['names'][i] + \
|
||||
" 平均负荷(" + reporting_period_data['units'][i] + "/H)"
|
||||
" Average Load(" + reporting_period_data['units'][i] + "/H)"
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
if has_sub_maximums_data_flag:
|
||||
|
@ -398,7 +398,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = reporting_period_data['names'][i] + \
|
||||
" 最大负荷(" + reporting_period_data['units'][i] + "/H)"
|
||||
" Maximum Load(" + reporting_period_data['units'][i] + "/H)"
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
current_row_number += 1
|
||||
|
@ -440,7 +440,8 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
if has_sub_averages_data_flag:
|
||||
line = LineChart()
|
||||
line.title = '报告期 平均负荷 - ' + ws.cell(column=current_chart_col_number, row=table_start_number).value
|
||||
line.title = 'Reporting Period Average Load - ' + ws.cell(column=current_chart_col_number,
|
||||
row=table_start_number).value
|
||||
datas = Reference(ws, min_col=current_chart_col_number, min_row=table_start_number,
|
||||
max_row=table_end_number)
|
||||
line.add_data(datas, titles_from_data=True)
|
||||
|
@ -460,7 +461,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
if has_sub_maximums_data_flag:
|
||||
line = LineChart()
|
||||
line.title = '报告期 最大负荷 - ' + ws.cell(column=current_chart_col_number, row=table_start_number).value
|
||||
line.title = 'Reporting Period Maximum Load - ' + ws.cell(column=current_chart_col_number, row=table_start_number).value
|
||||
datas = Reference(ws, min_col=current_chart_col_number, min_row=table_start_number,
|
||||
max_row=table_end_number)
|
||||
line.add_data(datas, titles_from_data=True)
|
||||
|
@ -560,7 +561,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -616,7 +617,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -169,7 +169,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期产出'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Output'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -197,7 +197,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '产出'
|
||||
ws['B' + str(current_row_number)] = 'Output'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -214,7 +214,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '单位面积值'
|
||||
ws['B' + str(current_row_number)] = 'Per Unit Area'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -231,7 +231,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -268,7 +268,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -282,7 +282,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -319,7 +319,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -355,7 +355,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期产出 - ' + \
|
||||
line.title = 'Reporting Period Output - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -394,7 +394,7 @@ def generate_excel(report,
|
|||
child = report['child_space']
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 子空间数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Child Spaces Data'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -549,7 +549,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -605,7 +605,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -171,7 +171,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期节约'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Savings'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -190,7 +190,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = \
|
||||
reporting_period_data['names'][i] + " (基线-实际) (" + reporting_period_data['units'][i] + ")"
|
||||
reporting_period_data['names'][i] + " (Baseline - Actual) (" + reporting_period_data['units'][i] + ")"
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -198,7 +198,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '吨标准煤 (基线-实际) (TCE)'
|
||||
ws[col + str(current_row_number)] = 'Ton of Standard Coal (Baseline - Actual) (TCE)'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -206,7 +206,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '吨二氧化碳排放 (基线-实际) (TCO2E)'
|
||||
ws[col + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions (Baseline - Actual) (TCO2E)'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -215,7 +215,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '节约'
|
||||
ws['B' + str(current_row_number)] = 'Savings'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -246,7 +246,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '单位面积值'
|
||||
ws['B' + str(current_row_number)] = 'Per Unit Area'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -278,7 +278,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -313,7 +313,7 @@ def generate_excel(report,
|
|||
current_row_number += 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨标准煤(TCE)占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -327,13 +327,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '节约'
|
||||
ws['C' + str(current_row_number)] = 'Savings'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '吨标准煤(TCE) 节约占比'
|
||||
ws['D' + str(current_row_number)] = 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -367,7 +367,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 吨标准煤(TCE)占比'
|
||||
pie.title = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -382,7 +382,7 @@ def generate_excel(report,
|
|||
ws.add_chart(pie, 'E' + str(chart_start_row_number))
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨二氧化碳排放(TCO2E)占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -396,13 +396,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '节约'
|
||||
ws['C' + str(current_row_number)] = 'Savings'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '吨二氧化碳排放(TCO2E) 节约占比'
|
||||
ws['D' + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -436,7 +436,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 吨二氧化碳排放(TCO2E)占比'
|
||||
pie.title = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -471,7 +471,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -485,7 +485,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -522,7 +522,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -558,7 +558,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期节约 - ' + \
|
||||
line.title = 'Reporting Period Savings - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -598,7 +598,7 @@ def generate_excel(report,
|
|||
ca_len = len(child_space_data['energy_category_names'])
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 子空间数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Child Spaces Data'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -608,7 +608,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = name_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '子空间'
|
||||
ws['B' + str(current_row_number)] = 'Child Space'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -758,7 +758,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -814,7 +814,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -151,7 +151,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 统计分析
|
||||
# First: Statistics
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~ca_len table_data
|
||||
|
@ -166,7 +166,7 @@ def generate_excel(report,
|
|||
return filename
|
||||
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 统计分析'
|
||||
ws['B6'] = name + ' ' + 'Statistics'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -174,37 +174,37 @@ def generate_excel(report,
|
|||
ws['B7'].fill = table_fill
|
||||
ws['B7'].font = title_font
|
||||
ws['B7'].alignment = c_c_alignment
|
||||
ws['B7'] = '报告期'
|
||||
ws['B7'] = 'Reporting Period'
|
||||
ws['B7'].border = f_border
|
||||
|
||||
ws['C7'].font = title_font
|
||||
ws['C7'].alignment = c_c_alignment
|
||||
ws['C7'] = '算术平均数'
|
||||
ws['C7'] = 'Arithmetic Mean'
|
||||
ws['C7'].border = f_border
|
||||
|
||||
ws['D7'].font = title_font
|
||||
ws['D7'].alignment = c_c_alignment
|
||||
ws['D7'] = '中位数'
|
||||
ws['D7'] = 'Median (Middle Value)'
|
||||
ws['D7'].border = f_border
|
||||
|
||||
ws['E7'].font = title_font
|
||||
ws['E7'].alignment = c_c_alignment
|
||||
ws['E7'] = '最小值'
|
||||
ws['E7'] = 'Minimum Value'
|
||||
ws['E7'].border = f_border
|
||||
|
||||
ws['F7'].font = title_font
|
||||
ws['F7'].alignment = c_c_alignment
|
||||
ws['F7'] = '最大值'
|
||||
ws['F7'] = 'Maximum Value'
|
||||
ws['F7'].border = f_border
|
||||
|
||||
ws['G7'].font = title_font
|
||||
ws['G7'].alignment = c_c_alignment
|
||||
ws['G7'] = '样本标准差'
|
||||
ws['G7'] = 'Sample Standard Deviation'
|
||||
ws['G7'].border = f_border
|
||||
|
||||
ws['H7'].font = title_font
|
||||
ws['H7'].alignment = c_c_alignment
|
||||
ws['H7'] = '样本方差'
|
||||
ws['H7'] = 'Sample Variance'
|
||||
ws['H7'].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -218,7 +218,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(row + 1)].font = name_font
|
||||
ws['B' + str(row + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(row + 1)] = "环比"
|
||||
ws['B' + str(row + 1)] = 'Increment Rate'
|
||||
ws['B' + str(row + 1)].border = f_border
|
||||
|
||||
ws['C' + str(row)].font = name_font
|
||||
|
@ -299,7 +299,7 @@ def generate_excel(report,
|
|||
if reporting_period_data['variances_increment_rate'][i] is not None else '0.00%'
|
||||
ws['H' + str(row + 1)].border = f_border
|
||||
####################################################################################################################
|
||||
# Second: 报告期消耗
|
||||
# Second: Reporting Period Consumption
|
||||
# 9 + ca_len * 2: title
|
||||
# 10 + ca_len * 2: table title
|
||||
# per_unit_area_start_row_number + 2 ~ per_unit_area_start_row_number + 2 + ca_len : table_data
|
||||
|
@ -311,7 +311,7 @@ def generate_excel(report,
|
|||
per_unit_area_start_row_number = 9 + ca_len * 2
|
||||
|
||||
ws['B' + str(per_unit_area_start_row_number)].font = title_font
|
||||
ws['B' + str(per_unit_area_start_row_number)] = name + ' 单位面积值'
|
||||
ws['B' + str(per_unit_area_start_row_number)] = name + ' ' + 'Per Unit Area'
|
||||
ws['D' + str(per_unit_area_start_row_number)].font = title_font
|
||||
ws['D' + str(per_unit_area_start_row_number)] = str(report['space']['area']) + 'M²'
|
||||
|
||||
|
@ -321,37 +321,37 @@ def generate_excel(report,
|
|||
ws['B' + str(per_unit_area_start_row_number + 1)].fill = table_fill
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)] = '报告期'
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)] = 'Reporting Period'
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)] = '算术平均数'
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)] = 'Arithmetic Mean'
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)] = '中位数'
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)] = 'Median (Middle Value)'
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)] = '最小值'
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)] = 'Minimum Value'
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)] = '最大值'
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)] = 'Maximum Value'
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)] = '样本标准差'
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)] = 'Sample Standard Deviation'
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)] = '样本方差'
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)] = 'Sample Variance'
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -413,7 +413,7 @@ def generate_excel(report,
|
|||
ws['H' + str(row_data)].number_format = '0.00'
|
||||
|
||||
####################################################################################################################
|
||||
# Third: 详细数据
|
||||
# Third: Detailed Data
|
||||
# analysis_end_row_number~ analysis_end_row_number+time_len: line
|
||||
# analysis_end_row_number+1+line_charts_row_number: table title
|
||||
# i + analysis_end_row_number + 2 + 10 * ca_len~: table_data
|
||||
|
@ -437,12 +437,12 @@ def generate_excel(report,
|
|||
detailed_start_row_number = analysis_end_row_number + line_charts_row_number + 1
|
||||
|
||||
ws['B' + str(detailed_start_row_number)].font = title_font
|
||||
ws['B' + str(detailed_start_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(detailed_start_row_number)] = name + ' ' + 'Detailed Data'
|
||||
# table_title
|
||||
ws['B' + str(detailed_start_row_number + 1)].fill = table_fill
|
||||
ws['B' + str(detailed_start_row_number + 1)].font = name_font
|
||||
ws['B' + str(detailed_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(detailed_start_row_number + 1)] = "时间"
|
||||
ws['B' + str(detailed_start_row_number + 1)] = 'Datetime'
|
||||
ws['B' + str(detailed_start_row_number + 1)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -470,11 +470,11 @@ def generate_excel(report,
|
|||
ws[col + str(rows)].number_format = '0.00'
|
||||
ws[col + str(rows)].border = f_border
|
||||
|
||||
# 小计
|
||||
# Subtotal
|
||||
row_subtotals = detailed_start_row_number + 2 + time_len
|
||||
ws['B' + str(row_subtotals)].font = name_font
|
||||
ws['B' + str(row_subtotals)].alignment = c_c_alignment
|
||||
ws['B' + str(row_subtotals)] = "小计"
|
||||
ws['B' + str(row_subtotals)] = 'Subtotal'
|
||||
ws['B' + str(row_subtotals)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -494,7 +494,7 @@ def generate_excel(report,
|
|||
for i in range(0, ca_len):
|
||||
|
||||
line = LineChart()
|
||||
line.title = "报告期消耗" + " - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.title = "Reporting Period Consumption" + " - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.style = 10
|
||||
line.x_axis.majorTickMark = 'in'
|
||||
line.y_axis.majorTickMark = 'in'
|
||||
|
@ -599,7 +599,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -655,7 +655,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
data_font = Font(name='Franklin Gothic Book', size=11)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
|
@ -116,7 +116,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
ws['B3'].font = name_font
|
||||
ws['B3'].alignment = b_r_alignment
|
||||
ws['B3'] = '空间:'
|
||||
ws['B3'] = 'Space:'
|
||||
ws['C3'].border = b_border
|
||||
ws['C3'].alignment = b_c_alignment
|
||||
ws['C3'].font = name_font
|
||||
|
@ -124,7 +124,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
ws['F3'].font = name_font
|
||||
ws['F3'].alignment = b_r_alignment
|
||||
ws['F3'] = '日期:'
|
||||
ws['F3'] = 'Datetime:'
|
||||
ws['G3'].border = b_border
|
||||
ws['G3'].alignment = b_c_alignment
|
||||
ws['G3'].font = name_font
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import base64
|
||||
import uuid
|
||||
import os
|
||||
from decimal import Decimal
|
||||
from openpyxl.chart import PieChart, Reference, LineChart
|
||||
from openpyxl.styles import PatternFill, Border, Side, Alignment, Font
|
||||
from openpyxl.drawing.image import Image
|
||||
|
@ -83,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -163,7 +164,7 @@ def generate_excel(report,
|
|||
|
||||
if has_energy_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name+' 报告期成本'
|
||||
ws['B6'] = name + ' ' + 'Reporting Period Costs'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
@ -172,17 +173,17 @@ def generate_excel(report,
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '成本'
|
||||
ws['B8'] = 'Cost'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '单位面积能耗'
|
||||
ws['B9'] = 'Per Unit Area'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
ws['B10'].font = title_font
|
||||
ws['B10'].alignment = c_c_alignment
|
||||
ws['B10'] = '环比'
|
||||
ws['B10'] = 'Increment Rate'
|
||||
ws['B10'].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -215,7 +216,7 @@ def generate_excel(report,
|
|||
ws[end_col + '7'].fill = table_fill
|
||||
ws[end_col + '7'].font = name_font
|
||||
ws[end_col + '7'].alignment = c_c_alignment
|
||||
ws[end_col + '7'] = "总计 (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + '7'] = "Total (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + '7'].border = f_border
|
||||
|
||||
ws[end_col + '8'].font = name_font
|
||||
|
@ -248,7 +249,7 @@ def generate_excel(report,
|
|||
|
||||
if has_ele_peak_flag:
|
||||
ws['B12'].font = title_font
|
||||
ws['B12'] = name+' 分时电耗'
|
||||
ws['B12'] = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws['B13'].fill = table_fill
|
||||
ws['B13'].font = name_font
|
||||
|
@ -259,11 +260,11 @@ def generate_excel(report,
|
|||
ws['C13'].font = name_font
|
||||
ws['C13'].alignment = c_c_alignment
|
||||
ws['C13'].border = f_border
|
||||
ws['C13'] = '分时电耗'
|
||||
ws['C13'] = 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws['B14'].font = title_font
|
||||
ws['B14'].alignment = c_c_alignment
|
||||
ws['B14'] = '尖'
|
||||
ws['B14'] = 'TopPeak'
|
||||
ws['B14'].border = f_border
|
||||
|
||||
ws['C14'].font = title_font
|
||||
|
@ -273,7 +274,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B15'].font = title_font
|
||||
ws['B15'].alignment = c_c_alignment
|
||||
ws['B15'] = '峰'
|
||||
ws['B15'] = 'OnPeak'
|
||||
ws['B15'].border = f_border
|
||||
|
||||
ws['C15'].font = title_font
|
||||
|
@ -283,7 +284,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B16'].font = title_font
|
||||
ws['B16'].alignment = c_c_alignment
|
||||
ws['B16'] = '平'
|
||||
ws['B16'] = 'MidPeak'
|
||||
ws['B16'].border = f_border
|
||||
|
||||
ws['C16'].font = title_font
|
||||
|
@ -293,7 +294,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B17'].font = title_font
|
||||
ws['B17'].alignment = c_c_alignment
|
||||
ws['B17'] = '谷'
|
||||
ws['B17'] = 'OffPeak'
|
||||
ws['B17'].border = f_border
|
||||
|
||||
ws['C17'].font = title_font
|
||||
|
@ -331,7 +332,7 @@ def generate_excel(report,
|
|||
|
||||
if has_subtotals_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 成本占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Costs Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -346,7 +347,7 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '成本占比'
|
||||
ws['C' + str(current_row_number)] = 'Costs Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -414,7 +415,7 @@ def generate_excel(report,
|
|||
detail_data_table_start_row_number = current_row_number + (ca_len + parameters_parameters_datas_len) * 6 + 3
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name+' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number = detail_data_table_start_row_number
|
||||
|
||||
|
@ -430,7 +431,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'B'
|
||||
|
||||
|
@ -449,7 +450,7 @@ def generate_excel(report,
|
|||
ws[end_col + str(current_row_number)].fill = table_fill
|
||||
ws[end_col + str(current_row_number)].font = title_font
|
||||
ws[end_col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[end_col + str(current_row_number)] = "总计 (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + str(current_row_number)] = "Total (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + str(current_row_number)].border = f_border
|
||||
|
||||
current_row_number += 1
|
||||
|
@ -462,7 +463,7 @@ def generate_excel(report,
|
|||
|
||||
col = 'B'
|
||||
|
||||
periodic_sum = 0.0
|
||||
periodic_sum = Decimal(0.0)
|
||||
|
||||
for j in range(0, ca_len):
|
||||
col = chr(ord('C') + j)
|
||||
|
@ -486,7 +487,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -520,7 +521,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].border = f_border
|
||||
|
||||
line = LineChart()
|
||||
line.title = '报告期成本 - ' + \
|
||||
line.title = 'Reporting Period Costs - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=detail_data_table_start_row_number + 1,
|
||||
max_row=table_end_row_number)
|
||||
|
@ -644,7 +645,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -700,7 +701,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -156,7 +156,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 能耗分析
|
||||
# First: Consumption
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~10 table_data
|
||||
|
@ -173,7 +173,7 @@ def generate_excel(report,
|
|||
|
||||
if has_energy_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name+' 能耗分析'
|
||||
ws['B6'] = name + ' ' + 'Consumption'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
@ -184,17 +184,17 @@ def generate_excel(report,
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '能耗'
|
||||
ws['B8'] = 'Consumption'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '单位面积能耗'
|
||||
ws['B9'] = 'Per Unit Area'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
ws['B10'].font = title_font
|
||||
ws['B10'].alignment = c_c_alignment
|
||||
ws['B10'] = '环比'
|
||||
ws['B10'] = 'Increment Rate'
|
||||
ws['B10'].border = f_border
|
||||
|
||||
col = ''
|
||||
|
@ -232,7 +232,7 @@ def generate_excel(report,
|
|||
ws[tce_col + '7'].fill = table_fill
|
||||
ws[tce_col + '7'].font = name_font
|
||||
ws[tce_col + '7'].alignment = c_c_alignment
|
||||
ws[tce_col + '7'] = "吨标准煤 (TCE)"
|
||||
ws[tce_col + '7'] = 'Ton of Standard Coal (TCE)'
|
||||
ws[tce_col + '7'].border = f_border
|
||||
|
||||
ws[tce_col + '8'].font = name_font
|
||||
|
@ -256,7 +256,7 @@ def generate_excel(report,
|
|||
ws[tco2e_col + '7'].fill = table_fill
|
||||
ws[tco2e_col + '7'].font = name_font
|
||||
ws[tco2e_col + '7'].alignment = c_c_alignment
|
||||
ws[tco2e_col + '7'] = "吨二氧化碳排放 (TCO2E)"
|
||||
ws[tco2e_col + '7'] = 'Ton of Carbon Dioxide Emissions (TCO2E)'
|
||||
ws[tco2e_col + '7'].border = f_border
|
||||
|
||||
ws[tco2e_col + '8'].font = name_font
|
||||
|
@ -278,7 +278,7 @@ def generate_excel(report,
|
|||
for i in range(6, 10 + 1):
|
||||
ws.row_dimensions[i].height = 0.1
|
||||
####################################################################################################################
|
||||
# Second: 分时电耗
|
||||
# Second: Electricity Consumption by Time-Of-Use
|
||||
# 12: title
|
||||
# 13: table title
|
||||
# 14~17 table_data
|
||||
|
@ -292,7 +292,7 @@ def generate_excel(report,
|
|||
|
||||
if has_ele_peak_flag:
|
||||
ws['B12'].font = title_font
|
||||
ws['B12'] = name+' 分时电耗'
|
||||
ws['B12'] = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws.row_dimensions[13].height = 60
|
||||
ws['B13'].fill = table_fill
|
||||
|
@ -304,11 +304,11 @@ def generate_excel(report,
|
|||
ws['C13'].font = name_font
|
||||
ws['C13'].alignment = c_c_alignment
|
||||
ws['C13'].border = f_border
|
||||
ws['C13'] = '分时电耗'
|
||||
ws['C13'] = 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws['B14'].font = title_font
|
||||
ws['B14'].alignment = c_c_alignment
|
||||
ws['B14'] = '尖'
|
||||
ws['B14'] = 'TopPeak'
|
||||
ws['B14'].border = f_border
|
||||
|
||||
ws['C14'].font = title_font
|
||||
|
@ -318,7 +318,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B15'].font = title_font
|
||||
ws['B15'].alignment = c_c_alignment
|
||||
ws['B15'] = '峰'
|
||||
ws['B15'] = 'OnPeak'
|
||||
ws['B15'].border = f_border
|
||||
|
||||
ws['C15'].font = title_font
|
||||
|
@ -328,7 +328,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B16'].font = title_font
|
||||
ws['B16'].alignment = c_c_alignment
|
||||
ws['B16'] = '平'
|
||||
ws['B16'] = 'MidPeak'
|
||||
ws['B16'].border = f_border
|
||||
|
||||
ws['C16'].font = title_font
|
||||
|
@ -338,7 +338,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B17'].font = title_font
|
||||
ws['B17'].alignment = c_c_alignment
|
||||
ws['B17'] = '谷'
|
||||
ws['B17'] = 'OffPeak'
|
||||
ws['B17'].border = f_border
|
||||
|
||||
ws['C17'].font = title_font
|
||||
|
@ -347,7 +347,7 @@ def generate_excel(report,
|
|||
ws['C17'] = round(reporting_period_data['offpeaks'][0], 2)
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name+' 分时电耗'
|
||||
pie.title = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
labels = Reference(ws, min_col=2, min_row=14, max_row=17)
|
||||
pie_data = Reference(ws, min_col=3, min_row=13, max_row=17)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -367,7 +367,7 @@ def generate_excel(report,
|
|||
ws.row_dimensions[i].height = 0.1
|
||||
|
||||
####################################################################################################################
|
||||
# Fourth: 能耗详情
|
||||
# Fourth: Detailed Data
|
||||
# current_row_number: title
|
||||
# current_row_number+1 ~ current_row_number+1+ca_len*6-1: line
|
||||
# current_row_number+1+ca_len*6: table title
|
||||
|
@ -393,14 +393,14 @@ def generate_excel(report,
|
|||
|
||||
if has_detail_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name+' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[table_row].height = 60
|
||||
ws['B'+str(table_row)].fill = table_fill
|
||||
ws['B' + str(table_row)].font = title_font
|
||||
ws['B'+str(table_row)].border = f_border
|
||||
ws['B'+str(table_row)].alignment = c_c_alignment
|
||||
ws['B'+str(table_row)] = '日期时间'
|
||||
ws['B'+str(table_row)] = 'Datetime'
|
||||
time = times[0]
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -445,7 +445,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -457,7 +457,7 @@ def generate_excel(report,
|
|||
# line
|
||||
# 39~: line
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + ws.cell(column=3+i, row=table_row).value
|
||||
line.title = 'Reporting Period Consumption - ' + ws.cell(column=3+i, row=table_row).value
|
||||
labels = Reference(ws, min_col=2, min_row=table_row+1, max_row=max_row)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_row, max_row=max_row) # openpyxl bug
|
||||
line.add_data(line_data, titles_from_data=True)
|
||||
|
@ -564,7 +564,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -620,7 +620,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -168,7 +168,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期消耗'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Consumption'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -214,7 +214,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '单位面积值'
|
||||
ws['B' + str(current_row_number)] = 'Per Unit Area'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -231,7 +231,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -253,8 +253,8 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = \
|
||||
name + ' ' + category_dict_name + ' (' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') 分项消耗占比'
|
||||
name + ' ' + category_dict_name + ' ' + '(' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') by Energy Item'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -287,8 +287,8 @@ def generate_excel(report,
|
|||
|
||||
pie = PieChart()
|
||||
pie.title = \
|
||||
name + ' ' + category_dict_name + ' (' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') 分项消耗占比'
|
||||
name + ' ' + category_dict_name + ' ' + '(' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') by Energy Item'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -333,7 +333,7 @@ def generate_excel(report,
|
|||
parameters_parameters_datas_len = 0
|
||||
|
||||
ws['B' + str(current_row_number - 1)].font = title_font
|
||||
ws['B' + str(current_row_number - 1)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number - 1)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
for i in range(0, parameters_names_len):
|
||||
if len(report['parameters']['timestamps'][i]) == 0:
|
||||
|
@ -346,7 +346,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -383,7 +383,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -419,7 +419,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + \
|
||||
line.title = 'Reporting Period Consumption - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=detail_data_table_start_row_number + 1,
|
||||
max_row=table_end_row_number)
|
||||
|
@ -530,7 +530,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -586,7 +586,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -152,7 +152,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 统计分析
|
||||
# First: Statistics
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~ca_len table_data
|
||||
|
@ -167,7 +167,7 @@ def generate_excel(report,
|
|||
return filename
|
||||
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 统计分析'
|
||||
ws['B6'] = name + ' ' + 'Statistics'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -175,22 +175,22 @@ def generate_excel(report,
|
|||
ws['B7'].fill = table_fill
|
||||
ws['B7'].font = title_font
|
||||
ws['B7'].alignment = c_c_alignment
|
||||
ws['B7'] = '报告期'
|
||||
ws['B7'] = 'Reporting Period'
|
||||
ws['B7'].border = f_border
|
||||
|
||||
ws['C7'].font = title_font
|
||||
ws['C7'].alignment = c_c_alignment
|
||||
ws['C7'] = '平均负荷'
|
||||
ws['C7'] = 'Average Load'
|
||||
ws['C7'].border = f_border
|
||||
|
||||
ws['D7'].font = title_font
|
||||
ws['D7'].alignment = c_c_alignment
|
||||
ws['D7'] = '最大负荷'
|
||||
ws['D7'] = 'Maximum Load'
|
||||
ws['D7'].border = f_border
|
||||
|
||||
ws['E7'].font = title_font
|
||||
ws['E7'].alignment = c_c_alignment
|
||||
ws['E7'] = '负荷系数'
|
||||
ws['E7'] = 'Load Factor'
|
||||
ws['E7'].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -204,7 +204,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(row + 1)].font = name_font
|
||||
ws['B' + str(row + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(row + 1)] = "环比"
|
||||
ws['B' + str(row + 1)] = 'Increment Rate'
|
||||
ws['B' + str(row + 1)].border = f_border
|
||||
|
||||
ws['C' + str(row)].font = name_font
|
||||
|
@ -247,7 +247,7 @@ def generate_excel(report,
|
|||
ws['E' + str(row + 1)].border = f_border
|
||||
|
||||
####################################################################################################################
|
||||
# Second: 报告期单位面积消耗
|
||||
# Second: Per Unit Area
|
||||
# 9 + ca_len * 2: title
|
||||
# 10 + ca_len * 2: table title
|
||||
# per_unit_area_start_row_number + 2 ~ per_unit_area_start_row_number + 2 + ca_len : table_data
|
||||
|
@ -258,7 +258,7 @@ def generate_excel(report,
|
|||
per_unit_area_start_row_number = 9 + ca_len * 2
|
||||
|
||||
ws['B' + str(per_unit_area_start_row_number)].font = title_font
|
||||
ws['B' + str(per_unit_area_start_row_number)] = name + ' 单位面积值' + str(report['store']['area']) + 'M²'
|
||||
ws['B' + str(per_unit_area_start_row_number)] = name + ' ' + 'Per Unit Area' + str(report['store']['area']) + 'M²'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -266,17 +266,17 @@ def generate_excel(report,
|
|||
ws['B' + str(per_unit_area_start_row_number + 1)].fill = table_fill
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)] = '报告期'
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)] = 'Reporting Period'
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)] = '平均负荷'
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)] = 'Average Load'
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)] = '最大负荷'
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)] = 'Maximum Load'
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -306,7 +306,7 @@ def generate_excel(report,
|
|||
ws['D' + str(row_data)].number_format = '0.00'
|
||||
|
||||
####################################################################################################################
|
||||
# Third: 详细数据
|
||||
# Third: Detailed Data
|
||||
# analysis_end_row_number~ analysis_end_row_number + 6*cal_len: line
|
||||
# detailed_start_row_number: table title
|
||||
# detailed_start_row_number + 1~: table_data
|
||||
|
@ -333,12 +333,12 @@ def generate_excel(report,
|
|||
detail_data_table_start_row_number = current_row_number + (ca_len + parameters_parameters_datas_len) * 6 + 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
# table_title
|
||||
ws['B' + str(detail_data_table_start_row_number)].fill = table_fill
|
||||
ws['B' + str(detail_data_table_start_row_number)].font = name_font
|
||||
ws['B' + str(detail_data_table_start_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(detail_data_table_start_row_number)] = "日期时间"
|
||||
ws['B' + str(detail_data_table_start_row_number)] = "Datetime"
|
||||
ws['B' + str(detail_data_table_start_row_number)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -348,13 +348,13 @@ def generate_excel(report,
|
|||
ws[col_average + str(detail_data_table_start_row_number)].font = name_font
|
||||
ws[col_average + str(detail_data_table_start_row_number)].alignment = c_c_alignment
|
||||
ws[col_average + str(detail_data_table_start_row_number)] =\
|
||||
names[i] + " 平均负荷(" + reporting_period_data['units'][i] + "/H)"
|
||||
names[i] + " Average Load(" + reporting_period_data['units'][i] + "/H)"
|
||||
ws[col_average + str(detail_data_table_start_row_number)].border = f_border
|
||||
|
||||
ws[col_maximum + str(detail_data_table_start_row_number)].font = name_font
|
||||
ws[col_maximum + str(detail_data_table_start_row_number)].alignment = c_c_alignment
|
||||
ws[col_maximum + str(detail_data_table_start_row_number)] = \
|
||||
names[i] + " 最大负荷(" + reporting_period_data['units'][i] + "/H)"
|
||||
names[i] + " Maximum Load(" + reporting_period_data['units'][i] + "/H)"
|
||||
ws[col_maximum + str(detail_data_table_start_row_number)].border = f_border
|
||||
# table_date
|
||||
for i in range(0, time_len):
|
||||
|
@ -391,7 +391,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = "报告期 最大负荷 - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.title = "Reporting Period Maximum Load - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
times = Reference(ws, min_col=2, min_row=detail_data_table_start_row_number + 1,
|
||||
max_row=detail_data_table_start_row_number + 1 + time_len)
|
||||
line_data = Reference(ws, min_col=2 + 2 * (i + 1), min_row=detail_data_table_start_row_number,
|
||||
|
@ -499,7 +499,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -555,7 +555,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -171,7 +171,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期节约'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Savings'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -190,7 +190,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = \
|
||||
reporting_period_data['names'][i] + " (基线-实际) (" + reporting_period_data['units'][i] + ")"
|
||||
reporting_period_data['names'][i] + " (Baseline - Actual) (" + reporting_period_data['units'][i] + ")"
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -198,7 +198,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '吨标准煤 (基线-实际) (TCE)'
|
||||
ws[col + str(current_row_number)] = 'Ton of Standard Coal (Baseline - Actual) (TCE)'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -206,7 +206,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '吨二氧化碳排放 (基线-实际) (TCO2E)'
|
||||
ws[col + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions (Baseline - Actual) (TCO2E)'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -215,7 +215,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '节约'
|
||||
ws['B' + str(current_row_number)] = 'Savings'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -246,7 +246,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '单位面积值'
|
||||
ws['B' + str(current_row_number)] = 'Per Unit Area'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -278,7 +278,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -313,7 +313,7 @@ def generate_excel(report,
|
|||
current_row_number += 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨标准煤(TCE)占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -327,13 +327,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '节约'
|
||||
ws['C' + str(current_row_number)] = 'Savings'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '吨标准煤(TCE) 节约占比'
|
||||
ws['D' + str(current_row_number)] = 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -367,7 +367,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 吨标准煤(TCE)占比'
|
||||
pie.title = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -382,7 +382,7 @@ def generate_excel(report,
|
|||
ws.add_chart(pie, 'E' + str(chart_start_row_number))
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨二氧化碳排放(TCO2E)占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -396,13 +396,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '节约'
|
||||
ws['C' + str(current_row_number)] = 'Savings'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '吨二氧化碳排放(TCO2E) 节约占比'
|
||||
ws['D' + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -436,7 +436,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 吨二氧化碳排放(TCO2E)占比'
|
||||
pie.title = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -475,7 +475,7 @@ def generate_excel(report,
|
|||
parameters_parameters_datas_len = 0
|
||||
|
||||
ws['B' + str(current_row_number - 1)].font = title_font
|
||||
ws['B' + str(current_row_number - 1)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number - 1)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
for i in range(0, parameters_names_len):
|
||||
if len(report['parameters']['timestamps'][i]) == 0:
|
||||
|
@ -490,7 +490,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -527,7 +527,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -563,7 +563,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期节约 - ' + \
|
||||
line.title = 'Reporting Period Savings - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -672,7 +672,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -728,7 +728,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -150,7 +150,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 统计分析
|
||||
# First: Statistics
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~ca_len table_data
|
||||
|
@ -165,7 +165,7 @@ def generate_excel(report,
|
|||
return filename
|
||||
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 统计分析'
|
||||
ws['B6'] = name + ' ' + 'Statistics'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -173,37 +173,37 @@ def generate_excel(report,
|
|||
ws['B7'].fill = table_fill
|
||||
ws['B7'].font = title_font
|
||||
ws['B7'].alignment = c_c_alignment
|
||||
ws['B7'] = '报告期'
|
||||
ws['B7'] = 'Reporting Period'
|
||||
ws['B7'].border = f_border
|
||||
|
||||
ws['C7'].font = title_font
|
||||
ws['C7'].alignment = c_c_alignment
|
||||
ws['C7'] = '算术平均数'
|
||||
ws['C7'] = 'Arithmetic Mean'
|
||||
ws['C7'].border = f_border
|
||||
|
||||
ws['D7'].font = title_font
|
||||
ws['D7'].alignment = c_c_alignment
|
||||
ws['D7'] = '中位数'
|
||||
ws['D7'] = 'Median (Middle Value)'
|
||||
ws['D7'].border = f_border
|
||||
|
||||
ws['E7'].font = title_font
|
||||
ws['E7'].alignment = c_c_alignment
|
||||
ws['E7'] = '最小值'
|
||||
ws['E7'] = 'Minimum Value'
|
||||
ws['E7'].border = f_border
|
||||
|
||||
ws['F7'].font = title_font
|
||||
ws['F7'].alignment = c_c_alignment
|
||||
ws['F7'] = '最大值'
|
||||
ws['F7'] = 'Maximum Value'
|
||||
ws['F7'].border = f_border
|
||||
|
||||
ws['G7'].font = title_font
|
||||
ws['G7'].alignment = c_c_alignment
|
||||
ws['G7'] = '样本标准差'
|
||||
ws['G7'] = 'Sample Standard Deviation'
|
||||
ws['G7'].border = f_border
|
||||
|
||||
ws['H7'].font = title_font
|
||||
ws['H7'].alignment = c_c_alignment
|
||||
ws['H7'] = '样本方差'
|
||||
ws['H7'] = 'Sample Variance'
|
||||
ws['H7'].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -217,7 +217,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(row + 1)].font = name_font
|
||||
ws['B' + str(row + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(row + 1)] = "环比"
|
||||
ws['B' + str(row + 1)] = 'Increment Rate'
|
||||
ws['B' + str(row + 1)].border = f_border
|
||||
|
||||
ws['C' + str(row)].font = name_font
|
||||
|
@ -298,7 +298,7 @@ def generate_excel(report,
|
|||
if reporting_period_data['variances_increment_rate'][i] is not None else '0.00%'
|
||||
ws['H' + str(row + 1)].border = f_border
|
||||
####################################################################################################################
|
||||
# Second: 报告期消耗
|
||||
# Second: Reporting Period Consumption
|
||||
# 9 + ca_len * 2: title
|
||||
# 10 + ca_len * 2: table title
|
||||
# per_unit_area_start_row_number + 2 ~ per_unit_area_start_row_number + 2 + ca_len : table_data
|
||||
|
@ -310,7 +310,7 @@ def generate_excel(report,
|
|||
per_unit_area_start_row_number = 9 + ca_len * 2
|
||||
|
||||
ws['B' + str(per_unit_area_start_row_number)].font = title_font
|
||||
ws['B' + str(per_unit_area_start_row_number)] = name + ' 单位面积值' + str(report['store']['area']) + 'M²'
|
||||
ws['B' + str(per_unit_area_start_row_number)] = name + ' ' + 'Per Unit Area' + str(report['store']['area']) + 'M²'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -318,37 +318,37 @@ def generate_excel(report,
|
|||
ws['B' + str(per_unit_area_start_row_number + 1)].fill = table_fill
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)] = '报告期'
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)] = 'Reporting Period'
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)] = '算术平均数'
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)] = 'Arithmetic Mean'
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)] = '中位数'
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)] = 'Median (Middle Value)'
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)] = '最小值'
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)] = 'Minimum Value'
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)] = '最大值'
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)] = 'Maximum Value'
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)] = '样本标准差'
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)] = 'Sample Standard Deviation'
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)] = '样本方差'
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)] = 'Sample Variance'
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -410,7 +410,7 @@ def generate_excel(report,
|
|||
ws['H' + str(row_data)].number_format = '0.00'
|
||||
|
||||
####################################################################################################################
|
||||
# Third: 详细数据
|
||||
# Third: Detailed Data
|
||||
# detailed_start_row_number~ detailed_start_row_number+time_len: line
|
||||
# detailed_start_row_number+1: table title
|
||||
# i + analysis_end_row_number + 2 + 6 * ca_len~: table_data
|
||||
|
@ -438,12 +438,12 @@ def generate_excel(report,
|
|||
detail_data_table_start_row_number = current_row_number + (ca_len + parameters_parameters_datas_len) * 6 + 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
# table_title
|
||||
ws['B' + str(detail_data_table_start_row_number)].fill = table_fill
|
||||
ws['B' + str(detail_data_table_start_row_number)].font = name_font
|
||||
ws['B' + str(detail_data_table_start_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(detail_data_table_start_row_number)] = "时间"
|
||||
ws['B' + str(detail_data_table_start_row_number)] = 'Datetime'
|
||||
ws['B' + str(detail_data_table_start_row_number)].border = f_border
|
||||
|
||||
current_row_number += 1
|
||||
|
@ -474,11 +474,11 @@ def generate_excel(report,
|
|||
ws[col + str(rows)].number_format = '0.00'
|
||||
ws[col + str(rows)].border = f_border
|
||||
|
||||
# 小计
|
||||
# Subtotal
|
||||
row_subtotals = detail_data_table_start_row_number + 1 + time_len
|
||||
ws['B' + str(row_subtotals)].font = name_font
|
||||
ws['B' + str(row_subtotals)].alignment = c_c_alignment
|
||||
ws['B' + str(row_subtotals)] = "小计"
|
||||
ws['B' + str(row_subtotals)] = 'Subtotal'
|
||||
ws['B' + str(row_subtotals)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -497,7 +497,7 @@ def generate_excel(report,
|
|||
####################################################################################################################
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = "报告期消耗" + " - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.title = "Reporting Period Consumption" + " - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.style = 10
|
||||
line.x_axis.majorTickMark = 'in'
|
||||
line.y_axis.majorTickMark = 'in'
|
||||
|
@ -606,7 +606,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -662,7 +662,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
data_font = Font(name='Franklin Gothic Book', size=11)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
|
@ -116,7 +116,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
ws['B3'].font = name_font
|
||||
ws['B3'].alignment = b_r_alignment
|
||||
ws['B3'] = '空间:'
|
||||
ws['B3'] = 'Space:'
|
||||
ws['C3'].border = b_border
|
||||
ws['C3'].alignment = b_c_alignment
|
||||
ws['C3'].font = name_font
|
||||
|
@ -124,7 +124,7 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
|
||||
ws['F3'].font = name_font
|
||||
ws['F3'].alignment = b_r_alignment
|
||||
ws['F3'] = '日期:'
|
||||
ws['F3'] = 'Datetime:'
|
||||
ws['G3'].border = b_border
|
||||
ws['G3'].alignment = b_c_alignment
|
||||
ws['G3'].font = name_font
|
||||
|
@ -136,13 +136,13 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
|
|||
ws['B6'].font = name_font
|
||||
ws['B6'].alignment = c_c_alignment
|
||||
ws['B6'].fill = table_fill
|
||||
ws['B6'] = '名称'
|
||||
ws['B6'] = 'Name'
|
||||
|
||||
ws['C6'].border = f_border
|
||||
ws['C6'].alignment = c_c_alignment
|
||||
ws['C6'].font = name_font
|
||||
ws['C6'].fill = table_fill
|
||||
ws['C6'] = '空间'
|
||||
ws['C6'] = 'Space'
|
||||
|
||||
ca_len = len(report['energycategories'])
|
||||
|
||||
|
|
|
@ -99,9 +99,9 @@ def generate_excel(report,
|
|||
ws.merge_cells('C24:I24')
|
||||
|
||||
# Font
|
||||
notice_font = Font(name='宋体', size=20, bold=True)
|
||||
notice_font = Font(name='Arial', size=20, bold=True)
|
||||
name_font = Font(name='Constantia', size=12, bold=True)
|
||||
title_font = Font(name='宋体', size=11, bold=True)
|
||||
title_font = Font(name='Arial', size=11, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -131,7 +131,7 @@ def generate_excel(report,
|
|||
|
||||
ws['C12'].font = notice_font
|
||||
ws['C12'].alignment = c_c_alignment
|
||||
ws['C12'] = '付款通知书'
|
||||
ws['C12'] = 'Payment Notice'
|
||||
|
||||
# img
|
||||
img = Image("excelexporters/myemslogo.png")
|
||||
|
@ -190,11 +190,11 @@ def generate_excel(report,
|
|||
ws['H' + str(i)].alignment = b_l_alignment
|
||||
ws['H' + str(i)].font = name_font
|
||||
|
||||
ws['E37'] = '账单号码:'
|
||||
ws['E38'] = '租赁合同号码:'
|
||||
ws['E39'] = '账单日期:'
|
||||
ws['E40'] = '付款到期日:'
|
||||
ws['E41'] = '应付款金额:'
|
||||
ws['E37'] = 'Bill Number:'
|
||||
ws['E38'] = 'Lease Contract Number:'
|
||||
ws['E39'] = 'Bill Date:'
|
||||
ws['E40'] = 'Payment Due Date:'
|
||||
ws['E41'] = 'Amount Payable:'
|
||||
|
||||
# Simulated data
|
||||
ws['H37'] = ''
|
||||
|
@ -222,14 +222,14 @@ def generate_excel(report,
|
|||
ws[chr(i) + '53'].alignment = c_c_alignment
|
||||
ws[chr(i) + '53'].border = f_border
|
||||
|
||||
ws['B53'] = '能耗分类'
|
||||
ws['C53'] = '结算期开始日期'
|
||||
ws['D53'] = '结算期结束日期'
|
||||
ws['E53'] = '数量'
|
||||
ws['F53'] = '单位'
|
||||
ws['G53'] = '金额'
|
||||
ws['H53'] = '税率'
|
||||
ws['I53'] = '税额'
|
||||
ws['B53'] = 'Energy Category'
|
||||
ws['C53'] = 'Billing Period Start'
|
||||
ws['D53'] = 'Billing Period End'
|
||||
ws['E53'] = 'Quantity'
|
||||
ws['F53'] = 'Unit'
|
||||
ws['G53'] = 'Amount'
|
||||
ws['H53'] = 'Tax Rate'
|
||||
ws['I53'] = 'VAT Output Tax'
|
||||
|
||||
reporting_period_data = report['reporting_period']
|
||||
names = reporting_period_data['names']
|
||||
|
@ -276,7 +276,7 @@ def generate_excel(report,
|
|||
ws.merge_cells('B{}:G{}'.format(i, i))
|
||||
ws.merge_cells('H{}:I{}'.format(i, i))
|
||||
|
||||
ws['B' + str(current_row_number)] = '小计:'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal:'
|
||||
ws['H' + str(current_row_number)] = report['reporting_period']['currency_unit'] + str(
|
||||
round(report['reporting_period']['total_cost']
|
||||
if 'reporting_period' in report.keys()
|
||||
|
@ -289,12 +289,12 @@ def generate_excel(report,
|
|||
# Simulated data
|
||||
taxes = Decimal(0.00)
|
||||
|
||||
ws['B' + str(current_row_number)] = '增值税销项税金:'
|
||||
ws['B' + str(current_row_number)] = 'VAT Output Tax:'
|
||||
ws['H' + str(current_row_number)] = report['reporting_period']['currency_unit'] + str(round(taxes, 2))
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
ws['B' + str(current_row_number)] = '应付金额合计:'
|
||||
ws['B' + str(current_row_number)] = 'Total Amount Payable:'
|
||||
ws['H' + str(current_row_number)] = report['reporting_period']['currency_unit'] + str(
|
||||
round(report['reporting_period']['total_cost'] + taxes
|
||||
if 'reporting_period' in report.keys()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import base64
|
||||
import uuid
|
||||
import os
|
||||
from decimal import Decimal
|
||||
from openpyxl.chart import PieChart, LineChart, Reference
|
||||
from openpyxl.styles import PatternFill, Border, Side, Alignment, Font
|
||||
from openpyxl.drawing.image import Image
|
||||
|
@ -84,7 +85,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -167,7 +168,7 @@ def generate_excel(report,
|
|||
|
||||
if has_energy_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name+' 报告期成本'
|
||||
ws['B6'] = name + ' ' + 'Reporting Period Costs'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
@ -178,17 +179,17 @@ def generate_excel(report,
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '成本'
|
||||
ws['B8'] = 'Cost'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '单位面积能耗'
|
||||
ws['B9'] = 'Per Unit Area'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
ws['B10'].font = title_font
|
||||
ws['B10'].alignment = c_c_alignment
|
||||
ws['B10'] = '环比'
|
||||
ws['B10'] = 'Increment Rate'
|
||||
ws['B10'].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -221,7 +222,7 @@ def generate_excel(report,
|
|||
ws[end_col + '7'].fill = table_fill
|
||||
ws[end_col + '7'].font = name_font
|
||||
ws[end_col + '7'].alignment = c_c_alignment
|
||||
ws[end_col + '7'] = "总计 (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + '7'] = "Total (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + '7'].border = f_border
|
||||
|
||||
ws[end_col + '8'].font = name_font
|
||||
|
@ -254,7 +255,7 @@ def generate_excel(report,
|
|||
|
||||
if has_ele_peak_flag:
|
||||
ws['B12'].font = title_font
|
||||
ws['B12'] = name+' 分时电耗'
|
||||
ws['B12'] = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws['B13'].fill = table_fill
|
||||
ws['B13'].font = name_font
|
||||
|
@ -265,11 +266,11 @@ def generate_excel(report,
|
|||
ws['C13'].font = name_font
|
||||
ws['C13'].alignment = c_c_alignment
|
||||
ws['C13'].border = f_border
|
||||
ws['C13'] = '分时电耗'
|
||||
ws['C13'] = 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws['B14'].font = title_font
|
||||
ws['B14'].alignment = c_c_alignment
|
||||
ws['B14'] = '尖'
|
||||
ws['B14'] = 'TopPeak'
|
||||
ws['B14'].border = f_border
|
||||
|
||||
ws['C14'].font = title_font
|
||||
|
@ -279,7 +280,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B15'].font = title_font
|
||||
ws['B15'].alignment = c_c_alignment
|
||||
ws['B15'] = '峰'
|
||||
ws['B15'] = 'OnPeak'
|
||||
ws['B15'].border = f_border
|
||||
|
||||
ws['C15'].font = title_font
|
||||
|
@ -289,7 +290,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B16'].font = title_font
|
||||
ws['B16'].alignment = c_c_alignment
|
||||
ws['B16'] = '平'
|
||||
ws['B16'] = 'MidPeak'
|
||||
ws['B16'].border = f_border
|
||||
|
||||
ws['C16'].font = title_font
|
||||
|
@ -299,7 +300,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B17'].font = title_font
|
||||
ws['B17'].alignment = c_c_alignment
|
||||
ws['B17'] = '谷'
|
||||
ws['B17'] = 'OffPeak'
|
||||
ws['B17'].border = f_border
|
||||
|
||||
ws['C17'].font = title_font
|
||||
|
@ -308,7 +309,7 @@ def generate_excel(report,
|
|||
ws['C17'] = round(reporting_period_data['offpeaks'][0], 2)
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name+' 分时电耗'
|
||||
pie.title = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
labels = Reference(ws, min_col=2, min_row=14, max_row=17)
|
||||
pie_data = Reference(ws, min_col=3, min_row=13, max_row=17)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -338,7 +339,7 @@ def generate_excel(report,
|
|||
|
||||
if has_subtotals_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 成本占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Costs Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -353,7 +354,7 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '成本占比'
|
||||
ws['C' + str(current_row_number)] = 'Costs Proportion'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -375,7 +376,7 @@ def generate_excel(report,
|
|||
table_end_row_number = current_row_number - 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 成本占比'
|
||||
pie.title = name + ' ' + 'Costs Proportion'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -417,7 +418,7 @@ def generate_excel(report,
|
|||
ca_len = len(report['reporting_period']['names'])
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name+' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
table_start_row_number = (current_row_number + 1) + ca_len * 6 + real_timestamps_len * 7
|
||||
current_row_number = table_start_row_number
|
||||
|
@ -435,7 +436,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'B'
|
||||
|
||||
|
@ -454,7 +455,7 @@ def generate_excel(report,
|
|||
ws[end_col + str(current_row_number)].fill = table_fill
|
||||
ws[end_col + str(current_row_number)].font = title_font
|
||||
ws[end_col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[end_col + str(current_row_number)] = "总计 (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + str(current_row_number)] = "Total (" + reporting_period_data['total_unit'] + ")"
|
||||
ws[end_col + str(current_row_number)].border = f_border
|
||||
|
||||
current_row_number += 1
|
||||
|
@ -467,7 +468,7 @@ def generate_excel(report,
|
|||
|
||||
col = 'B'
|
||||
|
||||
periodic_sum = 0.0
|
||||
periodic_sum = Decimal(0.0)
|
||||
|
||||
for j in range(0, ca_len):
|
||||
col = chr(ord('C') + j)
|
||||
|
@ -491,7 +492,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -505,7 +506,7 @@ def generate_excel(report,
|
|||
|
||||
# line
|
||||
line = LineChart()
|
||||
line.title = '报告期成本 - ' + ws.cell(column=3+i, row=table_start_row_number).value
|
||||
line.title = 'Reporting Period Costs - ' + ws.cell(column=3+i, row=table_start_row_number).value
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
line.add_data(line_data, titles_from_data=True)
|
||||
|
@ -620,7 +621,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -676,7 +677,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -168,7 +168,7 @@ def generate_excel(report,
|
|||
|
||||
if has_energy_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name+' 报告期消耗'
|
||||
ws['B6'] = name + ' ' + 'Reporting Period Consumption'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
ca_len = len(category)
|
||||
|
@ -178,17 +178,17 @@ def generate_excel(report,
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '能耗'
|
||||
ws['B8'] = 'Consumption'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '单位面积能耗'
|
||||
ws['B9'] = 'Per Unit Area'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
ws['B10'].font = title_font
|
||||
ws['B10'].alignment = c_c_alignment
|
||||
ws['B10'] = '环比'
|
||||
ws['B10'] = 'Increment Rate'
|
||||
ws['B10'].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -224,7 +224,7 @@ def generate_excel(report,
|
|||
ws[tce_col + '7'].fill = table_fill
|
||||
ws[tce_col + '7'].font = name_font
|
||||
ws[tce_col + '7'].alignment = c_c_alignment
|
||||
ws[tce_col + '7'] = "吨标准煤 (TCE)"
|
||||
ws[tce_col + '7'] = 'Ton of Standard Coal (TCE)'
|
||||
ws[tce_col + '7'].border = f_border
|
||||
|
||||
ws[tce_col + '8'].font = name_font
|
||||
|
@ -248,7 +248,7 @@ def generate_excel(report,
|
|||
ws[tco2e_col + '7'].fill = table_fill
|
||||
ws[tco2e_col + '7'].font = name_font
|
||||
ws[tco2e_col + '7'].alignment = c_c_alignment
|
||||
ws[tco2e_col + '7'] = "吨二氧化碳排放 (TCO2E)"
|
||||
ws[tco2e_col + '7'] = 'Ton of Carbon Dioxide Emissions (TCO2E)'
|
||||
ws[tco2e_col + '7'].border = f_border
|
||||
|
||||
ws[tco2e_col + '8'].font = name_font
|
||||
|
@ -280,7 +280,7 @@ def generate_excel(report,
|
|||
|
||||
if has_ele_peak_flag:
|
||||
ws['B12'].font = title_font
|
||||
ws['B12'] = name+' 分时电耗'
|
||||
ws['B12'] = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws['B13'].fill = table_fill
|
||||
ws['B13'].font = name_font
|
||||
|
@ -291,11 +291,11 @@ def generate_excel(report,
|
|||
ws['C13'].font = name_font
|
||||
ws['C13'].alignment = c_c_alignment
|
||||
ws['C13'].border = f_border
|
||||
ws['C13'] = '分时电耗'
|
||||
ws['C13'] = 'Electricity Consumption by Time-Of-Use'
|
||||
|
||||
ws['B14'].font = title_font
|
||||
ws['B14'].alignment = c_c_alignment
|
||||
ws['B14'] = '尖'
|
||||
ws['B14'] = 'TopPeak'
|
||||
ws['B14'].border = f_border
|
||||
|
||||
ws['C14'].font = title_font
|
||||
|
@ -305,7 +305,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B15'].font = title_font
|
||||
ws['B15'].alignment = c_c_alignment
|
||||
ws['B15'] = '峰'
|
||||
ws['B15'] = 'OnPeak'
|
||||
ws['B15'].border = f_border
|
||||
|
||||
ws['C15'].font = title_font
|
||||
|
@ -315,7 +315,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B16'].font = title_font
|
||||
ws['B16'].alignment = c_c_alignment
|
||||
ws['B16'] = '平'
|
||||
ws['B16'] = 'MidPeak'
|
||||
ws['B16'].border = f_border
|
||||
|
||||
ws['C16'].font = title_font
|
||||
|
@ -325,7 +325,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B17'].font = title_font
|
||||
ws['B17'].alignment = c_c_alignment
|
||||
ws['B17'] = '谷'
|
||||
ws['B17'] = 'OffPeak'
|
||||
ws['B17'].border = f_border
|
||||
|
||||
ws['C17'].font = title_font
|
||||
|
@ -334,7 +334,7 @@ def generate_excel(report,
|
|||
ws['C17'] = round(reporting_period_data['offpeaks'][0], 2)
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 分时电耗'
|
||||
pie.title = name + ' ' + 'Electricity Consumption by Time-Of-Use'
|
||||
labels = Reference(ws, min_col=2, min_row=14, max_row=17)
|
||||
pie_data = Reference(ws, min_col=3, min_row=13, max_row=17)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -364,7 +364,7 @@ def generate_excel(report,
|
|||
|
||||
if has_kgce_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨标准煤 (TCE) 占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -379,7 +379,7 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '吨标准煤 (TCE) 占比'
|
||||
ws['C' + str(current_row_number)] = 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -436,7 +436,7 @@ def generate_excel(report,
|
|||
|
||||
if has_kgco2e_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨二氧化碳排放 (TCO2E) 占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -451,7 +451,7 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '吨二氧化碳排放 (TCO2E) 占比'
|
||||
ws['C' + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -513,7 +513,7 @@ def generate_excel(report,
|
|||
ca_len = len(report['reporting_period']['names'])
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
table_start_row_number = (current_row_number + 1) + ca_len * 6 + real_timestamps_len * 7
|
||||
current_row_number = table_start_row_number
|
||||
|
@ -531,7 +531,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -565,7 +565,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -577,7 +577,7 @@ def generate_excel(report,
|
|||
|
||||
# line
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + ws.cell(column=3+i, row=table_start_row_number).value
|
||||
line.title = 'Reporting Period Consumption - ' + ws.cell(column=3+i, row=table_start_row_number).value
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
line.add_data(line_data, titles_from_data=True)
|
||||
|
@ -686,7 +686,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -742,7 +742,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -169,7 +169,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期消耗'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Reporting Period Consumption'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -215,7 +215,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '单位面积值'
|
||||
ws['B' + str(current_row_number)] = 'Per Unit Area'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -232,7 +232,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -254,8 +254,8 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = \
|
||||
name + ' ' + category_dict_name + ' (' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') 分项消耗占比'
|
||||
name + ' ' + category_dict_name + ' ' + '(' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') by Energy Item'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -288,8 +288,8 @@ def generate_excel(report,
|
|||
|
||||
pie = PieChart()
|
||||
pie.title = \
|
||||
name + ' ' + category_dict_name + ' (' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') 分项消耗占比'
|
||||
name + ' ' + category_dict_name + ' ' + '(' + reporting_period_data['units'][category_dict_values[0]] + \
|
||||
') by Energy Item'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -329,7 +329,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -343,7 +343,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -380,7 +380,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -416,7 +416,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期消耗 - ' + \
|
||||
line.title = 'Reporting Period Consumption - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -521,7 +521,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -577,7 +577,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -165,7 +165,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ca_len = len(category)
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + '报告期平均负荷'
|
||||
ws['B' + str(current_row_number)] = name + 'Reporting Period Average Load'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -187,7 +187,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '平均负荷'
|
||||
ws['B' + str(current_row_number)] = 'Average Load'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -202,7 +202,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '单位面积值'
|
||||
ws['B' + str(current_row_number)] = 'Per Unit Area'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -217,7 +217,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -231,7 +231,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
current_row_number += 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + '报告期最大负荷'
|
||||
ws['B' + str(current_row_number)] = name + 'Reporting Period Maximum Load'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -252,7 +252,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '最大负荷'
|
||||
ws['B' + str(current_row_number)] = 'Maximum Load'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -267,7 +267,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '单位面积值'
|
||||
ws['B' + str(current_row_number)] = 'Per Unit Area'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -282,7 +282,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -296,7 +296,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
current_row_number += 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + '报告期负荷系数'
|
||||
ws['B' + str(current_row_number)] = name + 'Reporting Period Load Factor'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -316,7 +316,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '负荷系数'
|
||||
ws['B' + str(current_row_number)] = 'Load Factor'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -331,7 +331,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
for i in range(0, ca_len):
|
||||
col = chr(ord('C') + i)
|
||||
|
@ -361,7 +361,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
time = times[0]
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + '详细数据'
|
||||
ws['B' + str(current_row_number)] = name + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
chart_start_number = current_row_number
|
||||
|
@ -379,7 +379,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -390,7 +390,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = reporting_period_data['names'][i] + \
|
||||
" 平均负荷(" + reporting_period_data['units'][i] + "/H)"
|
||||
" Average Load(" + reporting_period_data['units'][i] + "/H)"
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
if has_sub_maximums_data_flag:
|
||||
|
@ -399,7 +399,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = reporting_period_data['names'][i] + \
|
||||
" 最大负荷(" + reporting_period_data['units'][i] + "/H)"
|
||||
" Maximum Load(" + reporting_period_data['units'][i] + "/H)"
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
current_row_number += 1
|
||||
|
@ -441,7 +441,8 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
if has_sub_averages_data_flag:
|
||||
line = LineChart()
|
||||
line.title = '报告期 平均负荷 - ' + ws.cell(column=current_chart_col_number, row=table_start_number).value
|
||||
line.title = 'Reporting Period Average Load - ' + ws.cell(column=current_chart_col_number,
|
||||
row=table_start_number).value
|
||||
datas = Reference(ws, min_col=current_chart_col_number, min_row=table_start_number,
|
||||
max_row=table_end_number)
|
||||
line.add_data(datas, titles_from_data=True)
|
||||
|
@ -461,7 +462,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
if has_sub_maximums_data_flag:
|
||||
line = LineChart()
|
||||
line.title = '报告期 最大负荷 - ' + ws.cell(column=current_chart_col_number, row=table_start_number).value
|
||||
line.title = 'Reporting Period Maximum Load - ' + ws.cell(column=current_chart_col_number, row=table_start_number).value
|
||||
datas = Reference(ws, min_col=current_chart_col_number, min_row=table_start_number,
|
||||
max_row=table_end_number)
|
||||
line.add_data(datas, titles_from_data=True)
|
||||
|
@ -562,7 +563,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -618,7 +619,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -171,7 +171,7 @@ def generate_excel(report,
|
|||
|
||||
if has_names_data_flag:
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 报告期节约'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + '' + 'Reporting Period Savings'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -190,7 +190,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = \
|
||||
reporting_period_data['names'][i] + " (基线-实际) (" + reporting_period_data['units'][i] + ")"
|
||||
reporting_period_data['names'][i] + " (Baseline - Actual) (" + reporting_period_data['units'][i] + ")"
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -198,7 +198,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '吨标准煤 (基线-实际) (TCE)'
|
||||
ws[col + str(current_row_number)] = 'Ton of Standard Coal (Baseline - Actual) (TCE)'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -206,7 +206,7 @@ def generate_excel(report,
|
|||
ws[col + str(current_row_number)].font = name_font
|
||||
ws[col + str(current_row_number)].alignment = c_c_alignment
|
||||
ws[col + str(current_row_number)].border = f_border
|
||||
ws[col + str(current_row_number)] = '吨二氧化碳排放 (基线-实际) (TCO2E)'
|
||||
ws[col + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions (Baseline - Actual) (TCO2E)'
|
||||
|
||||
col = chr(ord(col) + 1)
|
||||
|
||||
|
@ -215,7 +215,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '节约'
|
||||
ws['B' + str(current_row_number)] = 'Savings'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -246,7 +246,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '单位面积值'
|
||||
ws['B' + str(current_row_number)] = 'Per Unit Area'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -278,7 +278,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '环比'
|
||||
ws['B' + str(current_row_number)] = 'Increment Rate'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -313,7 +313,7 @@ def generate_excel(report,
|
|||
current_row_number += 2
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨标准煤(TCE)占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -327,13 +327,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '节约'
|
||||
ws['C' + str(current_row_number)] = 'Savings'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '吨标准煤(TCE) 节约占比'
|
||||
ws['D' + str(current_row_number)] = 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -367,7 +367,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 吨标准煤(TCE)占比'
|
||||
pie.title = name + ' ' + 'Ton of Standard Coal(TCE) by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -382,7 +382,7 @@ def generate_excel(report,
|
|||
ws.add_chart(pie, 'E' + str(chart_start_row_number))
|
||||
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 吨二氧化碳排放(TCO2E)占比'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
table_start_row_number = current_row_number
|
||||
|
@ -396,13 +396,13 @@ def generate_excel(report,
|
|||
ws['C' + str(current_row_number)].font = name_font
|
||||
ws['C' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['C' + str(current_row_number)].border = f_border
|
||||
ws['C' + str(current_row_number)] = '节约'
|
||||
ws['C' + str(current_row_number)] = 'Savings'
|
||||
|
||||
ws['D' + str(current_row_number)].fill = table_fill
|
||||
ws['D' + str(current_row_number)].font = name_font
|
||||
ws['D' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['D' + str(current_row_number)].border = f_border
|
||||
ws['D' + str(current_row_number)] = '吨二氧化碳排放(TCO2E) 节约占比'
|
||||
ws['D' + str(current_row_number)] = 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -436,7 +436,7 @@ def generate_excel(report,
|
|||
current_row_number += 1
|
||||
|
||||
pie = PieChart()
|
||||
pie.title = name + ' 吨二氧化碳排放(TCO2E)占比'
|
||||
pie.title = name + ' ' + 'Ton of Carbon Dioxide Emissions(TCO2E) by Energy Category'
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
pie_data = Reference(ws, min_col=3, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
pie.add_data(pie_data, titles_from_data=True)
|
||||
|
@ -471,7 +471,7 @@ def generate_excel(report,
|
|||
time = reporting_period_data['timestamps'][0]
|
||||
real_timestamps_len = timestamps_data_not_equal_0(report['parameters']['timestamps'])
|
||||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(current_row_number)] = name + ' ' + 'Detailed Data'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
@ -485,7 +485,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '日期时间'
|
||||
ws['B' + str(current_row_number)] = 'Datetime'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -522,7 +522,7 @@ def generate_excel(report,
|
|||
ws['B' + str(current_row_number)].font = title_font
|
||||
ws['B' + str(current_row_number)].alignment = c_c_alignment
|
||||
ws['B' + str(current_row_number)].border = f_border
|
||||
ws['B' + str(current_row_number)] = '小计'
|
||||
ws['B' + str(current_row_number)] = 'Subtotal'
|
||||
|
||||
col = 'C'
|
||||
|
||||
|
@ -558,7 +558,7 @@ def generate_excel(report,
|
|||
|
||||
for i in range(0, ca_len):
|
||||
line = LineChart()
|
||||
line.title = '报告期节约 - ' + \
|
||||
line.title = 'Reporting Period Savings - ' + \
|
||||
reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + ")"
|
||||
labels = Reference(ws, min_col=2, min_row=table_start_row_number + 1, max_row=table_end_row_number)
|
||||
line_data = Reference(ws, min_col=3 + i, min_row=table_start_row_number, max_row=table_end_row_number)
|
||||
|
@ -666,7 +666,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -722,7 +722,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def generate_excel(report,
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -151,7 +151,7 @@ def generate_excel(report,
|
|||
|
||||
return filename
|
||||
####################################################################################################################
|
||||
# First: 统计分析
|
||||
# First: Statistics
|
||||
# 6: title
|
||||
# 7: table title
|
||||
# 8~ca_len table_data
|
||||
|
@ -166,7 +166,7 @@ def generate_excel(report,
|
|||
return filename
|
||||
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + ' 统计分析'
|
||||
ws['B6'] = name + ' ' + 'Statistics'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -174,37 +174,37 @@ def generate_excel(report,
|
|||
ws['B7'].fill = table_fill
|
||||
ws['B7'].font = title_font
|
||||
ws['B7'].alignment = c_c_alignment
|
||||
ws['B7'] = '报告期'
|
||||
ws['B7'] = 'Reporting Period'
|
||||
ws['B7'].border = f_border
|
||||
|
||||
ws['C7'].font = title_font
|
||||
ws['C7'].alignment = c_c_alignment
|
||||
ws['C7'] = '算术平均数'
|
||||
ws['C7'] = 'Arithmetic Mean'
|
||||
ws['C7'].border = f_border
|
||||
|
||||
ws['D7'].font = title_font
|
||||
ws['D7'].alignment = c_c_alignment
|
||||
ws['D7'] = '中位数'
|
||||
ws['D7'] = 'Median (Middle Value)'
|
||||
ws['D7'].border = f_border
|
||||
|
||||
ws['E7'].font = title_font
|
||||
ws['E7'].alignment = c_c_alignment
|
||||
ws['E7'] = '最小值'
|
||||
ws['E7'] = 'Minimum Value'
|
||||
ws['E7'].border = f_border
|
||||
|
||||
ws['F7'].font = title_font
|
||||
ws['F7'].alignment = c_c_alignment
|
||||
ws['F7'] = '最大值'
|
||||
ws['F7'] = 'Maximum Value'
|
||||
ws['F7'].border = f_border
|
||||
|
||||
ws['G7'].font = title_font
|
||||
ws['G7'].alignment = c_c_alignment
|
||||
ws['G7'] = '样本标准差'
|
||||
ws['G7'] = 'Sample Standard Deviation'
|
||||
ws['G7'].border = f_border
|
||||
|
||||
ws['H7'].font = title_font
|
||||
ws['H7'].alignment = c_c_alignment
|
||||
ws['H7'] = '样本方差'
|
||||
ws['H7'] = 'Sample Variance'
|
||||
ws['H7'].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -218,7 +218,7 @@ def generate_excel(report,
|
|||
|
||||
ws['B' + str(row + 1)].font = name_font
|
||||
ws['B' + str(row + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(row + 1)] = "环比"
|
||||
ws['B' + str(row + 1)] = 'Increment Rate'
|
||||
ws['B' + str(row + 1)].border = f_border
|
||||
|
||||
ws['C' + str(row)].font = name_font
|
||||
|
@ -299,7 +299,7 @@ def generate_excel(report,
|
|||
if reporting_period_data['variances_increment_rate'][i] is not None else '0.00%'
|
||||
ws['H' + str(row + 1)].border = f_border
|
||||
####################################################################################################################
|
||||
# Second: 报告期消耗
|
||||
# Second: Reporting Period Consumption
|
||||
# 9 + ca_len * 2: title
|
||||
# 10 + ca_len * 2: table title
|
||||
# per_unit_area_start_row_number + 2 ~ per_unit_area_start_row_number + 2 + ca_len : table_data
|
||||
|
@ -311,7 +311,7 @@ def generate_excel(report,
|
|||
per_unit_area_start_row_number = 9 + ca_len * 2
|
||||
|
||||
ws['B' + str(per_unit_area_start_row_number)].font = title_font
|
||||
ws['B' + str(per_unit_area_start_row_number)] = name + ' 单位面积值' + str(report['tenant']['area']) + 'M²'
|
||||
ws['B' + str(per_unit_area_start_row_number)] = name + ' ' + 'Per Unit Area' + str(report['tenant']['area']) + 'M²'
|
||||
|
||||
category = reporting_period_data['names']
|
||||
|
||||
|
@ -319,37 +319,37 @@ def generate_excel(report,
|
|||
ws['B' + str(per_unit_area_start_row_number + 1)].fill = table_fill
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)] = '报告期'
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)] = 'Reporting Period'
|
||||
ws['B' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)] = '算术平均数'
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)] = 'Arithmetic Mean'
|
||||
ws['C' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)] = '中位数'
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)] = 'Median (Middle Value)'
|
||||
ws['D' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)] = '最小值'
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)] = 'Minimum Value'
|
||||
ws['E' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)] = '最大值'
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)] = 'Maximum Value'
|
||||
ws['F' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)] = '样本标准差'
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)] = 'Sample Standard Deviation'
|
||||
ws['G' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)].font = title_font
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)] = '样本方差'
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)] = 'Sample Variance'
|
||||
ws['H' + str(per_unit_area_start_row_number + 1)].border = f_border
|
||||
|
||||
# table_data
|
||||
|
@ -411,7 +411,7 @@ def generate_excel(report,
|
|||
ws['H' + str(row_data)].number_format = '0.00'
|
||||
|
||||
####################################################################################################################
|
||||
# Third: 详细数据
|
||||
# Third: Detailed Data
|
||||
# detailed_start_row_number~ detailed_start_row_number+time_len: line
|
||||
# detailed_start_row_number + 1: table title
|
||||
# i + analysis_end_row_number + 2 + 6 * ca_len~: table_data
|
||||
|
@ -435,12 +435,12 @@ def generate_excel(report,
|
|||
detailed_start_row_number = analysis_end_row_number + line_charts_row_number + 1
|
||||
|
||||
ws['B' + str(detailed_start_row_number)].font = title_font
|
||||
ws['B' + str(detailed_start_row_number)] = name + ' 详细数据'
|
||||
ws['B' + str(detailed_start_row_number)] = name + ' ' + 'Detailed Data'
|
||||
# table_title
|
||||
ws['B' + str(detailed_start_row_number + 1)].fill = table_fill
|
||||
ws['B' + str(detailed_start_row_number + 1)].font = name_font
|
||||
ws['B' + str(detailed_start_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(detailed_start_row_number + 1)] = "时间"
|
||||
ws['B' + str(detailed_start_row_number + 1)] = 'Datetime'
|
||||
ws['B' + str(detailed_start_row_number + 1)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -468,11 +468,11 @@ def generate_excel(report,
|
|||
ws[col + str(rows)].number_format = '0.00'
|
||||
ws[col + str(rows)].border = f_border
|
||||
|
||||
# 小计
|
||||
# Subtotal
|
||||
row_subtotals = detailed_start_row_number + 2 + time_len
|
||||
ws['B' + str(row_subtotals)].font = name_font
|
||||
ws['B' + str(row_subtotals)].alignment = c_c_alignment
|
||||
ws['B' + str(row_subtotals)] = "小计"
|
||||
ws['B' + str(row_subtotals)] = 'Subtotal'
|
||||
ws['B' + str(row_subtotals)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -492,7 +492,7 @@ def generate_excel(report,
|
|||
for i in range(0, ca_len):
|
||||
|
||||
line = LineChart()
|
||||
line.title = "报告期消耗" + " - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.title = "Reporting Period Consumption" + " - " + names[i] + "(" + reporting_period_data['units'][i] + ")"
|
||||
line.style = 10
|
||||
line.x_axis.majorTickMark = 'in'
|
||||
line.y_axis.majorTickMark = 'in'
|
||||
|
@ -598,7 +598,7 @@ def generate_excel(report,
|
|||
parameters_ws_current_row_number = 6
|
||||
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)].font = title_font
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' Parameters'
|
||||
parameters_ws['B' + str(parameters_ws_current_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
parameters_ws_current_row_number += 1
|
||||
|
||||
|
@ -654,7 +654,7 @@ def generate_excel(report,
|
|||
################################################################################################################
|
||||
|
||||
ws['B' + str(current_sheet_parameters_row_number)].font = title_font
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' Parameters'
|
||||
ws['B' + str(current_sheet_parameters_row_number)] = name + ' ' + 'Parameters'
|
||||
|
||||
current_sheet_parameters_row_number += 1
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -157,7 +157,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
if has_cost_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + '报告期成本'
|
||||
ws['B6'] = name + 'Reporting Period Costs'
|
||||
|
||||
reporting_period_data = report['reporting_period']
|
||||
category = report['virtual_meter']['energy_category_name']
|
||||
|
@ -169,12 +169,12 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '成本'
|
||||
ws['B8'] = 'Cost'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '环比'
|
||||
ws['B9'] = 'Increment Rate'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -207,7 +207,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[tce_col + '7'].fill = table_fill
|
||||
ws[tce_col + '7'].font = name_font
|
||||
ws[tce_col + '7'].alignment = c_c_alignment
|
||||
ws[tce_col + '7'] = "吨标准煤 (TCE)"
|
||||
ws[tce_col + '7'] = 'Ton of Standard Coal (TCE)'
|
||||
ws[tce_col + '7'].border = f_border
|
||||
|
||||
ws[tce_col + '8'].font = name_font
|
||||
|
@ -226,7 +226,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[tco2e_col + '7'].fill = table_fill
|
||||
ws[tco2e_col + '7'].font = name_font
|
||||
ws[tco2e_col + '7'].alignment = c_c_alignment
|
||||
ws[tco2e_col + '7'] = "吨二氧化碳排放 (TCO2E)"
|
||||
ws[tco2e_col + '7'] = 'Ton of Carbon Dioxide Emissions (TCO2E)'
|
||||
ws[tco2e_col + '7'].border = f_border
|
||||
|
||||
ws[tco2e_col + '8'].font = name_font
|
||||
|
@ -257,14 +257,14 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
if has_cost_detail_flag:
|
||||
ws['B11'].font = title_font
|
||||
ws['B11'] = name + '详细数据'
|
||||
ws['B11'] = name + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[18].height = 60
|
||||
ws['B18'].fill = table_fill
|
||||
ws['B18'].font = title_font
|
||||
ws['B18'].border = f_border
|
||||
ws['B18'].alignment = c_c_alignment
|
||||
ws['B18'] = '日期时间'
|
||||
ws['B18'] = 'Datetime'
|
||||
time = times
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -288,7 +288,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
ws['B' + str(end_data_row_number + 1)].font = title_font
|
||||
ws['B' + str(end_data_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(end_data_row_number + 1)] = '总计'
|
||||
ws['B' + str(end_data_row_number + 1)] = 'Total'
|
||||
ws['B' + str(end_data_row_number + 1)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -327,7 +327,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
line_data.marker.symbol = "circle"
|
||||
line_data.smooth = True
|
||||
line.x_axis.crosses = 'min'
|
||||
line.title = '报告期成本 - ' + report['virtual_meter']['energy_category_name'] + \
|
||||
line.title = 'Reporting Period Costs - ' + report['virtual_meter']['energy_category_name'] + \
|
||||
" (" + report['virtual_meter']['unit_of_measure'] + ")"
|
||||
line.dLbls = DataLabelList()
|
||||
line.dLbls.dLblPos = 't'
|
||||
|
|
|
@ -72,7 +72,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
# Font
|
||||
name_font = Font(name='Constantia', size=15, bold=True)
|
||||
title_font = Font(name='宋体', size=15, bold=True)
|
||||
title_font = Font(name='Arial', size=15, bold=True)
|
||||
|
||||
table_fill = PatternFill(fill_type='solid', fgColor='1F497D')
|
||||
f_border = Border(left=Side(border_style='medium', color='00000000'),
|
||||
|
@ -153,7 +153,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
if has_cost_data_flag:
|
||||
ws['B6'].font = title_font
|
||||
ws['B6'] = name + '报告期消耗'
|
||||
ws['B6'] = name + 'Reporting Period Consumption'
|
||||
|
||||
reporting_period_data = report['reporting_period']
|
||||
category = report['virtual_meter']['energy_category_name']
|
||||
|
@ -165,12 +165,12 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
ws['B8'].font = title_font
|
||||
ws['B8'].alignment = c_c_alignment
|
||||
ws['B8'] = '能耗'
|
||||
ws['B8'] = 'Consumption'
|
||||
ws['B8'].border = f_border
|
||||
|
||||
ws['B9'].font = title_font
|
||||
ws['B9'].alignment = c_c_alignment
|
||||
ws['B9'] = '环比'
|
||||
ws['B9'] = 'Increment Rate'
|
||||
ws['B9'].border = f_border
|
||||
|
||||
col = 'B'
|
||||
|
@ -203,7 +203,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[tce_col + '7'].fill = table_fill
|
||||
ws[tce_col + '7'].font = name_font
|
||||
ws[tce_col + '7'].alignment = c_c_alignment
|
||||
ws[tce_col + '7'] = "吨标准煤 (TCE)"
|
||||
ws[tce_col + '7'] = 'Ton of Standard Coal (TCE)'
|
||||
ws[tce_col + '7'].border = f_border
|
||||
|
||||
ws[tce_col + '8'].font = name_font
|
||||
|
@ -222,7 +222,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
ws[tco2e_col + '7'].fill = table_fill
|
||||
ws[tco2e_col + '7'].font = name_font
|
||||
ws[tco2e_col + '7'].alignment = c_c_alignment
|
||||
ws[tco2e_col + '7'] = "吨二氧化碳排放 (TCO2E)"
|
||||
ws[tco2e_col + '7'] = 'Ton of Carbon Dioxide Emissions (TCO2E)'
|
||||
ws[tco2e_col + '7'].border = f_border
|
||||
|
||||
ws[tco2e_col + '8'].font = name_font
|
||||
|
@ -253,14 +253,14 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
if has_cost_detail_flag:
|
||||
ws['B11'].font = title_font
|
||||
ws['B11'] = name + '详细数据'
|
||||
ws['B11'] = name + 'Detailed Data'
|
||||
|
||||
ws.row_dimensions[18].height = 60
|
||||
ws['B18'].fill = table_fill
|
||||
ws['B18'].font = title_font
|
||||
ws['B18'].border = f_border
|
||||
ws['B18'].alignment = c_c_alignment
|
||||
ws['B18'] = '日期时间'
|
||||
ws['B18'] = 'Datetime'
|
||||
time = times
|
||||
has_data = False
|
||||
max_row = 0
|
||||
|
@ -284,7 +284,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
|
||||
ws['B' + str(end_data_row_number + 1)].font = title_font
|
||||
ws['B' + str(end_data_row_number + 1)].alignment = c_c_alignment
|
||||
ws['B' + str(end_data_row_number + 1)] = '总计'
|
||||
ws['B' + str(end_data_row_number + 1)] = 'Total'
|
||||
ws['B' + str(end_data_row_number + 1)].border = f_border
|
||||
|
||||
for i in range(0, ca_len):
|
||||
|
@ -323,7 +323,7 @@ def generate_excel(report, name, reporting_start_datetime_local, reporting_end_d
|
|||
line_data.marker.symbol = "circle"
|
||||
line_data.smooth = True
|
||||
line.x_axis.crosses = 'min'
|
||||
line.title = '报告期消耗 - ' + report['virtual_meter']['energy_category_name'] + \
|
||||
line.title = 'Reporting Period Consumption - ' + report['virtual_meter']['energy_category_name'] + \
|
||||
" (" + report['virtual_meter']['unit_of_measure'] + ")"
|
||||
line.dLbls = DataLabelList()
|
||||
line.dLbls.dLblPos = 't'
|
||||
|
|
Loading…
Reference in New Issue