[Interest] Example of writing an .xls file using a qt program

Waitman Gobble uzimac at da3m0n8t3r.com
Thu Jul 5 23:04:35 CEST 2012


Fabio Giovagnini <fabio.giovagnini at gmail.com> wrote ..
> Hi all,
> I'd like to study how to write a .xls file using a qt program.
> 
> Thanks in advance for help
> 
> Fabio Giovagnini
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest


Hi,

it's a cheat.. but I've always written HTML and saved it with xls extension, it's not really an excel file but manages to fake it out. :-)
(but this is method I use on web, when client wants to download data in xls format. haven't tried with Qt but should be similar results.). 
..I think with latest office it gives the user a strange message but works anyway.
Also works with LibreOffice, OpenOffice. (presents user with import options, usually fine just to hit OK)

Works with static data, not sure about formulas/functions...


example: save as test.xls

<html>
<head>
<title>foo</title>
</head>
<body>
<table>
<tr>
<td>1</td>
<td>Line 1</td>
<td>$54.94</td>
<td>Extra Stuff</td>
</tr>
<tr>
<td>2</td>
<td>Line 2</td>
<td>$63.32</td>
<td>more Extra Stuff</td>
</tr>
</table>
</body>
</html>



-- 
Waitman Gobble
San Jose California USA



More information about the Interest mailing list