xbrowse print/report method?

xbrowse print/report method?

Postby Randal » Thu Nov 15, 2007 1:58 pm

All,

Does anyone have a report or print method for xbrowse?

Thanks,
Randal
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm

Postby Silvio » Thu Nov 15, 2007 3:13 pm

wich version you have?
Best Regards, Saludos

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

Postby Silvio » Thu Nov 15, 2007 3:30 pm

Sorry there's not in new version , try it please

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 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.
Best Regards, Saludos

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

Postby Randal » Thu Nov 15, 2007 3:32 pm

Silvio,

I have the latest version 7.11. Thanks for the code, I'll give this a try.

Best Regards,
Randal
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm

Postby Silvio » Thu Nov 15, 2007 3:33 pm

Randal
I wait your comment
Best Regards, Saludos

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

Postby Randal » Thu Nov 15, 2007 3:46 pm

Silvio,

I found finfo1 and finfo2 in the browse.prg. Where can I find finfo3 function?

Thanks,
Randal
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Antonio Linares, Google [Bot] and 83 guests