HOW TO DISPLAYXBROWSE REPORT IN CUSTOMIZED PREVIEW ?

HOW TO DISPLAYXBROWSE REPORT IN CUSTOMIZED PREVIEW ?

Postby shrifw » Mon Sep 25, 2023 5:36 pm

Dear Rao Sir ,

Could you please help me in displaying/Preview Report in Customer PREVIEW WINOW using XBROWSE :Report() method. Thanks in advance...!

Thanks
Shridhar
shrifw
 
Posts: 69
Joined: Fri Aug 28, 2009 5:25 am

Re: HOW TO DISPLAYXBROWSE REPORT IN CUSTOMIZED PREVIEW ?

Postby nageswaragunupudi » Mon Sep 25, 2023 7:25 pm

Calling oBrw:Report() will automatically display the report in a preview window.
Regards

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

Re: HOW TO DISPLAYXBROWSE REPORT IN CUSTOMIZED PREVIEW ?

Postby shrifw » Tue Sep 26, 2023 4:52 am

Dear Rao Sir ,

The oBrw:Report() open its own Preview , I want to display Preview in the user defined window along with the Custom buttons. The window size will have different size and also button size/shape .

Thanks
Shridhar
shrifw
 
Posts: 69
Joined: Fri Aug 28, 2009 5:25 am

Re: HOW TO DISPLAYXBROWSE REPORT IN CUSTOMIZED PREVIEW ?

Postby nageswaragunupudi » Tue Sep 26, 2023 10:42 am

If you have your own preview function, you can set it globally.
Code: Select all  Expand view
bPrevious := SetCustomPrintPreview( { |oDevice, oReport| MyPreview( oDevice, oReport ) } )

and keep changing whenever you want.

You can try this example to begin with.
Code: Select all  Expand view
#include "fivewin.ch"

//----------------------------------------------------------------------------//

function Main()

   local oRep, oFont

   SetCustomPrintPreview( { |oDevice, oReport| MyPreview( oDevice, oReport ) } )

   XBROWSER "CUSTOMER.DBF"

return nil

//----------------------------------------------------------------------------//

function MyPreview( oDevice, oReport )

   local aMeta, oWnd, oFont, oBrush, oBrw, oImage
   local lExit := .f.

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-15
   DEFINE BRUSH oBrush FILE "..\bitmaps\backgrnd\stone.bmp"
   DEFINE WINDOW oWnd
   oWnd:SetFont( oFont )

   DEFINE BUTTONBAR oWnd:oBar SIZE 100,32 2007
   SET MESSAGE OF oWnd TO "" 2007

   DEFINE BUTTON OF oWnd:oBar PROMPT "Center"     CENTER ACTION ( oImage:Center(),    oImage:SetFocus() )
   DEFINE BUTTON OF oWnd:oBar PROMPT "Fit Width"  CENTER ACTION ( oImage:FitWidth(),  oImage:SetFocus() )
   DEFINE BUTTON OF oWnd:oBar PROMPT "Fit Height" CENTER ACTION ( oImage:FitHeight(), oImage:SetFocus() )
   DEFINE BUTTON OF oWnd:oBar PROMPT "Fit Rect"   CENTER ACTION ( oImage:FitRect(),   oImage:SetFocus() )
   DEFINE BUTTON OF oWnd:oBar PROMPT "Zoom"       CENTER ACTION ( MsgInfo( "Zoom/Unzoom with Mouse Wheel" ),  oImage:SetFocus() )
   DEFINE BUTTON OF oWnd:oBar PROMPT "Pan/Move"   CENTER ACTION ( MsgInfo( "Drag with Mouse" ),  oImage:SetFocus() )

   @ oWnd:oBar:nHeight,0 XBROWSE oBrw SIZE 250,-oWnd:oMsgBar:nHeight ;
      PIXEL OF oWnd DATASOURCE oDevice:aMeta COLUMNS 1 ;
      HEADERS "ThumbNail" LINES NOBORDER

   WITH OBJECT oBrw
      :aCols[ 1 ]:cDataType   := "F"
      :aCols[ 1 ]:nWidth      := 300
      :nRowHeight             := 200
      :lHScroll               := .f.
      :bChange                := { || oImage:Refresh() }
      //
      :CreateFromCode()
   END

   @ oWnd:oBar:nHeight,oBrw:nWidth XIMAGE oImage SIZE 0,-oWnd:oMsgBar:nHeight ;
      OF oWnd SOURCE oBrw:aRow

   oImage:SetBrush( oBrush )

   ACTIVATE WINDOW oWnd MAXIMIZED VALID ( lExit := .t. )

   StopUntil( { || lExit } )

   RELEASE FONT oFont
   RELEASE BRUSH oBrush

return nil

//----------------------------------------------------------------------------//
 
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 60 guests