FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Outlook2003 y un browse
Posts: 346
Joined: Mon Oct 05, 2009 03:35 PM
Outlook2003 y un browse
Posted: Wed Apr 14, 2010 06:50 AM
amigos:

ya tire la esponja, llevo mas de 5 días intentando pero no logro colocar un sbrowse, listbox o xbrowse en una de las areas del control outlook2003.

con un listbox genera un GPF
con un xbrowse no se ve en ningun lado
con un sbrowse version 8 me devuelve el error siguiente:


    Detalle técnico en la aplicación
    --------------------------------
    Error BASE/1004 Class: 'NIL' has no exported method: EVAL
    Argumentos :
    [ 1] = U

    Llamadas a Procedimientos
    -------------------------
    Llamado desde EVAL(0)
    Llamado desde TSBROWSE:LOADFIELDS(6.010)
    Llamado desde TSBROWSE:DEFAULT(1.414)
    Llamado desde TSBROWSE:NEW(739)
    [/list:u]

    el codigo de la clase es el siguiente

    Code (fw): Select all Collapse
    METHOD LoadFields( lEditable, aNames ) CLASS TSBrowse
    
       Local n, nE, cHeading, nAlign, nSize, aColSizes, cData, cType, nDec, hFont, bData, cBlock, ;
             aAlign := { "LEFT", "CENTER", "RIGHT", "VERT" }, ;
             aStru  := ( ::cAlias )->( DbStruct() ), ;
             nCols  := If( aNames == Nil, ( ::cAlias )->( FCount() ), Len( aNames ) )
    
       Default lEditable := .T.
    
       aColSizes := If( Len( ::aColumns )  ==  Len( ::aColSizes ), Nil, ::aColSizes )
    
       For n := 1 To nCols
    
          nE := If( aNames == Nil, n, FieldPos( aNames[ n ] ) )
    
          cHeading := If( ! ::aHeaders == Nil .and. Len( ::aHeaders ) >= nE, ::aHeaders[ nE ], ;
                          ::Proper( ( ::cAlias )->( Field( nE ) ) ) )
    
          nAlign := If( ::aJustify != Nil .and. Len( ::aJustify ) >= nE, ::aJustify[ nE ], ;
                        If( ( ::cAlias )->( ValType( FieldGet( nE ) ) ) == "N", 2, ;
                        If( ( ::cAlias )->( ValType( FieldGet( nE ) ) ) == "L", 1, 0 ) ) )
    
          nAlign := If( ValType( nAlign ) == "L", If( nAlign, 2, 0 ), ;
                    If( ValType( nAlign ) == "C", AScan( aAlign, nAlign ) - 1, nAlign ) )
    
          nSize := If( ! aColSizes == Nil .and. Len( aColsizes ) >= nE, aColSizes[ nE ], Nil )
    
          If nSize == Nil
             cData := ( ::cAlias )->( FieldGet( nE ) )
             cType := aStru[ nE, 2 ]
             nSize := aStru[ nE, 3 ]
             nDec  := aStru[ nE, 4 ]
             hFont := If( ::oFont != Nil, ::oFont:hFont, 0 )
    
             If cType == "C"
                cData := PadR( Trim( cData ), nSize, "B" )
                nSize := GetTextWidth( 0, cData, hFont )
             ElseIf cType == "N"
                cData := StrZero( cData, nSize, nDec )
                nSize := GetTextWidth( 0, cData, hFont )
             ElseIf cType == "D"
                cData := cValToChar( If( ! Empty( cData ), cData, Date() ) )
                nSize := Int( GetTextWidth( 0, cData, hFont ) * 1.15 )
             ElseIf cType == "M"
                cData := cValToChar( cData )
                nSize := If( ::nMemoWV == Nil, 200, ::nMemoWV )
             Else
                cData := cValToChar( cData )
                nSize := GetTextWidth( 0, cData, hFont )
             EndIf
    
             nSize := Max( GetTextWidth( 0, Replicate( "B", Len( cHeading ) ), hFont ), nSize )
    
          EndIf
    
          cBlock := 'FieldWBlock("' + aStru[ nE, 1 ] + '",Select("' + ::cAlias + '"))'
          ::AddColumn( TSColumn():New( cHeading, FieldWBlock( aStru[ nE, 1 ], Select( ::cAlias ) ),, ;
                                       { ::nClrText, ::nClrPane }, { nAlign, DT_CENTER }, nSize,, lEditable,,,,,,, ;
                                       5,,,, Self, cBlock ) )
    
          ATail( ::aColumns ):cData := ::cAlias + "->" + FieldName( nE )
    
       Next
    
       If ::nLen == 0
          ::nLen := Eval( ::bLogicLen )           <==  aqui genera el error de arriba
       EndIf
    
    Return Self


    si alguien lo a hecho, y me pueden ayudar, se los agradeceria bastante.

    saludos desde chile.
SkyPe: armando.lagunas@hotmail.com

Mail: armando.lagunas@gmail.com
Posts: 694
Joined: Fri Oct 07, 2005 06:58 AM
Re: Outlook2003 y un browse
Posted: Wed Apr 14, 2010 08:31 AM
Yo lo defino de esta forma:
Code (fw): Select all Collapse
DEFINE OUTLOOK2003 oOutLook OF oWnd PROMPTS "Accesos"

oBrw := TXBrows():New( oOutlook:aDialogs[1] )
oBrw:lRecordSelector  := .F.
oBrw:lHeader          := .F.
oBrw:lFooter          := .F.
oBrw:lHScroll         := .F.
oBrw:lVScroll         := .F.
oBrw:nStretchCol   := STRETCHCOL_WIDEST
oBrw:nMarqueeStyle    := MARQSTYLE_NOMARQUEE
oBrw:nRowDividerStyle := LINESTYLE_LIGHTGRAY
oBrw:SetArray( aArr ) 
oBrw:CreateFromCode()


Y todo figura en el OnInit de oWnd
Un saludo

Fernando González Diez

ALSIS Sistemas Informáticos
Posts: 346
Joined: Mon Oct 05, 2009 03:35 PM
Re: Outlook2003 y un browse
Posted: Wed Apr 14, 2010 04:23 PM

gracias por contestar, voy a ver si resulta como me dices.

gracias desde Chile.

:D:D

SkyPe: armando.lagunas@hotmail.com

Mail: armando.lagunas@gmail.com
Posts: 346
Joined: Mon Oct 05, 2009 03:35 PM
Re: Outlook2003 y un browse
Posted: Thu Apr 15, 2010 06:47 AM
Fernando:

ha funcionado de maravilla, muchas gracias

coloco el código manejando un DBF de paso, por si alguien quiere hacer lo mismo.

Code (fw): Select all Collapse
   DEFINE OUTLOOK2003 oOut OF oWin PROMPTS "uno", "dos", "tres"
           oLbx[1] := TXBrowse():New( oOut:aDialogs[1] )
           oLbx[1]:lRecordSelector     := .F.
           oLbx[1]:cALias              := "PASO4"
           oLbx[1]:lHeader             := .T.
           oLbx[1]:nTop                := 2
           oLbx[1]:nLeft               := 3
           oLbx[1]:nBottom             := 295
           oLbx[1]:nRight              := 186
           oLbx[1]:nHeaderLines        := 2
           oLbx[1]:lHScroll            := .F.
           oLbx[1]:CreateFromCode()


saludos desde Chile
SkyPe: armando.lagunas@hotmail.com

Mail: armando.lagunas@gmail.com

Continue the discussion