Added 'excelexporters.equipmentsaving.export()' method

pull/8/head
YangZhang-GitHub 2021-03-05 17:14:52 +08:00
parent 93a87cb1b0
commit 0f9b2fffb7
1 changed files with 8 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import config
from datetime import datetime, timedelta, timezone
from core import utilities
from decimal import Decimal
import excelexporters.equipmentsaving
class Reporting:
@ -655,4 +656,11 @@ class Reporting:
"values": parameters_data['values']
}
# export result to Excel file and then encode the file to base64 string
result['excel_bytes_base64'] = excelexporters.equipmentsaving.export(result,
equipment['name'],
reporting_start_datetime_local,
reporting_end_datetime_local,
period_type)
resp.body = json.dumps(result)