Recent

Author Topic: Status of fpSpreadsheet  (Read 21731 times)

Arbee

  • Full Member
  • ***
  • Posts: 223
Status of fpSpreadsheet
« on: September 07, 2011, 04:32:25 pm »
In earlier topics on  the internet it was mentioned that fpSpreadsheet can only reliably read spreadsheets that have been created by fpSpreadsheet itself.  That - alas - kind of defeats the purpose of the package.  At least for me, because I need to process sheets that are invariably created and maintained with the original applications, either Excel, OOo or Lotus Symphony.

And indeed it turns out that - although I can open the workbooks - I can not read data from them in a consistent way.   So the question is, is this limitation still there?  Or do I somehow use a backlevel release?  It dates back to 2009, so I wonder ... is there still development in fpSpreadsheet?
 
1.0/2.6.0  XP SP3 & OS X 10.6.8

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Status of fpSpreadsheet
« Reply #1 on: September 07, 2011, 06:19:28 pm »
So the question is, is this limitation still there?

I don't know, why don't you test and tell us?

Quote
  Or do I somehow use a backlevel release?  It dates back to 2009, so I wonder ... is there still development in fpSpreadsheet?

Yes, a lot has changed. You should use the subversion version: http://wiki.lazarus.freepascal.org/FPSpreadsheet#Subversion

bonmario

  • Sr. Member
  • ****
  • Posts: 346
Re: Status of fpSpreadsheet
« Reply #2 on: May 26, 2014, 11:48:54 am »
Hi,
i have added this bug on mantis: http://mantis.freepascal.org/view.php?id=26221

Same project with a older version works fine.

Thanks, Mario

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Status of fpSpreadsheet
« Reply #3 on: May 26, 2014, 12:09:22 pm »
Moved bug to lazarus ccr as specified in http://wiki.lazarus.freepascal.org/FPSpreadsheet#Support_and_Bug_Reporting
Haven't looked at the bug itself yet though
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: 11912
Re: Status of fpSpreadsheet
« Reply #4 on: May 26, 2014, 01:02:46 pm »
This is not a bug. fpSpreadsheet exposes the count of columns and rows as GetLastColNumber and GetLastRowNumber which means the index of the last column and row. Therefore you should not subtract 1 from these numbers as you would do if the were the "count".

@BigChimp: Maybe we should rename these quantities to GetLastColIndex and GetLastRowIndex to avoid this kind of confusion?

@bonmario: You seem to duplicate the behavior of TsWorksheetGrid. Did you have a look at the current version of this grid component? There has been considerable improvement. It also reads and writes formatting information now (unfortunately not for ods, but this will be implemented shortly).

bonmario

  • Sr. Member
  • ****
  • Posts: 346
Re: Status of fpSpreadsheet
« Reply #5 on: May 26, 2014, 01:24:37 pm »
Hi, if you open the file "CATAPGPB.ods", all cells with "K" is in the column "K".
If you execute the program, this is not.

With an older version of fpspreadsheet it's alla ok.

Thanks, Mario

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Status of fpSpreadsheet
« Reply #6 on: May 26, 2014, 02:07:00 pm »
This is not a bug. fpSpreadsheet exposes the count of columns and rows as GetLastColNumber and GetLastRowNumber which means the index of the last column and row. Therefore you should not subtract 1 from these numbers as you would do if the were the "count".

@BigChimp: Maybe we should rename these quantities to GetLastColIndex and GetLastRowIndex to avoid this kind of confusion?
I would mark GetLastRowNumber/GetLastColNumber as deprecated, and add the new functions in order to keep backward compatibility, but yes, that makes sense.
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: 11912
Re: Status of fpSpreadsheet
« Reply #7 on: May 26, 2014, 02:41:33 pm »
Quote from: Bonmario
Hi, if you open the file "CATAPGPB.ods", all cells with "K" is in the column "K".
If you execute the program, this is not.
Thanks for clarifying. This seems to be an .ods issue because if I store the file as xls it loads correctly. I'll look into this issue in the evening.
« Last Edit: May 26, 2014, 02:43:24 pm by wp »

wp

  • Hero Member
  • *****
  • Posts: 11912
Re: Status of fpSpreadsheet
« Reply #8 on: May 26, 2014, 05:04:43 pm »
Fixed in rev 3100. The attached screenshot shows your file in the output of the fpsgrid demo


wp

  • Hero Member
  • *****
  • Posts: 11912
Re: Status of fpSpreadsheet
« Reply #9 on: May 26, 2014, 05:29:32 pm »
Quote from: BigChimp
I would mark GetLastRowNumber/GetLastColNumber as deprecated, and add the new functions in order to keep backward compatibility, but yes, that makes sense.

Done in rev 3101

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Status of fpSpreadsheet
« Reply #10 on: May 26, 2014, 05:35:56 pm »
Thanks for the huge amount of work you put in, wp :)
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

bonmario

  • Sr. Member
  • ****
  • Posts: 346
Re: Status of fpSpreadsheet
« Reply #11 on: May 26, 2014, 06:13:02 pm »
Thanks for the huge amount of work you put in, wp :)

Thanks !!!!!!  O:-) O:-)

Hi, Mario

Caravelle

  • Jr. Member
  • **
  • Posts: 52
Re: Status of fpSpreadsheet
« Reply #12 on: May 28, 2014, 11:51:49 pm »
Lazarus 1.0.12 FPC 2.6.2

Please bear with me, I'm a comparative beginner at Lazarus and fpSpreadsheet is the first add-on I've attempted to add on.  Firstly I did not know that the zip download at SourceForge was an unwise choice, secondly it took me an age to work out how to install it into Lazarus and I'm still not convinced I managed it properly, third there were several failed attempts to open a small Excel 2003 .xls file, fourth an attempt to run the write demo produced a message that some required component could not be found...

So I came looking in this Forum and found this thread which suggests that a more advanced package has to be downloaded from this mysterious SVN thing (it may mean something to you guys, but absolutely nothing to me). I eventually downloaded TortoiseSVN but have to say the Help is over my head.  I tried "svn checkout svn://svn.code.sf.net/p/lazarus-ccr/svn/components/fpspreadsheet fpspreadsheet" at the command prompt as recommended by the wiki at the URL in a message below, and after a while... nothing happened.   But then I don't know what was supposed to happen.  Nothing seems to be any different, I get the same message from excel5write.dpr that fpsconvencoding cannot be found. 

Please, where do I start to sort all this out ?  Do I have to uninstall something, and if so what and how? Where can I find help for beginners with no knowledge of or even interest in the internal workings of the Lazarus IDE, that covers all this ?   I used to use XLSMini in Delphi 7 and never had any problem with that.   All I want to do is read plain text from the cells of simple Excel worksheets, nothing complicated. Looks like it might be quicker to just export as a csv file from Excel, I've probably spent more time today trying to install fpSpreadsheet than it can possibly save me through not having to do work with csv files.

Many thanks

Caravelle

wp

  • Hero Member
  • *****
  • Posts: 11912
Re: Status of fpSpreadsheet
« Reply #13 on: May 29, 2014, 01:02:44 pm »
Assuming you are on Windows (since you mention Delphi) I'd give you these step-by-step instructions:
  • Download tortoisesvn and install it (as you already did). The only thing that you see of it at the moment is an extended context menu.
  • Create a folder for the svn files ("working folder"). Navigate into that folder.
  • Right-click on that folder, select "SVN Checkout" - this one of new menu items of TortoiseSVN.
  • Paste "svn://svn.code.sf.net/p/lazarus-ccr/svn/components/fpspreadsheet" into the field "URL of repository". The field "Checkout directory" should containt the current path to the destination folder, the other settings should be correct as well.
  • "OK" copies all the files from the svn repository (the svn://svn.code.. thing) into your working folder. This may take some time
  • If you want to update your working folder later to the current version in the repository, right-click onto the working folder in the Explorer and select "SVN Update". OK will keept your working folder in sync with the repository, i.e. copy changed files, remove deleted ones. etc.
  • Run Lazarus
  • Select "Package"/"Open package file (.lpk)". Navigate into the working directory and load "laz_fpspreadsheet.lpk".
  • In the Package dialog select "Compile"
  • If you want to use also visual controls of fpspreadsheet (the grid or the TAChart datasource) you also have to load "laz_fpspreadsheet_visual.lpk". In this case you also have to select "Use" and "Install". This recompiles Lazarus and adds these visual controls to the component palette. Again, may take some time. Lazarus closes and automatically opens the new version.
  • That's all for the preparations.
  • To write your own programs using fpspreadsheet, try one of the examples first. The "excel*demo" folders contains very short commandline sample how to write to or read from Excel files of various versions. Excel2003 that you mention is covered by the excel8demo. Or you can try the fpsgrid demo which shows the spreadsheet grid - I must confess, though, that this example may be a bit too overloaded for a beginner. And you MUST have installed the visual package for the grid example to run. laz_fpspreadsheet.lpk is sufficient for the other excel*demo examples.
  • There is also a wiki giving the basic documentation http://wiki.lazarus.freepascal.org/FPSpreadsheet
  • And please, you must be aware that you are using a development version of the software. So, things may change easily. We are doing our best to avoid regressions and to be compatible with previous versions, but sometime we see too late that one development lead into a dead end and we have to revert. Just ask here if something does not work any more.

Caravelle

  • Jr. Member
  • **
  • Posts: 52
Re: Status of fpSpreadsheet
« Reply #14 on: June 08, 2014, 04:49:42 pm »
Many thanks for this comprehensive reply.  I apologise for the delay in responding, I have been unwell.  I shall follow your advice, see what happens and let you know the result.  It may take some time I'm afraid, I have a lot to catch up on  :'(.


 

TinyPortal © 2005-2018