Outlook2003 y un browse

Outlook2003 y un browse

Postby armando.lagunas » Wed Apr 14, 2010 6: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)


el codigo de la clase es el siguiente

Code: Select all  Expand view

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
User avatar
armando.lagunas
 
Posts: 346
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile

Re: Outlook2003 y un browse

Postby fgondi » Wed Apr 14, 2010 8:31 am

Yo lo defino de esta forma:
Code: Select all  Expand view
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
User avatar
fgondi
 
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España

Re: Outlook2003 y un browse

Postby armando.lagunas » Wed Apr 14, 2010 4:23 pm

:D :D

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

gracias desde Chile.
SkyPe: armando.lagunas@hotmail.com
Mail: armando.lagunas@gmail.com
User avatar
armando.lagunas
 
Posts: 346
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile

Re: Outlook2003 y un browse

Postby armando.lagunas » Thu Apr 15, 2010 6: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: Select all  Expand view

   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
User avatar
armando.lagunas
 
Posts: 346
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 8 guests