Handling Microsoft Excel file format: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Handling Microsoft Excel (file format)=
[[Category:Developing_with_Qt]]<br />[toc align_right=&quot;yes&amp;quot; depth=&quot;2&amp;quot;]


This page discusses various available options for working with [http://en.wikipedia.org/wiki/Microsoft_Excel#File_formats Microsoft Excel] ''[en.wikipedia.org]'' documents in your Qt application. Please also read the general considerations outlined on the [[Handling Document Formats]] page.
= Handling Microsoft Excel (file format) =


''<font size="0.9em"><font color="#335">Note that this information is collaboratively collected by the community, with no promise of completeness or correctness. In particular, use your own research and judgment when evaluating third-party libraries or tools!</font></font>''
This page discusses various available options for working with &quot;Microsoft Excel&amp;quot;:http://en.wikipedia.org/wiki/Microsoft_Excel#File_formats documents in your Qt application. Please also read the general considerations outlined on the [[Handling_Document_Formats | Handling Document Formats]] page.
 
p{width:60%;border:solid 1px #99a;background:#eef;color:#335;padding:2pt 4pt;font-size:0.9em;line-height:150%;font-style:italic}. Note that this information is collaboratively collected by the community, with no promise of completeness or correctness. In particular, use your own research and judgment when evaluating third-party libraries or tools!


One needs to distinguish between two different formats (this page deals with both of them):
One needs to distinguish between two different formats (this page deals with both of them):


{| class="infotable line" style="width: 95%; margin-left: 2.5%"
table{width:95%;margin-left:2.5%}.<br />| |''. Legacy &quot;Excel Spreadsheet&amp;quot; format |''. &quot;Office Open XML Workbook&amp;quot; format |<br />| ''classification:'' | binary BIFF-based | XML-based |<br />| ''main filename extension:'' | {font:1em monospace}.xls | {font-family:monospace}.xlsx |<br />| ''main internet media type:'' | {font:0.9em monospace}application/vnd.ms-excel | {font:0.9em monospace}application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |<br />| ''default format of Excel:'' | until Excel 2003 | since Excel 2007 |
|
 
! Legacy “Excel Spreadsheet” format
== Reading / Writing ==
! “Office Open <span class="caps">XML</span> Workbook” format
|-
| ''classification:''
| binary <span class="caps">BIFF</span>-based
| <span class="caps">XML</span>-based
|-
| ''main filename extension:''
| <span style="font: 1em monospace">.xls</span>
| <font face="monospace">.xlsx</font>
|-
| ''main internet media type:''
| <span style="font: 0.9em monospace">application/vnd.ms-excel</span>
| <span style="font: 0.9em monospace">application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</span>
|-
| ''default format of Excel:''
| until Excel 2003
| since Excel 2007
|}


==Reading / Writing==
=== Using Excel itself ===


===Using Excel itself===
If you are exclusively targeting the Windows platform and Microsoft Excel will be installed on all target machines, then you can use &quot;Qt's ActiveX framework&amp;quot;:http://doc.qt.io/qt-4.8/activeqt.html to access Excel's spreadsheet processing functionality through OLE automation. For an introductory code example (and a way to list the API provided by the Excel COM object), consult [[Using_ActiveX_Object_in_QT | this how-to]].


If you are exclusively targeting the Windows platform and Microsoft Excel will be installed on all target machines, then you can use [http://doc.qt.io/qt-4.8/activeqt.html Qt’s ActiveX framework] ''[qt.io]'' to access Excel’s spreadsheet processing functionality through <span class="caps">OLE</span> automation. For an introductory code example (and a way to list the <span class="caps">API</span> provided by the Excel <span class="caps">COM</span> object), consult [[Using ActiveX Object in QT|this how to]].
table{width:95%;margin-left:2.5%}.<br />| |''. DLL file name |''. COM object name |''. platforms |''. license |<br />| &quot;'''Microsoft Excel'''&quot;:http://office.microsoft.com/excel/ | ? | {font-family:monospace}Excel.Application | Windows | {color:#458}commercial |


{| class="infotable line" style="width: 95%; margin-left: 2.5%"
=== Using ODBC ===
|
! <span class="caps">DLL</span> file name
! <span class="caps">COM</span> object name
! platforms
! license
|-
|
[http://office.microsoft.com/excel/ '''Microsoft Excel'''] ''[office.microsoft.com]''
| ?
| <font face="monospace">Excel.Application</font>
| Windows
| <font color="#458">commercial</font>
|}


===Using <span class="caps">ODBC</span>===
p{border:dashed 1px #a94;background:#fbf3dd;color:#530;padding:2pt 4pt;margin-left:2pt;margin-right:2pt;font-size:0.9em;line-height:150%;font-style:italic}. TODO: Info on using ODBC drivers (via QSqlDatabase) for accessing Excel spreadsheets - please fill out this section if you know more. (What is the ODBC driver called? Where does it come from? Windows only or also Mac/Linux? Link to sample code snippet?)


''<font size="0.9em"><font color="#530"><span class="caps">TODO</span>: Info on using <span class="caps">ODBC</span> drivers (via QSqlDatabase) for accessing Excel spreadsheets – please fill out this section if you know more. (What is the <span class="caps">ODBC</span> driver called? Where does it come from? Windows only or also Mac/Linux? Link to sample code snippet?)</font></font>''
To read an Excel file with ODBC (tested on Windows 7 with QT 4.7.1) :


To read an Excel file with <span class="caps">ODBC</span> (tested on Windows 7 with QT 4.7.1) :
<code><br />QSqlDatabase db = QSqlDatabase::addDatabase(&quot;QODBC&amp;quot;);<br />db.setDatabaseName(&quot;DRIVER={Microsoft Excel Driver ('''.xls)};DBQ=&quot; + QString(&quot;c:file.xlsx&amp;quot;));<br />if(db.open())<br />{<br /> QSqlQuery query(&quot;select''' from [&quot; + QString(&quot;Sheet1&amp;quot;) + &quot;$]&quot;); // Select range, place A1:B5 after $<br /> while (query.next())<br /> {<br /> QString column1= query.value(0).toString();<br /> qDebug() &lt;&lt; column1;<br /> }<br />}<br /></code>


This sample print in the console all column1’s values. It works for <font color="#580">.xls</font> and <font color="#580">.xlsx</font>
This sample print in the console all column1's values. It works for {color:#580}.xls and {color:#580}.xlsx


By default <span class="caps">OBDC</span> uses the first row as names for the columns, you can change this whith the ‘FirstRowHasNames’ option in the connection settings. Keep in mind that you are using a database and that each column has his own datatype. So if your second row contains text and your third row contains numbers, sql wil pick one of these datatypes. If a few rows contain text and the rest of them contains floating numbers, sql wil make the text appear and will make the numbers disappear.
By default OBDC uses the first row as names for the columns, you can change this whith the 'FirstRowHasNames' option in the connection settings. Keep in mind that you are using a database and that each column has his own datatype. So if your second row contains text and your third row contains numbers, sql wil pick one of these datatypes. If a few rows contain text and the rest of them contains floating numbers, sql wil make the text appear and will make the numbers disappear.


===Using independent parser/writer libraries===
=== Using independent parser/writer libraries ===


For a more portable solution, you could take a look at some of the available third-party C/C++ libraries for parsing/writing Excel files:
For a more portable solution, you could take a look at some of the available third-party C/C++ libraries for parsing/writing Excel files:


{| class="infotable line" style="width: 95%; margin-left: 2.5%"
table{width:95%;margin-left:2.5%}.<br />| |''. API |''. {font-family:monospace}.xls |''. {font-family:monospace}.xlsx |''. reading |''. writing |''. platforms |''. license |<br />| &quot;'''Qt Xlsx'''&quot;:https://github.com/dbzhang800/QtXlsxWriter | C++ Qt| {color:#920}no | {color:#580}yes | {color:#580}yes| {color:#580}yes | Win, Mac, Linux, … | MIT {color:#458}[weak copyleft]|<br />| &quot;'''xlsLib'''&quot;:http://xlslib.sourceforge.net/ | C++ | {color:#580}yes | {color:#920}no | {color:#920}no | {color:#580}yes | Win, Mac, Linux, … | LGPL v3 {color:#458}[weak copyleft]|<br />| &quot;'''libxls'''&quot;:http://libxls.sourceforge.net | C | {color:#580}yes | {color:#920}no | {color:#580}yes | {color:#920}no | Win, Mac, Linux, … | LGPL {color:#458}[weak copyleft]|<br />| &quot;'''LibXL'''&quot;:http://www.libxl.com/ | C++ | {color:#580}yes | {color:#580}yes | {color:#580}yes | {color:#580}yes | Win, Mac, Linux, … | {color:#458}commercial |<br />| &quot;'''qtXLS'''&quot;:http://www.qtsoftware.de/vertrieb/db/qtxls_e.htm | C | {color:#580}yes | {color:#920}no | {color:#580}yes | {color:#580}yes | Win, ? | {color:#458}commercial |<br />| &quot;'''FreeXL'''&quot;:https://www.gaia-gis.it/fossil/freexl | C | {color:#580}yes | {color:#920}no | {color:#580}yes | {color:#920}no | Linux, ? | LGPL / MPL {color:#458}[weak copyleft]|<br />| &quot;'''BasicExcel'''&quot;:http://www.codeproject.com/Articles/13852/BasicExcel-A-Class-to-Read-and-Write-to-Microsoft | C++ | {color:#580}yes | {color:#920}no | {color:#580}yes | {color:#580}yes | ? | ? |<br />| &quot;'''Number Duck'''&quot;:https://numberduck.com/ | C++ | {color:#580}yes | {color:#920}no | {color:#580}yes | {color:#580}yes | Win, Linux | {color:#458}commercial |
|
<br />Note that these libraries differ in their scope and general approach to the problem.
! <span class="caps">API</span>
<br />h3. Using manual XML processing
! <font face="monospace">.xls</font>
<br />Files using the XML-based (.xlsx) format could be processed using Qt's XML handling classes (see [[Handling_Document_Formats | Handling Document Formats]]). Third-party libraries can help you in dealing with the container format that wraps the actual XML files:
! <font face="monospace">.xlsx</font>
<br />table{width:95%;margin-left:2.5%}.<br />| |''. API |''. supported platforms |''. license |<br />| &quot;'''libopc'''&quot;:http://libopc.codeplex.com | C | Win, Mac, Linux, … | {color:#458}permissive |
! reading
! writing
! platforms
! license
|-
|
[https://github.com/dbzhang800/QtXlsxWriter '''Qt Xlsx'''] ''[github.com]''
| C++ Qt
| <font color="#920">no</font>
| <font color="#580">yes</font>
| <font color="#580">yes</font>
| <font color="#580">yes</font>
| Win, Mac, Linux, …
| <span class="caps">MIT</span> <font color="#458">[weak copyleft]</font>
|-
|
[http://xlslib.sourceforge.net/ '''xlsLib'''] ''[xlslib.sourceforge.net]''
| C++
| <font color="#580">yes</font>
| <font color="#920">no</font>
| <font color="#920">no</font>
| <font color="#580">yes</font>
| Win, Mac, Linux, …
| <span class="caps">LGPL</span> v3 <font color="#458">[weak copyleft]</font>
|-
|
[http://libxls.sourceforge.net '''libxls'''] ''[libxls.sourceforge.net]''
| C
| <font color="#580">yes</font>
| <font color="#920">no</font>
| <font color="#580">yes</font>
| <font color="#920">no</font>
| Win, Mac, Linux, …
| <span class="caps">LGPL</span> <font color="#458">[weak copyleft]</font>
|-
|
[http://www.libxl.com/ '''LibXL'''] ''[libxl.com]''
| C++
| <font color="#580">yes</font>
| <font color="#580">yes</font>
| <font color="#580">yes</font>
| <font color="#580">yes</font>
| Win, Mac, Linux, …
| <font color="#458">commercial</font>
|-
|
[http://www.qtsoftware.de/vertrieb/db/qtxls_e.htm '''qtXLS'''] ''[qtsoftware.de]''
| C
| <font color="#580">yes</font>
| <font color="#920">no</font>
| <font color="#580">yes</font>
| <font color="#580">yes</font>
| Win, ?
| <font color="#458">commercial</font>
|-
|
[https://www.gaia-gis.it/fossil/freexl '''FreeXL'''] ''[gaia-gis.it]''
| C
| <font color="#580">yes</font>
| <font color="#920">no</font>
| <font color="#580">yes</font>
| <font color="#920">no</font>
| Linux, ?
| <span class="caps">LGPL</span> / <span class="caps">MPL</span> <font color="#458">[weak copyleft]</font>
|-
|
[http://www.codeproject.com/Articles/13852/BasicExcel-A-Class-to-Read-and-Write-to-Microsoft '''BasicExcel'''] ''[codeproject.com]''
| C++
| <font color="#580">yes</font>
| <font color="#920">no</font>
| <font color="#580">yes</font>
| <font color="#580">yes</font>
| ?
| ?
|-
|
[https://numberduck.com/ '''Number Duck'''] ''[numberduck.com]''
| C++
| <font color="#580">yes</font>
| <font color="#920">no</font>
| <font color="#580">yes</font>
| <font color="#580">yes</font>
| Win, Linux
| <font color="#458">commercial</font>
|}
 
Note that these libraries differ in their scope and general approach to the problem.
 
===Using manual <span class="caps">XML</span> processing===
 
Files using the <span class="caps">XML</span>-based (.xlsx) format could be processed using Qt’s <span class="caps">XML</span> handling classes (see [[Handling Document Formats]]). Third-party libraries can help you in dealing with the container format that wraps the actual <span class="caps">XML</span> files:
 
{| class="infotable line" style="width: 95%; margin-left: 2.5%"
|
! <span class="caps">API</span>
! supported platforms
! license
|-
|
[http://libopc.codeplex.com '''libopc'''] ''[libopc.codeplex.com]''
| C
| Win, Mac, Linux, …
| <font color="#458">permissive</font>
|}


''<font size="0.9em"><font color="#530"><span class="caps">TODO</span>: If you know more about the container format, and whether it really needs a specialized library for processing, please expand this section.</font></font>''
p{border:dashed 1px #a94;background:#fbf3dd;color:#530;padding:2pt 4pt;margin-left:2pt;margin-right:2pt;font-size:0.9em;line-height:150%;font-style:italic}. TODO: If you know more about the container format, and whether it really needs a specialized library for processing, please expand this section.


===Using batch conversion tools===
=== Using batch conversion tools ===


If all else fails, there is always the option of using an existing tool to automatically convert between Excel files and a more manageable format, and let your Qt application deal with that format instead. The conversion tool could be bundled with your application or specified as a prerequisite, and controlled via [[doc/QProcess|QProcess]]. Some possibilities are:
If all else fails, there is always the option of using an existing tool to automatically convert between Excel files and a more manageable format, and let your Qt application deal with that format instead. The conversion tool could be bundled with your application or specified as a prerequisite, and controlled via [[Doc:QProcess]]. Some possibilities are:


{| class="infotable line" style="width: 95%; margin-left: 2.5%"
table{width:95%;margin-left:2.5%}.<br />|''. |''. {font-family:monospace}.xls to * |''. {font-family:monospace}.xlsx to * |''. &amp;#42; to {font-family:monospace}.xls |''. &amp;#42; to {font-family:monospace}.xlsx |''. platforms |_. license |<br />| &quot;'''LibreOffice'''&quot;:http://www.libreoffice.org/ | {font-family:monospace}.ods .csv … | {font-family:monospace}.ods .csv … | {font-family:monospace}.ods .csv … | {font-family:monospace}.ods .csv … | Win, Mac, Linux, … | GPL v3 {color:#458}[strong copyleft] |<br />| &quot;'''…'''&quot;:http://… | … | … | … | … | … | … |
!
! <font face="monospace">.xls</font> to *
! <font face="monospace">.xlsx</font> to *
! * to <font face="monospace">.xls</font>
! * to <font face="monospace">.xlsx</font>
! platforms
! license
|-
|
[http://www.libreoffice.org/ '''LibreOffice'''] ''[libreoffice.org]''
| <font face="monospace">.ods .csv …</font>
| <font face="monospace">.ods .csv …</font>
| <font face="monospace">.ods .csv …</font>
| <font face="monospace">.ods .csv …</font>
| Win, Mac, Linux, …
| <span class="caps">GPL</span> v3 <font color="#458">[strong copyleft]</font>
|-
|
[http:// '''…''']
| …
| …
| …
| …
| …
| …
|}


''Notes:''<br />
''Notes:''<br />LibreOffice can be used like this for batch conversion (it's slow, though): <code>soffice —invisible -convert-to xls test.ods<code>


==Displaying / User Interaction==
== Displaying / User Interaction ==


===Using Excel itself===
=== Using Excel itself ===


''<font size="0.9em"><font color="#530"><span class="caps">TODO</span>: If you know whether Excel provides a “viewer” ActiveX control that can be embedded in a Qt application through ActiveQT, please fill out this section (including links to relevant resources).</font></font>''
p{border:dashed 1px #a94;background:#fbf3dd;color:#530;padding:2pt 4pt;margin-left:2pt;margin-right:2pt;font-size:0.9em;line-height:150%;font-style:italic}. TODO: If you know whether Excel provides a &quot;viewer&amp;quot; ActiveX control that can be embedded in a Qt application through ActiveQT, please fill out this section (including links to relevant resources).


===Manual solution===
=== Manual solution ===


''<font size="0.9em"><font color="#530"><span class="caps">TODO</span>: Tips for displaying Excel documents which were manually parsed using one of the methods described above.</font></font>''
p{border:dashed 1px #a94;background:#fbf3dd;color:#530;padding:2pt 4pt;margin-left:2pt;margin-right:2pt;font-size:0.9em;line-height:150%;font-style:italic}. TODO: Tips for displaying Excel documents which were manually parsed using one of the methods described above.


<font color="#fff">.</font>
p{color:#fff;border-bottom:solid 1px #ccc}. .


==See Also==
== See Also ==


* [[Handling Document Formats]]
* [[Handling_Document_Formats | Handling Document Formats]]
** ''other Microsoft Office formats:''
** ''other Microsoft Office formats:''
*** [[Handling Microsoft Word file format|Microsoft Word]]
*** [[Handling_Microsoft_Word_(file_format) | Microsoft Word]]
*** [[Handling Microsoft PowerPoint file format|Microsoft Powerpoint]]
*** [[Handling_Microsoft_Powerpoint_(file_format) | Microsoft Powerpoint]]
** ''other “spreadsheet” formats:''
** ''other “spreadsheet” formats:''
*** [[Handling OpenDocument Spreadsheet|OpenDocument Spreadsheet]]
===Categories:===
* [[:Category:Developing with Qt|Developing_with_Qt]]

Revision as of 14:13, 23 February 2015


[toc align_right="yes&quot; depth="2&quot;]

Handling Microsoft Excel (file format)

This page discusses various available options for working with "Microsoft Excel&quot;:http://en.wikipedia.org/wiki/Microsoft_Excel#File_formats documents in your Qt application. Please also read the general considerations outlined on the Handling Document Formats page.

p{width:60%;border:solid 1px #99a;background:#eef;color:#335;padding:2pt 4pt;font-size:0.9em;line-height:150%;font-style:italic}. Note that this information is collaboratively collected by the community, with no promise of completeness or correctness. In particular, use your own research and judgment when evaluating third-party libraries or tools!

One needs to distinguish between two different formats (this page deals with both of them):

table{width:95%;margin-left:2.5%}.
| |. Legacy "Excel Spreadsheet&quot; format |. "Office Open XML Workbook&quot; format |
| classification: | binary BIFF-based | XML-based |
| main filename extension: | {font:1em monospace}.xls | {font-family:monospace}.xlsx |
| main internet media type: | {font:0.9em monospace}application/vnd.ms-excel | {font:0.9em monospace}application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
| default format of Excel: | until Excel 2003 | since Excel 2007 |

Reading / Writing

Using Excel itself

If you are exclusively targeting the Windows platform and Microsoft Excel will be installed on all target machines, then you can use "Qt's ActiveX framework&quot;:http://doc.qt.io/qt-4.8/activeqt.html to access Excel's spreadsheet processing functionality through OLE automation. For an introductory code example (and a way to list the API provided by the Excel COM object), consult this how-to.

table{width:95%;margin-left:2.5%}.
| |. DLL file name |. COM object name |. platforms |. license |
| "Microsoft Excel":http://office.microsoft.com/excel/ | ? | {font-family:monospace}Excel.Application | Windows | {color:#458}commercial |

Using ODBC

p{border:dashed 1px #a94;background:#fbf3dd;color:#530;padding:2pt 4pt;margin-left:2pt;margin-right:2pt;font-size:0.9em;line-height:150%;font-style:italic}. TODO: Info on using ODBC drivers (via QSqlDatabase) for accessing Excel spreadsheets - please fill out this section if you know more. (What is the ODBC driver called? Where does it come from? Windows only or also Mac/Linux? Link to sample code snippet?)

To read an Excel file with ODBC (tested on Windows 7 with QT 4.7.1) :

<br />QSqlDatabase db = QSqlDatabase::addDatabase(&quot;QODBC&amp;quot;);<br />db.setDatabaseName(&quot;DRIVER={Microsoft Excel Driver ('''.xls)};DBQ=&quot; + QString(&quot;c:file.xlsx&amp;quot;));<br />if(db.open())<br />{<br /> QSqlQuery query(&quot;select''' from [&quot; + QString(&quot;Sheet1&amp;quot;) + &quot;$]&quot;); // Select range, place A1:B5 after $<br /> while (query.next())<br /> {<br /> QString column1= query.value(0).toString();<br /> qDebug() &lt;&lt; column1;<br /> }<br />}<br />

This sample print in the console all column1's values. It works for {color:#580}.xls and {color:#580}.xlsx

By default OBDC uses the first row as names for the columns, you can change this whith the 'FirstRowHasNames' option in the connection settings. Keep in mind that you are using a database and that each column has his own datatype. So if your second row contains text and your third row contains numbers, sql wil pick one of these datatypes. If a few rows contain text and the rest of them contains floating numbers, sql wil make the text appear and will make the numbers disappear.

Using independent parser/writer libraries

For a more portable solution, you could take a look at some of the available third-party C/C++ libraries for parsing/writing Excel files:

table{width:95%;margin-left:2.5%}.
| |. API |. {font-family:monospace}.xls |. {font-family:monospace}.xlsx |. reading |. writing |. platforms |. license |
| "Qt Xlsx":https://github.com/dbzhang800/QtXlsxWriter | C++ Qt| {color:#920}no | {color:#580}yes | {color:#580}yes| {color:#580}yes | Win, Mac, Linux, … | MIT {color:#458}[weak copyleft]|
| "xlsLib":http://xlslib.sourceforge.net/ | C++ | {color:#580}yes | {color:#920}no | {color:#920}no | {color:#580}yes | Win, Mac, Linux, … | LGPL v3 {color:#458}[weak copyleft]|
| "libxls":http://libxls.sourceforge.net | C | {color:#580}yes | {color:#920}no | {color:#580}yes | {color:#920}no | Win, Mac, Linux, … | LGPL {color:#458}[weak copyleft]|
| "LibXL":http://www.libxl.com/ | C++ | {color:#580}yes | {color:#580}yes | {color:#580}yes | {color:#580}yes | Win, Mac, Linux, … | {color:#458}commercial |
| "qtXLS":http://www.qtsoftware.de/vertrieb/db/qtxls_e.htm | C | {color:#580}yes | {color:#920}no | {color:#580}yes | {color:#580}yes | Win, ? | {color:#458}commercial |
| "FreeXL":https://www.gaia-gis.it/fossil/freexl | C | {color:#580}yes | {color:#920}no | {color:#580}yes | {color:#920}no | Linux, ? | LGPL / MPL {color:#458}[weak copyleft]|
| "BasicExcel":http://www.codeproject.com/Articles/13852/BasicExcel-A-Class-to-Read-and-Write-to-Microsoft | C++ | {color:#580}yes | {color:#920}no | {color:#580}yes | {color:#580}yes | ? | ? |
| "Number Duck":https://numberduck.com/ | C++ | {color:#580}yes | {color:#920}no | {color:#580}yes | {color:#580}yes | Win, Linux | {color:#458}commercial |

Note that these libraries differ in their scope and general approach to the problem.
h3. Using manual XML processing
Files using the XML-based (.xlsx) format could be processed using Qt's XML handling classes (see Handling Document Formats). Third-party libraries can help you in dealing with the container format that wraps the actual XML files:
table{width:95%;margin-left:2.5%}.
| |. API |. supported platforms |. license |
| "libopc":http://libopc.codeplex.com | C | Win, Mac, Linux, … | {color:#458}permissive |

p{border:dashed 1px #a94;background:#fbf3dd;color:#530;padding:2pt 4pt;margin-left:2pt;margin-right:2pt;font-size:0.9em;line-height:150%;font-style:italic}. TODO: If you know more about the container format, and whether it really needs a specialized library for processing, please expand this section.

Using batch conversion tools

If all else fails, there is always the option of using an existing tool to automatically convert between Excel files and a more manageable format, and let your Qt application deal with that format instead. The conversion tool could be bundled with your application or specified as a prerequisite, and controlled via Doc:QProcess. Some possibilities are:

table{width:95%;margin-left:2.5%}.
|. |. {font-family:monospace}.xls to * |. {font-family:monospace}.xlsx to * |. &#42; to {font-family:monospace}.xls |. &#42; to {font-family:monospace}.xlsx |. platforms |_. license |
| "LibreOffice":http://www.libreoffice.org/ | {font-family:monospace}.ods .csv … | {font-family:monospace}.ods .csv … | {font-family:monospace}.ods .csv … | {font-family:monospace}.ods .csv … | Win, Mac, Linux, … | GPL v3 {color:#458}[strong copyleft] |
| "":http://… | … | … | … | … | … | … |

Notes:
LibreOffice can be used like this for batch conversion (it's slow, though): soffice —invisible -convert-to xls test.ods

Displaying / User Interaction

Using Excel itself

p{border:dashed 1px #a94;background:#fbf3dd;color:#530;padding:2pt 4pt;margin-left:2pt;margin-right:2pt;font-size:0.9em;line-height:150%;font-style:italic}. TODO: If you know whether Excel provides a "viewer&quot; ActiveX control that can be embedded in a Qt application through ActiveQT, please fill out this section (including links to relevant resources).

Manual solution

p{border:dashed 1px #a94;background:#fbf3dd;color:#530;padding:2pt 4pt;margin-left:2pt;margin-right:2pt;font-size:0.9em;line-height:150%;font-style:italic}. TODO: Tips for displaying Excel documents which were manually parsed using one of the methods described above.

p{color:#fff;border-bottom:solid 1px #ccc}. .

See Also