export to excel

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

export to excel

Post by albourgz » Tue 05 May 2015 12:55

This a new feature request.
I have a standard option in my grids: when user presses ctrl-e, the grid content is exported to excel.
This is done by loops like:

Code: Select all

for (ds->First(), iRow=1;!ds->Eof();ds->Next(), iRow++)
    for (i=0; i<ds->Fields->Count; i++)
         xls->write(iRow, i+1, ds->Fields->Fields[i]->Value;
But it is very slow. I tried to make excel unvisible, to disable scroll events on dataSet, ... and it is still very slow.

I am sure it could be very fast if TOraDataSet could include a method that would take the grid contents, copy it in memory in html format, that you can paste in excel (or open office) using one single OLE call.

Just a suggestion... that could make odac better again compared to other tools.

If you have any other hint to speed this, you're welcome.

Regards.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: export to excel

Post by AlexP » Tue 05 May 2015 13:46

Hello,

There is no such functionality in ODAC. You can use, for example, the SaveToXML method of DataSet or UTL_FILE: http://docs.oracle.com/cd/B19306_01/app ... m#BABGGEDF .

albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

Re: export to excel

Post by albourgz » Tue 05 May 2015 14:11

Save to XML is fast... But unusable with excel: file cannot be displayed correctly (using right headers, ...). It would be must better to put this xml in Clipboard in a "excel-pastable" format.
UTL_FILE creates files on server, it is not what I need.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: export to excel

Post by AlexP » Wed 06 May 2015 07:58

We don't plan to change the XML format. Low performance in your case is due to using OLE objects. You can organize a loop in the DataSet by yourself and create a file or a Stream in the needed XLS format understood by Excel.

m.ghilardi
Posts: 41
Joined: Thu 13 Mar 2014 11:14

Re: export to excel

Post by m.ghilardi » Fri 15 May 2015 08:25

Have you ever tried TMS FlexCel? Worked for me, is compatible with ODAC datasets (both VirtualTable and TOraQuery)

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: export to excel

Post by AlexP » Tue 19 May 2015 08:24

We don't test our products with 3rd-party data display visual components. You can check this opportunity by yourself.

Post Reply