Page 1 of 1

method print of xbrowse

Posted: Sun Feb 04, 2007 12:16 am
by Silvio
ACTION oApp():oGrid:Print( .t., , "Elenco Soci" )

it make error

Code: Select all

Application
===========
   Path and name: C:\work\errori\fsdi2006\prg\fsdi2006.Exe (32 bits)
   Size: 2,059,776 bytes
   Time from start: 0 hours 0 mins 2 secs 
   Error occurred at: 04-02-2007, 01:13:23
   Error description: Error BASE/1004  Class: 'NIL' has no exported method: EVAL
   Args:

Stack Calls
===========
   Called from:  => EVAL(0)
   Called from: RCOLUMN.PRG => TRCOLUMN:NEW(0)
   Called from: XBrowse.prg => TXBROWSE:PRINT(3525)
   Called from: pcustomer.prg => (b)SOCI(505)
   Called from: VMenu.prg => TVMENU:EVALACTION(1722)
   Called from: VMenu.prg => TVMENU:LBUTTONUP(1423)
   Called from: window.prg => TWINDOW:HANDLEEVENT(0)
   Called from: CONTROL.PRG => TCONTROL:HANDLEEVENT(0)
   Called from: VMenu.prg => TVMENU:HANDLEEVENT(900)
   Called from: window.prg => _FWH(3165)
   Called from:  => WINRUN(0)
   Called from: window.prg => TWINDOW:ACTIVATE(883)
   Called from: main.prg => TAPPLICATION:ACTIVATE(164)
   Called from: main.prg => MAIN(42)


I add a method print into Xbrowse but it not run ok

Code: Select all



METHOD Print( lPreview, lModal, cTitle ) CLASS TXBrowse

   local oPrn, oRep, oCol
   local aCols
   local xValue
   local cAlias
   local nFor, nLines, nLine, nBookMark

   DEFAULT lPreview := .t.,;
           lModal   := .f.,;
           cTitle   := ::oWnd:cCaption

   If Empty( cTitle )
      cTitle := "No Title"
   Endif

   If lPreview
      If lModal
         PRINTER oPrn NAME cTitle PREVIEW MODAL
      else
         PRINTER oPrn NAME cTitle PREVIEW
      Endif
   else
      PRINTER oPrn NAME cTitle
   Endif

   If oPrn:hDC == 0
      return .f.
   Endif

   If !Empty( ::cAlias )
      cAlias := DbSelectArea( ::cAlias )
   Endif

   REPORT oRep TITLE "*** " + cTitle + " ***", "" ;
      HEADER DToC( Date() ) + "-" + Left(Time(), 5), "" RIGHT ;
      FOOTER "#: " + Str( oRep:nPage, 3 ) CENTER;
      TO DEVICE oPrn

   aCols := ::GetVisibleCols()

   for nFor := 1 to len( aCols )
      If !aCols[nFor]:lHide
         oCol := oRep:AddColumn( TrColumn():New( { FInfo1(aCols, nFor) } ,,;
                                { FInfo2(aCols, nFor) },,,,,,,,,, oRep ) )
         xValue := Eval(aCols[nFor]:bStrData)
         nLines := MlCount(xValue, 250)
         oCol:nPad := aCols[nFor]:nDataStrAlign + 1
         If nLines > 1
            oCol:aData    := Array(nLines)
            oCol:aPicture := Afill(Array(nLines), "")
            For nLine := 1 to nLines
               oCol:aData[nLine] := FInfo3(aCols, nFor, nLine)
            Next
         Endif
      Endif
   next

   ENDREPORT

   nBookMark := Eval( ::bBookMark )

   If ::aArrayData != nil .and. len( ::aArrayData ) > 0
      ::nArrayAt := 1
      oRep:bSkip  := { || ::nArrayAt++ }
      ACTIVATE REPORT oRep WHILE ::nArrayAt <= len( ::aArrayData ) ON END ::nArrayAt := 1
   else
      ACTIVATE REPORT oRep
   Endif

   Eval(::bBookMark, nBookMark )

   If !Empty( cAlias )
      DbSelectArea( cAlias )
   Endif

return .t.

Posted: Tue Feb 06, 2007 5:55 pm
by Rochinha
Silvio

Don't have a XBrowse print method?

Verify a code of your method and search for de internal methods of xBrowse, your application is trying to acess this methods

????::oWnd:cCaption
????::cAlias
????::GetVisibleCols()
????::bBookMark
????::aArrayData
????::nArrayAt

Make sure if exist in xBrowse code the same methods.

Your application don't know ????::object.

Posted: Wed Feb 07, 2007 12:49 pm
by Silvio
I not understand Waht YOU say me

I add this method to xbrowse fivetech it run sometimes

obrw:print("namereport",.t.,.t.)

it is as print method of wbrowse of hernan

Posted: Thu Feb 08, 2007 3:20 am
by Rochinha
Excuse.