spine-tools / Spine-Toolbox

Spine Toolbox is an open source Python package to manage data, scenarios and workflows for modelling and simulation. You can have your local workflow, but work as a team through version control and SQL databases.
https://www.tools-for-energy-system-modelling.org/
GNU Lesser General Public License v3.0
70 stars 17 forks source link

Excel for exported outputs needs to be repaired #2632

Open danajhen opened 6 months ago

danajhen commented 6 months ago

Hello,

We have exported the outputs using the exporter to an excel, but the sheet has to be repaired every single time you open it. Repairing it returns the following message:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

error152120_01.xmlErrors were detected in file '...\.spinetoolbox\items\exporter\output\run@2024-02-29T13.34.07\Output_exported.xlsx'Repaired Records: Worksheet properties from /xl/workbook.xml part (Workbook)

By recovering it once, and saving it again you can bypass this problem, but it is of course less than ideal. Is there another way or another setting in Spine that could solve this issue?

Thanks!

soininen commented 6 months ago

I have never heard of or seen this error before. Is it possible to share the project and data so we could try to reproduce it? If not, can you be any more specific about what you are trying to export? Does the issue appear every time you export or is it due to some specific export mappings, i.e. does some very simple export to Excel succeed?

danajhen commented 6 months ago

The very simple export to Excel using SpineToTable succeeds, but using the following (specific) export mapping it results in the beforementioned error: exporter_energy_hub_model.json

soininen commented 6 months ago

Thanks for the specification! It looks like you are exporting alternatives as 'table name' which maps to sheet names in Excel. Sheet names have certain limitations such as their length cannot exceed 31 characters. Is this perhaps what is corrupting the Excel files? Are your alternative names longer than that? Do you use some special characters in the names?