framework
framework copied to clipboard
Writing of two sheets into one excel file not possible
I'm working on a project where I have to generate an Excel (.xlsx) from database information. The Excel File has to have two sheets. I'm trying to solve this by generating two resources and using the write method for each of them on the same path. But unfortunately, the later operation always overwrites the old sheet in the file.
That's the important part of the code:
resourceAnweisungen = Resource(data=scriptData,
schema="scripts/schema.xlsx.lohctopusMitKontrollint.json")
resourceInformation = Resource(data=scriptInfo,
schema="scripts/schema.xlsx.lohctopus.informationen.json")
.....
# write the data in a local xlss
target = resourceAnweisungen.write('scripts/first_output_script_download.xlsx',
control=formats.ExcelControl(sheet='anweisungen'))
target = resourceInformation .write('scripts/first_output_script_download.xlsx',
control=formats.ExcelControl(sheet='informationen'))
I assume it's a bug, or it was implemented only with one sheet in mind?
Thank you @djsjo for reporting!.