Recent

Author Topic: Excel 2010 cannot read large(ish, 8MB) files created by fpspreadsheet  (Read 11796 times)

grandehombre

  • New Member
  • *
  • Posts: 42
Hi,

I am using Lazarus v1.0.10  i386-win32-win32/win64,  FPC v2.6.2 on Win7-64.
I use fpspreadsheet (can't find version numbers in source, however, it was extracted from fpspreadsheet-1.1.zip)

I use the excel8write and uncomment the looper in line 45, I generate a 9000 lines file with 8 columns (instead of just 4 shown in the example).
This creates a 7MB file (attached test2a.xls)   which Excel2010 rejects.

If I reduce the file size by using just 4 columns but still 9000 rows. Excel has no problems reading this (attached file test2b.xls)

Please note that, in the excel8write demo, I also changed the lines used in that 9000 row loop from WriteAnsi.. to WriteUTF8Text.

I have attached a zip file that contains the failing xls file (due to attachment restrictions I can't attach both)

Cheers,
Nick
Lazarus v1.2RC2  i386-win32-win32/win64,  FPC v2.6.2, svn43696 on Win7-64 and win8.1

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Why don't you post the source code in another post then? Saves us having to guess/reconstruct ;)

Edit: tried to open the .xls file in LibreOffice 4.0.4=>result: 1 sheet without any contents... Also creation date in properties was something like 0000-00-00 which doesn't seem right either.
« Last Edit: July 02, 2013, 01:41:33 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

wp

  • Hero Member
  • *****
  • Posts: 13353
I can confirm the behaviour in the first posting, however, it seems to depend on the number of columns and on the amount of text in each cell. With 9000 rows and a single character text in each cell, I can write more than 32, but less then 64 columns. But with a string of length 105 I cannot write even 4 columns.

You probably should post a bug report.

grandehombre

  • New Member
  • *
  • Posts: 42
Why don't you post the source code in another post then? Saves us having to guess/reconstruct ;)

Edit: tried to open the .xls file in LibreOffice 4.0.4=>result: 1 sheet without any contents... Also creation date in properties was something like 0000-00-00 which doesn't seem right either.


Please find attached 1.zip containing the modified source for excel8write. I could not include the EXE due to attachment size restrictions.
Thanks for replying!
Lazarus v1.2RC2  i386-win32-win32/win64,  FPC v2.6.2, svn43696 on Win7-64 and win8.1

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Great, thanks! Should be no need for the exe as we should be able to compile this ourselves.

NB (for future reference): no need to include the .o file; you can fairly easily get only the source files by using project/publish project and zip up the resulting directory...)

Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
With Lazarus 1.0.10 (and FPC 2.6.2 x86 on Windows), with  fpspreadsheet at the latest SVN version (revision 2731 date 13 February), and the program you uploaded, I get a spreadsheet that LibreOffice 4.0.4 and Excel XP (2002) can read...


Edit: See Removed attached zip... due to post below.
« Last Edit: July 02, 2013, 03:35:38 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

wp

  • Hero Member
  • *****
  • Posts: 13353
But you will have an unreadable xls when you increase the number of columns. In my case, the ParamStr(0) is 43 characters long and Excel 2007 cannot read the file if it has more than 14 columns.
« Last Edit: July 02, 2013, 02:29:31 pm by wp »

grandehombre

  • New Member
  • *
  • Posts: 42
I am downloading the latest version from SF svn and will report back what I discover.
Lazarus v1.2RC2  i386-win32-win32/win64,  FPC v2.6.2, svn43696 on Win7-64 and win8.1

grandehombre

  • New Member
  • *
  • Posts: 42
Bad news, I am afraid.

I downloaded the latest from SF svn   (lazarus-ccr-svn-2756.zip) and re-run the test program.
It generated a 7MB file which could not be read by either LibreOffice or Excel.

:-(
Lazarus v1.2RC2  i386-win32-win32/win64,  FPC v2.6.2, svn43696 on Win7-64 and win8.1

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Strange. We're using the same Lazarus/compiler on the same OS. Only difference would be fpspreadsheet I suppose.

I'll send you the fpspreadsheet files I used by pm so you can compare if you want to...
Hmmm there doesn't seem to be a way to send attachments.

Uploaded everything to
http://ubuntuone.com/6l5vgablzHAZMkuPXOqTZS
as I don't want to spam the forum with too many attachments...
« Last Edit: July 02, 2013, 03:04:01 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

grandehombre

  • New Member
  • *
  • Posts: 42
Re: Excel 2010 cannot read large(ish, 8MB) files created by fpspreadsheet
« Reply #10 on: July 02, 2013, 03:30:36 pm »
Ahem... it still fails.

Please note that my file contains
'D:\work\FreePascal\components\in-use, fpspreadsheet\examples\excel8demo\2\excel8write.exe'
in each of the 8 columns and generates a 7MB file (that still fails)

If your path is different, your file size will be different.
Copy the above string and use that to fill 8 columns and 9000 rows. You'll probably find that it will fail :-(
Lazarus v1.2RC2  i386-win32-win32/win64,  FPC v2.6.2, svn43696 on Win7-64 and win8.1

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Excel 2010 cannot read large(ish, 8MB) files created by fpspreadsheet
« Reply #11 on: July 02, 2013, 03:34:03 pm »
Pfff. Sure. Had overlooked that.

Why not write a test program that fills the spreadsheet with... like... a... you know... constant text!?!?

Edit: Anyway, I'd suggest reporting it as a bug. Together with a testable/repeatable test project...
« Last Edit: July 02, 2013, 03:37:24 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

grandehombre

  • New Member
  • *
  • Posts: 42
Re: Excel 2010 cannot read large(ish, 8MB) files created by fpspreadsheet
« Reply #12 on: July 02, 2013, 03:40:06 pm »
>>Why not write a test program that fills the spreadsheet with... like... a... you know... constant text!?!?
I simply picked up the example program and run with it...

I'll use some constant text and report as a bug tomorrow.
Too late and too tired at the moment.

Thank you for all your help!

Cheers,
Nick
Lazarus v1.2RC2  i386-win32-win32/win64,  FPC v2.6.2, svn43696 on Win7-64 and win8.1

wp

  • Hero Member
  • *****
  • Posts: 13353
Re: Excel 2010 cannot read large(ish, 8MB) files created by fpspreadsheet
« Reply #13 on: July 02, 2013, 03:47:25 pm »
This is similar to the old bug that José Mejuto fixed about a year ago (http://forum.lazarus.freepascal.org/index.php/topic,16716.0.html - see his posting towards the end of that thread). He speaks of a file needing "more than 2 FAT sectors", maybe there is another limitation like this -- Unfortunately my understanding of the excel file structure is too limited...

grandehombre

  • New Member
  • *
  • Posts: 42
Re: Excel 2010 cannot read large(ish, 8MB) files created by fpspreadsheet
« Reply #14 on: July 02, 2013, 04:56:28 pm »


Edit: Anyway, I'd suggest reporting it as a bug. Together with a testable/repeatable test project...

Done: Mantis ID = 0024697
Lets hope for the best
Lazarus v1.2RC2  i386-win32-win32/win64,  FPC v2.6.2, svn43696 on Win7-64 and win8.1

 

TinyPortal © 2005-2018