What is the fastest way to copy contents of a browser to a T

Posted by Admin on 28-Apr-2009 05:55

We have some generic code in our application which allows users to copy the contents of a browser to excel/clipboard. As this is generic, it takes a browse handle, navigates the browser rows and creates temp-tables entries (a dynamic tt is built using the browser column). However, the actual walking the browser rows is quite slow,is there a faster way of doing this?

Thanks1

All Replies

Posted by davidkerkhofs3 on 28-Apr-2009 08:34

Why not use the query that is attached to the browser?

DEF VAR hQ AS HANDLE NO-UNDO.

DEF VAR hBuf AS HANDLE NO-UNDO.

DEF VAR hTTBuf AS HANDLE NO-UNDO.

hQ = hBrowse:QUERY.

hBuf = hQ:GET-BUFFER-HANDLE(1).

hTTBuf = hTT:DEFAULT-BUFFER-HANDLE.

hQ:GET-FIRST().

DO WHILE hQ:QUERY-OFF-END = FALSE:

  hTTBuf:BUFFER-CREATE().

  hTTBuf:BUFFER-COPY(hBuf).

  hQ:GET-NEXT().

END.

Posted by Admin on 28-Apr-2009 08:37

David, thanks for that.

Would this sample work if the browser is linked to a temp-table, rather than direct to the database?

Thanks again.

Posted by davidkerkhofs3 on 28-Apr-2009 14:42

Of course, there's no difference between hooking a temp-table or a database table to a query object.

And it's the query object that's attached to the browse object.

Have a look at the ABL handbook: http://documentation.progress.com/output/OpenEdge102a/oe102ahtml/dvhbk/dvhbk-15-02.html

This thread is closed