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

Resulting file exceeds the maximum number of rows #166

Open
Dan-DH opened this issue Jul 25, 2022 · 7 comments
Open

Resulting file exceeds the maximum number of rows #166

Dan-DH opened this issue Jul 25, 2022 · 7 comments

Comments

@Dan-DH
Copy link

Dan-DH commented Jul 25, 2022

I seem to run into this issue only when using ${table:}. The resulting file is around 10x bigger than the template, and I get an error message when I open it:

"Warning loading document xyz.xlsx: The data could not be loaded completely because the maximum number of rows per sheet was exceeded"

The report itself looks fine, however, and if I save the file, it will decrease to a normal size and the error won't reappear.

@philiparvidsson
Copy link

Also need help on this.

@kant2002
Copy link
Collaborator

Can somebody share template and small script for this issue?

@philiparvidsson
Copy link

I can't because I'm building it from internal company documents.

I found the issue, I think. If I save the template file with LibreOffice, I get this error. If I save it from MS Excel, then the template works fine.

@kant2002
Copy link
Collaborator

I don't need exact template. If you can create small sample that would be fine. Maybe you are using images/checkboxes or other stuff inside template.

@philiparvidsson
Copy link

No, just text cells. As soon as I save the file with LibreOffice, the issues occurs.

@valentin-puiu
Copy link

Hello,

I have the same problem. Attached is the file template and the data that I pass to the file.

{ "receiptCode": "RCV000000463", "receiptDate": "30-05-2023", "location": "A02-1", "supplier": "new-supplier", "supplierCode": "code", "deliveryNote": "test with uom and price", "data": [ { "part": "FBB-GC1_WT250_700x1000ARE", "description": "folding box board 250g arktika", "um": 4, "quantity": 10857.142857142857, "value": 380000, "price": 35, "umName": "Sheet", "vat": 72200 }, { "part": "FBB-LIN_WT210_964x600MMS", "description": "Folding Box Board Topliner 210g from MM Kolicevo", "um": 4, "quantity": 12345.67901234568, "value": 450000.00000000006, "price": 36.45, "umName": "Sheet", "vat": 85500.00000000001 } ], "partsValue": 830000, "vatValue": 157700, "totalValue": 987700 }

Thank you for your help.
template.xlsx

@moopmonster
Copy link

moopmonster commented Aug 11, 2023

Had this issue before, where my templates were modified (from MS) in LibreOffice, and after running it through xlsx-template, people using Microsoft Excel reported that the file was corrupted.

I had to use MS Office 365 (online) to create my templates from scratch, due to finding out that my templates (in LibreOffice) were being detected by the ElementTree parser as having more rows that i intended it to have.

Example, for the above template.xlsx provided by @valentin-puiu, from analysis via etree.tostring(sheet.root), it gives :

<dimension ref="A2:I1048576" /> and
<SheetData> ...
<row collapsed="false" customFormat="false" customHeight="false" hidden="false" ht="12.8" outlineLevel="0" r="1048575" />
<row collapsed="false" customFormat="false" customHeight="false" hidden="false" ht="12.8" outlineLevel="0" r="1048576" />
</SheetData>

This is indication of phantom rows in the spreadsheet ( 1048576 Rows ??? ), which you can either programmatically clean, or just create new spreadsheet and copy paste the columns you need (A1 to L18) into a brand new spreadsheet.

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

5 participants