Recent

Author Topic: .xlsx X .xls  (Read 9527 times)

nightrider

  • Full Member
  • ***
  • Posts: 139
.xlsx X .xls
« on: October 10, 2014, 02:38:29 pm »
Fiz 1 programa que lê uma planilha excel e carrega os dados numa base SQLite. A planilha original era formato .xlsx e dava erro de formato inválido ao tentar ler a planilha.
Abri a planilha .xlsx no excel e salvei-a como .xls. Quando mandei o mesmo programa ler a planilha no formato .xls o programa funcionou.
Concluí que as classes fspreadsheet não funcionam com o formato .xlsx.
A pergunta que tenho é: Está correta esta conclusão? Se estiver errada por que meu programa dá erro quando tento ler planilha .xlsx?

Saudações desde São Paulo - SP

Ricardo

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: .xlsx X .xls
« Reply #1 on: October 10, 2014, 03:10:11 pm »
<via Google Translate>
Eu acredito que você está correto. Leitura de arquivos xlsx com fpspreadsheet está incompleto. Você deve ser capaz de criar totalmente funcional .xlsx arquivos com fpspreadsheet mas mesmo assim, nem todos os elementos são suportados.
No entanto, fpspreadsheet está em constante desenvolvimento. Você já tentou carregar a versão mais recente via Lazarus-CCR? Você pode encontrar o seu problema já foi resolvido.

I believe you are correct.  Reading xlsx files with fpspreadsheet is incomplete.  You should be able to create fully working .xlsx files with fpspreadsheet but even then, not all elements are supported.
However, fpspreadsheet is under constant development.  Have you tried loading the latest version via Lazarus-CCR?  You may find your issue is already resolved.
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: .xlsx X .xls
« Reply #2 on: October 10, 2014, 03:12:12 pm »
Quote
goggle.translate of original posting:

I made one program that reads an excel spreadsheet and loads the data in an SQLite. The original spreadsheet was xlsx format and gave invalid format error when trying to read the spreadsheet.
Open the xlsx spreadsheet in excel and saved it as xls. When I sent the same program to read the spreadsheet in xls format the program worked.
Concluded that fspreadsheet classes do not work with xlsx format.
The question I have is: Is this conclusion correct? If he is wrong why my program gives error when I try to read xlsx spreadsheet?


Which version are you using? fpspreadsheet can read xlsx only since a few months. Please try the current trunk version of fpspreadsheet which contains additional fixes for non-readable xlsx files.

<google.translate to portuguese:>
Qual versão você está usando? fpspreadsheet pode ler xlsx só desde há alguns meses. Por favor, tente a versão atual do tronco fpspreadsheet que contém correções adicionais para arquivos xlsx não-legíveis.
« Last Edit: October 10, 2014, 03:18:28 pm by wp »

nightrider

  • Full Member
  • ***
  • Posts: 139
Re: .xlsx X .xls
« Reply #3 on: October 10, 2014, 04:10:42 pm »
I'm using the version 1.2.1 from sept 3rd, 2014. It seems to be last one. At least, this version is mentioned in Lazarus wiki as the last one...

Cheers

Ricardo

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: .xlsx X .xls
« Reply #4 on: October 10, 2014, 04:38:00 pm »
Quote
as the last one

As the last official/stable one.

Yes, 1.2.1 does not yet support xlsx reading. If you need it, switch to trunk, or wait a few weeks, it is slowly getting time for a new stable version which will contain the xlsx reader as well.

nightrider

  • Full Member
  • ***
  • Posts: 139
Re: .xlsx X .xls
« Reply #5 on: October 10, 2014, 05:37:54 pm »
The trunk management and SVN operations in general are so difficult to me. I'll wait.

Thanks

Ricardo

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: .xlsx X .xls
« Reply #6 on: October 10, 2014, 06:07:48 pm »
I assume you are on Windows:
  • Install TortoiseSVN which adds svn extensions to the Windows explorer.
  • Create a folder for the fpspreadsheet-trunk, e.g. c:\prog_lazarus\svn\fpspreadsheet.
  • Rightclick on this folder, select "SVN checkout".
  • Paste this string into the "URL of repository": svn://svn.code.sf.net/p/lazarus-ccr/svn/components/fpspreadsheet. The destination file is already correct.
  • OK loads the respository into your local folder - this may take some time.
  • Open lazarus, "Package" / "Open package file", navigate to the new folder and compile/install the fpspreadsheet packages.
From time to time you may want to update this version. This is much simpler: Just select "SVN Update" after right-clicking on the svn folder. Then compile & install.

Just give svn a try - it's worth the effort. You get access to the real world of open source!



rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: .xlsx X .xls
« Reply #7 on: October 10, 2014, 06:42:49 pm »
If you really, really, really don't want to go the SVN-way you could just go to http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/ and click the "Download Snapshot" in the upper right corner. It's the complete lazarus-ccr-svn with all components (68Mb) and you'll need to extract the fpspreadsheet-folder from the component directory.

But like wp says:
Just give svn a try - it's worth the effort. You get access to the real world of open source!
I would recommend it. (I also recommend the command-line utilities during install. Not sure if they are in the default installation of TortoiseSVN). With right-clicking the svn-folder you also have a clear picture of what is done since the last downloaded version under the TortoiseSVN / Show Log-menu.

neodarkman

  • New Member
  • *
  • Posts: 35
Re: .xlsx X .xls
« Reply #8 on: April 09, 2015, 08:05:48 pm »
Olá...
Eu uso o ZEXMLSS (http://www.avemey.com/) muito bom.
A fpspreadsheet é muito boa, mas falta algumas funcionalidades...

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: .xlsx X .xls
« Reply #9 on: April 09, 2015, 08:14:02 pm »
Olá...
Eu uso o ZEXMLSS (http://www.avemey.com/) muito bom.
A fpspreadsheet é muito boa, mas falta algumas funcionalidades...
Translated:
Quote
Hello ...
I use ZEXMLSS (http://www.avemey.com/) very good.
The fpspreadsheet is very good, but lacks some features ...
Could you point out some things you find lacking in the fpspreadsheet-library?

(Google Translated: Você poderia apontar algumas coisas que você encontra falta na biblioteca fpspreadsheet?)

neodarkman

  • New Member
  • *
  • Posts: 35
Re: .xlsx X .xls
« Reply #10 on: April 09, 2015, 08:37:36 pm »
Olá...
Eu uso o ZEXMLSS (http://www.avemey.com/) muito bom.
A fpspreadsheet é muito boa, mas falta algumas funcionalidades...
Translated:
Quote
Hello ...
I use ZEXMLSS (http://www.avemey.com/) very good.
The fpspreadsheet is very good, but lacks some features ...
Could you point out some things you find lacking in the fpspreadsheet-library?

(Google Translated: Você poderia apontar algumas coisas que você encontra falta na biblioteca fpspreadsheet?)

Leitura de arquivos xlsx por exemplo...
O uso da lib ZEXMLSS, na minha humilde opinião, é mais fácil, tem mais opções "cosmérticas" na criação e manipulação das planilhas xlsx e ods.
A fpspreadsheet é um ótimo trabalho, não há dúvidas, quanto a isso. Não  estou desmerecendo essa lib, inclusive, seu criador, me ajudou muito no passado. Mas eu acho o uso da ZEXMLSS mais simples,muito embora não tenha suporta para xls; o que é uma falha dela.... todavia como o uso do xls tem caído, isso não é um problema.

Google translated:
Quote
Reading .xlsx files for example ...
The use of lib ZEXMLSS, in my humble opinion, it is easier, have more options "cosmetic" in the creation and manipulation of spreadsheets and xlsx ods.
The fpspreadsheet is a great job, no doubt, for that matter. I'm not putting down this lib, even its creator, helped me a lot in the past. But I think the use of simpler ZEXMLSS, although it does not support to xls; what a failure it .... however as the use of xls has fallen, it is not a problem.


 

TinyPortal © 2005-2018