Recent

Author Topic: XLSX. There was a problem opening the file.  (Read 7085 times)

wofs

  • New Member
  • *
  • Posts: 16
XLSX. There was a problem opening the file.
« on: October 26, 2017, 07:41:32 pm »
Good afternoon!
I ask for help.
I use:
fpc 3.0.4
Lazarus 1.8 RC5
laz_fpspreadsheet 1.9
I can not open the file:
https://yadi.sk/d/apatpDeD3P8M94

I receive an error:
"is not a valid spreadsheet file."

Libre Office Calc opened the file without warning.

Help to understand the problem.

p.s. I apologize for my bad English
« Last Edit: October 26, 2017, 07:43:52 pm by wofs »
-----
Best Regards, Alexander D.

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: XLSX. There was a problem opening the file.
« Reply #1 on: October 27, 2017, 12:23:19 am »
The problem seems to be caused by the outline structure used in the file - if I remove the outline then the file loads without an error.

The outline feature is not supported by fpspreadsheet. But of course, this should not crash the reader. I must investigate where this happens...

wofs

  • New Member
  • *
  • Posts: 16
Re: XLSX. There was a problem opening the file.
« Reply #2 on: October 27, 2017, 06:28:49 am »
Good afternoon!
Thanks for the response!
I remove the outline then the file loads without an error.
And it is possible more in detail about a outline?
I do not care about the appearance kind of document - the data in it is important.
-----
Best Regards, Alexander D.

wofs

  • New Member
  • *
  • Posts: 16
Re: XLSX. There was a problem opening the file.
« Reply #3 on: October 27, 2017, 07:50:22 am »
I read about outline - this is a grouping. Other files with grouping are loaded perfectly (the grouping is ignored).
-----
Best Regards, Alexander D.

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: XLSX. There was a problem opening the file.
« Reply #4 on: October 27, 2017, 10:23:57 am »
You are right. Your last comment made me do this test: Load your original file into Excel and just save it again --> fpspreadsheet loads it without any issue.

The re-saved file is larger than the original one (796 kB vs 630 kB). Maybe the original file was not written correctly?

How was the file created? Which application was used to write it?
« Last Edit: October 27, 2017, 11:14:15 am by wp »

wofs

  • New Member
  • *
  • Posts: 16
Re: XLSX. There was a problem opening the file.
« Reply #5 on: October 27, 2017, 05:42:22 pm »
You are right. Your last comment made me do this test: Load your original file into Excel and just save it again --> fpspreadsheet loads it without any issue.
Yes, I saw it too.
Quote
The re-saved file is larger than the original one (796 kB vs 630 kB). Maybe the original file was not written correctly?
I admit this possibility. But I can not influence this.
Quote
How was the file created? Which application was used to write it?
The file was received via the Internet, this file is created by the 1C system. 1C - system of programs is intended for automation of everyday enterprise activities. That's all I could find out.

Thank you for your patience!
-----
Best Regards, Alexander D.

wofs

  • New Member
  • *
  • Posts: 16
Re: XLSX. There was a problem opening the file.
« Reply #6 on: October 28, 2017, 08:54:27 pm »
Good day!
I have several .xlsx files that do not read FPSpreadsheet.
In all cases, the error text is the same.
Please, help to solve the situation. I can not catch the procedure on which the FPSpreadsheet falls.
In all cases, Libre Office Calc opens without errors.
-----
Best Regards, Alexander D.

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: XLSX. There was a problem opening the file.
« Reply #7 on: October 28, 2017, 10:57:24 pm »
I found out that the reader crashes very early in the sheet1.xml file (a subfile within your xlsx):
Code: XML  [Select][+][-]
  1. ...
  2. <sheetData>  
  3.     <row r="1" ht="16" customHeight="true">
  4.          <c r="B1" s="2" t="e" />
  5. ...

The last line here defines the content of cell "B1". It is formatted with style #2 (s="2") and it is an error cell (t="e"). But the type of error is not specified. And this is where fpspreadsheet chokes because it expects the standard Excel error codes here, such as #DIV/0 etc. I don't know if this is type of error cell is correct, but I don't think that that it is such a severe error to stop reading here. Therefore, I modified the xlsx reader to create an empty cell in case of such a "false" error cell.

Now your file can be read without crashing.
 
« Last Edit: October 28, 2017, 11:30:15 pm by wp »

wofs

  • New Member
  • *
  • Posts: 16
Re: XLSX. There was a problem opening the file.
« Reply #8 on: October 29, 2017, 09:14:41 am »
Good afternoon!
Thanks for corrections! With this file the problem is solved!
And most importantly, thanks for the way to fix the problem.

With another file, this fix, unfortunately, did not help. I'll try to find out why this is so, using this example.
-----
Best Regards, Alexander D.

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: XLSX. There was a problem opening the file.
« Reply #9 on: October 29, 2017, 09:47:07 am »
Please upload the file which cannot be read (preferrably into this forum, rename its extension to zip for the forum software to accept it).

wofs

  • New Member
  • *
  • Posts: 16
Re: XLSX. There was a problem opening the file.
« Reply #10 on: October 29, 2017, 02:11:37 pm »
Here is the file. Only now I get the error "Out of memory".
В файле Laz2_DOM.pas.

Windows 7 Home Basic x64 5Gb RAM.

The program is x32 bit.

Moreover, the repeated saving of Libre Office Calc does not solve the problem. It was possible to load only having cut off a file on 1/3.

I apologize, but the forum did not allow downloading such a large file. I left it at the link:
https://yadi.sk/d/4sg5Qo7J3PCGy6
-----
Best Regards, Alexander D.

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: XLSX. There was a problem opening the file.
« Reply #11 on: October 29, 2017, 04:13:59 pm »
I am able to load the file in a non-gui program (examples/read_write/ooxmlread); with gui (examples/visual/fpsctrls) it fails to load using 32-bit Lazarus, but is read successfully with 64-bit.

So, I think you should compile your program as 64bit application. The file is not extraordinarily large, but the xlsx reader of fpspreadsheet is not very efficient in memory consumption.

wofs

  • New Member
  • *
  • Posts: 16
Re: XLSX. There was a problem opening the file.
« Reply #12 on: October 29, 2017, 05:23:21 pm »
I understand, thank you very much!
-----
Best Regards, Alexander D.

 

TinyPortal © 2005-2018