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
bPrevious := SetCustomPrintPreview( { |oDevice, oReport| MyPreview( oDevice, oReport ) } )
#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
//----------------------------------------------------------------------------//
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 43 guests