2021/3/3
parent
d719e95ab0
commit
25a96729ae
|
@ -30,7 +30,6 @@ def export(report,
|
||||||
if report is None:
|
if report is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
####################################################################################################################
|
####################################################################################################################
|
||||||
# Step 2: Generate excel file from the report data
|
# Step 2: Generate excel file from the report data
|
||||||
####################################################################################################################
|
####################################################################################################################
|
||||||
|
@ -211,7 +210,7 @@ def generate_excel(report,
|
||||||
# table_data
|
# table_data
|
||||||
|
|
||||||
for i, value in enumerate(category):
|
for i, value in enumerate(category):
|
||||||
row = i*2 + 8
|
row = i * 2 + 8
|
||||||
ws['B' + str(row)].font = name_font
|
ws['B' + str(row)].font = name_font
|
||||||
ws['B' + str(row)].alignment = c_c_alignment
|
ws['B' + str(row)].alignment = c_c_alignment
|
||||||
ws['B' + str(row)] = reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + "/H )"
|
ws['B' + str(row)] = reporting_period_data['names'][i] + " (" + reporting_period_data['units'][i] + "/H )"
|
||||||
|
@ -358,14 +357,14 @@ def generate_excel(report,
|
||||||
# row_st == row_statistical analysis table
|
# row_st == row_statistical analysis table
|
||||||
row_sat = 12 + 3 * ca_len
|
row_sat = 12 + 3 * ca_len
|
||||||
|
|
||||||
ws['B' + str(row_sat+row_title)].font = title_font
|
ws['B' + str(row_sat + row_title)].font = title_font
|
||||||
ws['B' + str(row_sat+row_title)] = name + ' 详细数据'
|
ws['B' + str(row_sat + row_title)] = name + ' 详细数据'
|
||||||
# table_title
|
# table_title
|
||||||
ws['B' + str(row_sat+1+row_title)].fill = table_fill
|
ws['B' + str(row_sat + 1 + row_title)].fill = table_fill
|
||||||
ws['B' + str(row_sat+1+row_title)].font = name_font
|
ws['B' + str(row_sat + 1 + row_title)].font = name_font
|
||||||
ws['B' + str(row_sat+1+row_title)].alignment = c_c_alignment
|
ws['B' + str(row_sat + 1 + row_title)].alignment = c_c_alignment
|
||||||
ws['B' + str(row_sat+1+row_title)] = "日期时间"
|
ws['B' + str(row_sat + 1 + row_title)] = "日期时间"
|
||||||
ws['B' + str(row_sat+1+row_title)].border = f_border
|
ws['B' + str(row_sat + 1 + row_title)].border = f_border
|
||||||
|
|
||||||
for i in range(0, ca_len):
|
for i in range(0, ca_len):
|
||||||
col_average = chr(ord('C') + i)
|
col_average = chr(ord('C') + i)
|
||||||
|
@ -392,7 +391,6 @@ def generate_excel(report,
|
||||||
ws['B' + str(rows)].border = f_border
|
ws['B' + str(rows)].border = f_border
|
||||||
|
|
||||||
for index in range(0, ca_len):
|
for index in range(0, ca_len):
|
||||||
|
|
||||||
col_average = chr(ord('C') + index * 2)
|
col_average = chr(ord('C') + index * 2)
|
||||||
col_maximum = chr(ord('C') + index * 2 + 1)
|
col_maximum = chr(ord('C') + index * 2 + 1)
|
||||||
|
|
||||||
|
@ -412,7 +410,6 @@ def generate_excel(report,
|
||||||
|
|
||||||
# LineChart
|
# LineChart
|
||||||
for i in range(0, ca_len):
|
for i in range(0, ca_len):
|
||||||
|
|
||||||
lc = LineChart()
|
lc = LineChart()
|
||||||
lc.title = "报告期 最大负荷"
|
lc.title = "报告期 最大负荷"
|
||||||
lc.style = 10
|
lc.style = 10
|
||||||
|
|
|
@ -7,6 +7,7 @@ from core import utilities
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
import excelexporters.shopfloorload
|
import excelexporters.shopfloorload
|
||||||
|
|
||||||
|
|
||||||
class Reporting:
|
class Reporting:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __init__():
|
def __init__():
|
||||||
|
|
Loading…
Reference in New Issue