report xbrowse method

Postby Silvio » Tue May 13, 2008 12:32 am

Dear nageswaragunupudi,

Sorry I have Never had the OZLIB xbrowse and I not Know if there was a ozlib ??

this method is made by me and my friend luigi.
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby nageswaragunupudi » Tue May 13, 2008 3:11 am

Interesting to know.

Ozlib's TXBrowse Print method matches the code posted here, exactly alphabet by alphabet including spaces, line spaces, capitalizations, function names, caplitalization of function names, indenting, etc. Here is copy of the method from OZlib's xbrowse.


Code: Select all  Expand view  RUN
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 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 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.



The line " If len( ::aArrayData ) > 0" in the OzLib's version used to give an error and this is fixed in the code posted earlier as "If ::aArrayData != nil .and. len( ::aArrayData ) > 0".

Great Coincidence !!!
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10659
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Silvio » Tue May 13, 2008 7:47 am

I not Know what you say I found this source in my old cds when I use clipper
If you say that the method is of Ozlib ok

but your method run ok ?
I made error on errors

oApp:oGrid:Report( "Elenco Mezzi", .t., .t., )

Code: Select all  Expand view  RUN
Application
===========
   Path and name: C:\work\prg\VDSWIN\VdsWin.Exe (32 bits)
   Size: 2,529,792 bytes
   Time from start: 0 hours 0 mins 6 secs
   Error occurred at: 07/03/2008, 10:53:26
   Error description: Error BASE/1004  Class: 'NIL' has no exported method: EVAL
   Args:
     [   1] = U   

Stack Calls
===========
   [b]Called from:  => EVAL(0)
   Called from: RCOLUMN.PRG => TRCOLUMN:STABILIZE(0)
   Called from: REPORT.PRG => (b)TREPORT:STABILIZE(0)
   Called from:  => AEVAL(0)
   Called from: REPORT.PRG => TREPORT:STABILIZE(0)
   Called from: REPORT.PRG => TREPORT:ACTIVATE(0)
   Called from: XBROWSE.PRG => TXBROWSE:REPORT(0)
   Called from: ASS510.prg => (b)CAW510(272)[/b]
   Called from: VMenu.prg => TVMENU:EVALACTION(1700)
   Called from: VMenu.prg => TVMENU:LBUTTONUP(1398)
   Called from:  => TWINDOW:HANDLEEVENT(0)
   Called from: CONTROL.PRG => TCONTROL:HANDLEEVENT(0)
   Called from: VMenu.prg => TVMENU:HANDLEEVENT(905)
   Called from: WINDOW.PRG => _FWH(0)
   Called from:  => WINRUN(0)
   Called from: WINDOW.PRG => TWINDOW:ACTIVATE(0)
   Called from: main.prg => TAPPLICATION:ACTIVATE(269)
   Called from: main.prg => MAIN(55)




when you create a method you must try also with another prg because the sample run ok but our prg not run ok

if you want i can send you all ASS510.prg I not have problems to sent it to you

Since this error made on Fri Mar 07, 2008 and the method not corrected also

we must give to our customers our application and we cannot give an application with errors.

Now I corrected my souirce with another PRINTER fUNCTION non using report method but why ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Otto » Tue May 13, 2008 9:13 am

Hello Silvio,

have you tried the fix Antonio posted?
Regards,
Otto
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Postby Otto » Tue May 13, 2008 9:23 am

Hello NagesWaraRao,
I resent the email. Did you get it?
Thanks in advance
Otto
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Postby Silvio » Tue May 13, 2008 9:45 am

where is the fix ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Otto » Tue May 13, 2008 9:51 am

It is found that this error is occurring when for a column only bBmpData is assigned, leaving bEditValue and bStrData as NIL. This problem is fixed in FWH 8.05, by skipping such columns in the report method.

Temporary fix is to hide such columns before using report method.
_________________
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 70 guests