<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ca">
	<id>http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Libxl%3A_llegir_i_escriure_fitxers_Excel</id>
	<title>Libxl: llegir i escriure fitxers Excel - Historial de revisió</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.joanillo.org/index.php?action=history&amp;feed=atom&amp;title=Libxl%3A_llegir_i_escriure_fitxers_Excel"/>
	<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Libxl:_llegir_i_escriure_fitxers_Excel&amp;action=history"/>
	<updated>2026-08-30T05:48:40Z</updated>
	<subtitle>Historial de revisió per a aquesta pàgina del wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://wiki.joanillo.org/index.php?title=Libxl:_llegir_i_escriure_fitxers_Excel&amp;diff=250298&amp;oldid=prev</id>
		<title>Joan: Es crea la pàgina amb «*http://www.libxl.com/download.html  LibXL is a library for direct reading and writing Excel files.  Package contents: &lt;pre   doc              C++ documentation   example...».</title>
		<link rel="alternate" type="text/html" href="http://wiki.joanillo.org/index.php?title=Libxl:_llegir_i_escriure_fitxers_Excel&amp;diff=250298&amp;oldid=prev"/>
		<updated>2013-02-06T16:58:13Z</updated>

		<summary type="html">&lt;p&gt;Es crea la pàgina amb «*http://www.libxl.com/download.html  LibXL is a library for direct reading and writing Excel files.  Package contents: &amp;lt;pre   doc              C++ documentation   example...».&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pàgina nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;*http://www.libxl.com/download.html&lt;br /&gt;
&lt;br /&gt;
LibXL is a library for direct reading and writing Excel files.&lt;br /&gt;
&lt;br /&gt;
Package contents:&lt;br /&gt;
&amp;lt;pre&lt;br /&gt;
  doc              C++ documentation&lt;br /&gt;
  examples/c       C examples (type 'make' to build them)&lt;br /&gt;
  examples/c++     C++ examples (type 'make' to build them)&lt;br /&gt;
  examples/cb      Code::Blocks project&lt;br /&gt;
  examples/qt      Qt project&lt;br /&gt;
  include_c        headers for c&lt;br /&gt;
  include_cpp      headers for c++&lt;br /&gt;
  lib              32-bit dynamic library&lt;br /&gt;
  lib64            64-bit dynamic library&lt;br /&gt;
  changelog.txt    change log&lt;br /&gt;
  license.txt      end-user license agreement&lt;br /&gt;
  readme.txt       this file&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
  g++ -I &amp;lt;path_to_headers&amp;gt; -L &amp;lt;path_to_library&amp;gt; -lxl -Wl,-rpath,&amp;lt;path_to_library&amp;gt; &amp;lt;your_cpp_file&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Descarrego '''libxl-3.4.1.4''' i descomprimeixo. Compilo els exemples (elegeixo C en comptes de C++)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /libxl-3.4.1.4/examples/c&lt;br /&gt;
$ make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
i es compilen els exemples i ja els puc executar, per exemple:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ./generate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
que és un exemple senzill que genera un fitxer Excel&lt;br /&gt;
&lt;br /&gt;
Si vull fer la compilació directa he de mirar les instruccions dins del Makefile. Per exemple,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ gcc -o generate generate.c -I ../../include_c -L ../../lib -lxl -Wl,-rpath,../../lib&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(utilitzar lib64 per a 64 bits)&lt;br /&gt;
&lt;br /&gt;
i ara, si vull compilar aquest fitxer en la meva carpeta de treball /home/joan/jmining/generate_xls he de copiar la carpeta ''include_c''/ i ''lib/'' o ''lib64/'', i ara ja puc començar a treballar per fer coses més interessants.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ gcc -o generate generate.c -I ./include_c -L ./lib -lxl -Wl,-rpath,./lib&lt;br /&gt;
$ ./generate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
compila bé.&lt;br /&gt;
&lt;br /&gt;
El codi '''generate.c''' és un codi mínim per crear un fitxer Excel i escriure alguna cosa. Fitxer '''generate.c''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;quot;libxl.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    BookHandle book = xlCreateBook();&lt;br /&gt;
    if(book) &lt;br /&gt;
    {&lt;br /&gt;
        SheetHandle sheet = xlBookAddSheet(book, &amp;quot;Sheet1&amp;quot;, 0);&lt;br /&gt;
        if(sheet) &lt;br /&gt;
        {&lt;br /&gt;
            FormatHandle dateFormat;&lt;br /&gt;
&lt;br /&gt;
            xlSheetWriteStr(sheet, 2, 1, &amp;quot;Hello, World !&amp;quot;, 0);&lt;br /&gt;
            xlSheetWriteNum(sheet, 3, 1, 1000, 0);&lt;br /&gt;
&lt;br /&gt;
            dateFormat = xlBookAddFormat(book, 0);&lt;br /&gt;
            xlFormatSetNumFormat(dateFormat, NUMFORMAT_DATE);&lt;br /&gt;
            xlSheetWriteNum(sheet, 4, 1, xlBookDatePack(book, 2008, 4, 29, 0, 0, 0, 0), dateFormat);&lt;br /&gt;
&lt;br /&gt;
            xlSheetSetCol(sheet, 1, 1, 12, 0, 0);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if(xlBookSave(book, &amp;quot;example.xls&amp;quot;)) printf(&amp;quot;File example.xls has been created.\n&amp;quot;);&lt;br /&gt;
        xlBookRelease(book);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
que s'entén fàcilment.&lt;br /&gt;
&lt;br /&gt;
{{Autor}}, febrer 2013&lt;/div&gt;</summary>
		<author><name>Joan</name></author>
		
	</entry>
</feed>