Page 1 of 1

export to excel

Posted: Tue 05 May 2015 12:55
by albourgz
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.

Re: export to excel

Posted: Tue 05 May 2015 13:46
by AlexP
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 .

Re: export to excel

Posted: Tue 05 May 2015 14:11
by albourgz
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.

Re: export to excel

Posted: Wed 06 May 2015 07:58
by AlexP
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.

Re: export to excel

Posted: Fri 15 May 2015 08:25
by m.ghilardi
Have you ever tried TMS FlexCel? Worked for me, is compatible with ODAC datasets (both VirtualTable and TOraQuery)

Re: export to excel

Posted: Tue 19 May 2015 08:24
by AlexP
We don't test our products with 3rd-party data display visual components. You can check this opportunity by yourself.