[Qt-interest] read excel data

Scott Aron Bloom Scott.Bloom at sabgroup.com
Thu Dec 3 19:15:03 CET 2009


Another option...

Use the XLS/ODBC driver (which comes with every windows system) and load the Excel file into a QSqlDatabase...

That does assume your xls is record based however..

Scott

-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Castagne Nicolas
Sent: Thursday, December 03, 2009 8:58 AM
To: Sajjad
Cc: qt-interest at trolltech.com
Subject: Re: [Qt-interest] read excel data


> Is that procedure reasonable ?
Definitely yes, to me.

also, if you are only interested in the content of the cells, but not in their formats, etc, then you may consider converting your xls/xlsx file to a format simpler than XML.
I think in particular of the .csv "format", since this format may be easier to read for you from qt.

Google search for xls2csv to find an appropriate converter !

Best
Nicolas

--- En date de : Jeu 3.12.09, Sajjad <dosto.walla at gmail.com> a écrit :

> De: Sajjad <dosto.walla at gmail.com>
> Objet: Re: [Qt-interest] read excel data
> À: "Castagne Nicolas" <nicolascastagne at yahoo.fr>
> Cc: qt-interest at trolltech.com
> Date: Jeudi 3 Décembre 2009, 17h48
> Hello Forum,
> 
> 
> I am planning to convert the .xls/.xlsx file to XML file
> and then insert the data inside the database tables.
> 
> In  that case i can save the excel file in XML file format
> or i can call another process (using perl) from Qt to
> convert the excel file 
> 
> 
> to a XML format and then do the insertion for the
> corresponding database  tables.
> 
> 
> 
> Is that procedure reasonable ?
> 
> 
> Regards
> Sajjad   
> 
> On Thu, Dec 3, 2009 at 5:06 PM,
> Castagne Nicolas <nicolascastagne at yahoo.fr>
> wrote:
> 
> 
> Hello Sajjad and all.
> 
> Excel->qt and qt->excel are tricky questions, as far
> as I studied them in the past.
> You should provide a more details on your needs, because
> the possibities may vary depending on your need.
> 
> 
> 
> ***Which sort of "excel data" would you like to
> read ?
>   .xls files ?
>   .xlsx files ?
>   Other files generated by Excel (eg .csv)
> 
>   Data copied from Excel, and saved in the Clipboard ?
>   Or you need to read directly from a document while
> opened in the excel application ?
> 
> ***Do you need a specific way to go for your users ?
> Or would users accept an to make intermediary
> manipulations, such as exporting, in excel, the excel
> spreadsheet to an intermerdiary format ?
> 
> 
> Which platform do you target ? Windows, Mac, Linux ?
> 
> The possibilities regarding your needs depend at least on
> these questions...
> And in any case, it will likely be not really easy, I am
> affraid.
> 
> Best
> 
> Nicolas
> 
> --- En date de : Jeu 3.12.09, Donal O'Connor
> <donaloconnor at gmail.com>
> a écrit :
> 
> 
> De: Donal O'Connor <donaloconnor at gmail.com>
> Objet: Re: [Qt-interest] read excel data
> À: "Friedemann Kleint"
>  <Friedemann.Kleint at nokia.com>
> Cc: qt-interest at trolltech.com
> Date: Jeudi 3 Décembre 2009, 12h05
> 
> 
> You could look into QAxObject. 
> 
> On Thu, Dec 3, 2009 at 11:03 AM,
> Friedemann Kleint <Friedemann.Kleint at nokia.com>
> wrote:
> 
> 
> Hi,
> 
> 
> 
> I remember this being discussed in a thread a few months
> ago - you could try
> 
> to search the archive. One of the possible solutions is to
> convert the file to
> 
> XML using a Perl module (running a small Perl converter
> program):
> 
> 
> 
> http://search.cpan.org/~isterin/XML-Excel-0.02/Excel.pm
> 
> 
> 
> There are several Perl modules dealing with MS Excel.
> 
> 
> 
> Regards,
> 
> Friedemann
> 
> 
> 
> --
> 
> Friedemann Kleint
> 
> Nokia, Qt Development Frameworks
> 
> 
> 
> _______________________________________________
> 
> Qt-interest mailing list
> 
> Qt-interest at trolltech.com
> 
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> 
> 
> 
> -----La pièce jointe associée suit-----
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> 
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> 
> 
> 
> 
> 
>       
> _______________________________________________
> 
> Qt-interest mailing list
> 
> Qt-interest at trolltech.com
> 
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> 
> 
> 
> 


      


_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list