Added 'excelexporters.equipmentoutput.export()' method

pull/2/head
YangZhang-GitHub 2021-03-04 14:53:50 +08:00
parent f0589cbb97
commit 18a3e8e7d8
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.equipmentoutput
class Reporting:
@ -469,4 +470,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.equipmentoutput.export(result,
equipment['name'],
reporting_start_datetime_local,
reporting_end_datetime_local,
period_type)
resp.body = json.dumps(result)