Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Xlsx exporter overwrites headers and then parser fails #83

Open
warmist opened this issue Jan 18, 2023 · 1 comment
Open

[BUG] Xlsx exporter overwrites headers and then parser fails #83

warmist opened this issue Jan 18, 2023 · 1 comment
Assignees

Comments

@warmist
Copy link

warmist commented Jan 18, 2023

Describe the bug

Xlsx exporter eats the headers.

To Reproduce
Steps to reproduce the behavior:

  1. Export Xlsx
  2. Import back to ts
  3. Get error "Invalid XLSX file, check the headers!"

Expected behavior

Not have an error.

Desktop (please complete the following information):

  • OS windows
  • 4.5.0

Additional context
Offending line: Xlsxbuilder.cpp:41

Reasoning:

  • add row if it's the first one. It's never first one (to be fair i see there is a commit that makes the header optional)
  • parser has similar issue which then parses the header line, even if it's also checking them
@warmist warmist changed the title [BUG] [BUG] Xlsx exporter overwrites headers and then parser fails Jan 18, 2023
@hannes-ma
Copy link

hannes-ma commented May 5, 2023

We have encountered the same error. Even though the xlsx file contains the correct header line as first line in the document.

I figured the parser always expects on import that the version info is present on the first 2 rows and looks for the header line on the 3rd row. Version output can be omitted at export by setting the parameter "--no-version".

XslxParser.cpp:22:
const auto appVersion = qApp->applicationVersion(); const auto currentVersion = QVersionNumber::fromString(appVersion); const auto TsSupportVersion = QVersionNumber(4, 5, 0); InOutParameter p{ "", "", m_ioParameter.tsVersion, {} }; if (QVersionNumber::compare(currentVersion, TsSupportVersion) >= 0) { p.tsVersion = xlsx.read(2, 1).toString(); offsetRow = 2; }

IMO it should be checked that the document contains the ts version info and only if present advance by 2 rows:
if (QVersionNumber::compare(currentVersion, TsSupportVersion) >= 0) { if (xlsx.read(1,1) == TitleHeader::TsVersion) { p.tsVersion = xlsx.read(2, 1).toString(); offsetRow = 2; } }

EDIT: github code tag is somehow messing up my code formatting...don't know how to fix that, sry for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants