When I have an xBrowse with a column :aEditListTxt and I need export :ToExcel() ,
the fields with :aEditListTxt are exported as a value and not with the field in :aEditListTxt
Code: Select all | Expand
#include "fivewin.ch"
REQUEST DBFCDX
function xbtest()
local aStates
local oDlg, oBrw, oFont
RDDSETDEFAULT( "DBFCDX" )
USE STATES SHARED
aStates := FW_DbfToArray()
CLOSE STATES
USE CUSTOMER SHARED
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE DIALOG oDlg SIZE 700,400 PIXEL TRUEPIXEL FONT oFont
@ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE "CUSTOMER" ;
COLUMNS "First", "City", "State" ;
CELL LINES NOBORDER FASTEDIT
WITH OBJECT oBrw
:nEditTypes := EDIT_GET
WITH OBJECT :State
:nEditType := EDIT_LISTBOX
:aEditListTxt := aStates
END
//
:CreateFromCode()
END
oDlg:bStart := {|| oBrw:ToExcel() }
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont
return nil
I found a solution I wanted to ask Rao if it is possible to integrate it into xBrowse
(if it is correct)
Code: Select all | Expand
METHOD ClpRow( lFullRow, aCols, lFormatted ) CLASS TXBrowse
....
if lFullRow
for n := 1 to Len( aCols )
if lFormatted
if aCols[ n ]:bStrData == nil
RetVal += If( ValType( u := aCols[ n ]:Value ) == 'L', If( u, "True", "False" ), "" ) + Chr( 9 )
else
RetVal += StrTran( StrTran( aCols[ n ]:StrData, CRLF, " ; " ), Chr(9), ' ' ) + Chr( 9 )
endif
else
//-------------------------------------------------------------------------------------------
// My modi
IF HB_IsArray(aCols[ n ]:aEditListTXT ) .and. len(aCols[ n ]:aEditListTXT ) > 0
RetVal += cValToChar( aCols[n]:StrData ) + Chr( 9 )
ELSE
RetVal += aCols[ n ]:ClpText + Chr( 9 )
ENDIF
endif
next
else
RetVal := ::SelectedCol():ClpText
endif
....
Regards Maurizio