Alaska Software Inc. - Is it possible get the data as an array from a xbpBrowse Object ?
Username: Password:
AuthorTopic: Is it possible get the data as an array from a xbpBrowse Object ?
Jacob JohnIs it possible get the data as an array from a xbpBrowse Object ?
on Wed, 30 Sep 2020 16:16:19 +0530
Hi,

Is it possible get the data as an array from a xbpBrowse Object ?

Any sample ?

Regards
Kiron
Claudio Driussi Re: Is it possible get the data as an array from a xbpBrowse Object ?
on Sat, 31 Oct 2020 12:40:50 +0100
Il 30/09/20 12:46, Jacob John ha scritto:
> 
> Hi,
> 
> Is it possible get the data as an array from a xbpBrowse Object ?
> 
> Any sample ?

Not really simple, but you can.

You have to write some similat to this:


-----------------------------------------------------------

method csdbBrowse:exportData(lExcel)
   local i,t,x
   local nRec := recno()

    in the first row i write the name of columns
   x := {}
   for i := 1 to ::ColCount
     aadd(x, trim(::GetColumn(i):Heading:GetCell(1)))
     next i
   if ::nExpType == EXP_TEXT
     t := ''
     aeval(x,{|xx,i| t += x[i] + iif(i==::ColCount,CRLF,chr(9)) })
     ::xExport += t
   else
     aadd(::xExport,x)
     endif

   go top
   while !eof()
     if !::csBrowse:inSet()
       skip
       loop
       endif
     X := iif(::nExpType == EXP_TEXT, x := "", x := {})
     for i := 1 to ::ColCount
       if empty(::getColumn(i):NumField)
         t := eval(::getColumn(i):dataLink)
       else
         t := fieldGet(::getColumn(i):NumField)
         endif
       if ::nExpType == EXP_TEXT
         x += trim(Var2Char(t)) + iif(i==::ColCount,CRLF,chr(9))
       else
         if lExcel .and. valtype(t) $ 'MC' ; t := "'"+trim(t) ; endif
         aadd(x,t)
         endif
       next i
     if ::nExpType == EXP_TEXT
       ::xExport += x
     else
       aadd(::xExport,x)
       endif
     skip
     enddo
   goto nRec
return nil

---------------------------------------------------------------------


shortly: you have to navigate the browse and for each column you
have to get the value. The sample works only in my environment
but you can get some hints fromi it.

Claudio





> 
> Regards
> Kiron
>