aa_chn.dbf is a dbf table that contains in des_chn field some chinese characters
If a create an excel worksheet and write into cell the "des_chn" field content they does not appear
as in the dbf field
- Code: Select all Expand view
#include "fivewin.ch"
ANNOUNCE RDDSYS
FUNCTION CRE_XLS()
LOCAL oExcel
LOCAL oAs
LOCAL nRow
FW_SetUnicode( .t. )
oExcel := CreateObject( "Excel.Application" )
oExcel:WorkBooks:Add()
oAs := oExcel:Activesheet()
SELECT 0
USE aa_chn
SET INDEX TO aa_chn
GO TOP
oAs:Range( "A1" ):Value := "English Description"
oAs:Range( "B1" ):Value := "Chinese Description"
nRow := 2
DO WHILE !EOF()
IF !EMPTY( aa_chn->des_chn )
MsgInfo( aa_chn->des_chn , aa_chn->descrizi )
oAs:Range( "A" + cRow(nRow) ):Value := "'" + ALLTRIM( aa_chn->descrizi )
oAs:Range( "B" + cRow(nRow) ):Value := "'" + ALLTRIM( aa_chn->des_chn )
nRow ++
ENDIF
SKIP
ENDDO
oExcel:visible := .T.
USE
RETURN NIL
FUNCTION CROW( nRow )
LOCAL cRow := ALLTRIM( STR( nRow ) )
RETURN cRow
INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX
rddSetDefault( "DBFCDX" )
RETURN