I have not used TPREVIEW class in my code so far. I have tried to use below code it is NOT working.
and also how to show the preview into user defined DIALOG WINDOW? I have searched in the /sample folder but I could not find. Please provide some examples on this. Thanks in advance...!
ERROR :
- Code: Select all Expand view RUN
Application
===========
Path and name: C:\VIMDEV32\VIMFA32\vimfa.exe (32 bits)
Size: 7,742,464 bytes
Compiler version: Harbour 3.2.0dev (r1904111533)
FiveWin version: FWH 19.06
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.1, Build 7601 Service Pack 1
Time from start: 0 hours 0 mins 19 secs
Error occurred at: 07/12/2019, 10:20:21
Error description: Error BASE/1004 No exported method: ACONTROLS
Args:
[ 1] = U
Stack Calls
===========
Called from: => ACONTROLS( 0 )
Called from: C:\VIMDEV32\VIMFA32\PRGS\scr_ar_party_osbill.prg => (b)PRINT_AR_PARTY_OSBILLS( 138 )
Called from: .\source\classes\RPREVIEW.PRG => TPREVIEW:ACTIVATE( 148 )
Called from: .\source\classes\RPREVIEW.PRG => RPREVIEW( 1890 )
Called from: .\source\classes\PRINTER.PRG => (b)TPRINTER( 272 )
Called from: .\source\classes\PRINTER.PRG => TPRINTER:PREVIEW( 0 )
Called from: .\source\classes\PRINTER.PRG => PRINTEND( 1331 )
Called from: C:\VIMDEV32\VIMFA32\PRGS\scr_ar_party_osbill.prg => PRINT_AR_PARTY_OSBILLS( 178 )
Called from: C:\VIMDEV32\VIMFA32\PRGS\scr_ar_party_osbill.prg => (b)AR_PARTY_OSBILLS( 103 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 704 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 990 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1791 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 2030 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3546 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: C:\VIMDEV32\VIMFA32\PRGS\scr_ar_party_osbill.prg => AR_PARTY_OSBILLS( 121 )
Called from: C:\VIMDEV32\VIMFA32\PRGS\scr_debitors_osbills.prg => (b)ALLDEBITORSOSBSUMM( 245 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:KEYDOWN( 2854 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:KEYDOWN( 1114 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:KEYDOWN( 3486 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1801 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 11218 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3546 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: C:\VIMDEV32\VIMFA32\PRGS\scr_debitors_osbills.prg => ALLDEBITORSOSBSUMM( 262 )
Called from: => (b)EVAL( 58 )
Called from: C:\VIMDEV32\VIMFA32\PRGS\a_pop_submenu.prg => (b)POP_SUB_MENU( 58 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:KEYCHAR( 3510 )
Called from: => TWINDOW:HANDLEEVENT( 0 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1801 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:HANDLEEVENT( 11218 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3546 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 304 )
Called from: C:\VIMDEV32\VIMFA32\PRGS\a_pop_submenu.prg => POP_SUB_MENU( 70 )
Called from: C:\VIMDEV32\VIMFA32\PRGS\vfawin_util.prg => (b)VFA_CTRLPNEL_DOCK_TILEMENU( 269 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 704 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 990 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1791 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 2030 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3546 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1078 )
Called from: C:\VIMDEV32\VIMFA32\PRGS\vfawin.prg => VFA_APPWIN( 167 )
Called from: C:\VIMDEV32\VIMFA32\PRGS\v.prg => MAIN( 27 )
System
======
CPU type: Intel(R) Core(TM) i7-4702MQ CPU @ 2.20GHz 2195 Mhz
Hardware memory: 7907 megs
Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %
Windows total applications running: 5
1 ,
2 , C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e697
3 DDE Server Window, C:\Windows\syswow64\OLE32.DLL
4 GDI+ Window, C:\Windows\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.18120_none_72d2e82386681b
5 Task Switching, C:\VIMDEV32\VIMFA32\vimfa.exe
Variables in use
================
Procedure Type Value
==========================
ACONTROLS
Param 1: O Class: ERROR
(b)PRINT_AR_PARTY_OSBILLS
Local 1: U
Local 2: U
TPREVIEW:ACTIVATE
Param 1: O Class: TPREVIEW
Param 2: O Class: TWINDOW
Local 1: U
Local 2: P 0x51A7984
Local 3: S
RPREVIEW
Local 1: O Class: TPREVIEW
Local 2: U
(b)TPRINTER
Param 1: O Class: TPRINTER
Local 1: U
Local 2: O Class: TPREVIEW
TPRINTER:PREVIEW
Param 1: O Class: TPRINTER
PRINTEND
PRINT_AR_PARTY_OSBILLS
Local 1: U
Local 2: U
(b)AR_PARTY_OSBILLS
Param 1: N 1840
Param 2: O Class: FWMARIAROWSET
Local 1: O Class: FWMARIAROWSET
Local 2: O Class: TPRINTER
Local 3: N 8.00
Local 4: O Class: TDIALOG
TBTNBMP:CLICK
Param 1: O Class: TBTNBMP
TBTNBMP:LBUTTONUP
TCONTROL:HANDLEEVENT
Param 1: N 19
Param 2: N 61
Param 3: N 0
Local 1: L .T.
Local 2: N 0
Local 3: S
TBTNBMP:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 1245245
Local 1: U
_FWH
Param 1: N 514
Param 2: N 0
Param 3: N 1245245
DIALOGBOXINDIRECT
Param 1: N 1245245
Param 2: N 514
Param 3: N 0
Param 4: N 1245245
Param 5: N 77
Local 1: O Class: TBTNBMP
TDIALOG:ACTIVATE
Param 1: N 4194304
Param 2: C "€ € ÈÏ P Ç
Æ S T A T I C D e b i t o r ' s O / S B i l l s P
<
Ç S T A T I C A c c o u n t €€P K È
È E D I T N E W P A R T Y A / C P Y
É S T A T I C F r o m P ³
Ê S T A T I C T o €€P w 7
Ë E D I T 0 1 / 0 4 / 2 0 1 8 €€P Â 7
Ì E D I T 3 1 / 0 3 / 2 0 1 9 !P
7 þÍ T X B R O W S E P T7 Î T B T N B M P & P r i n t P Z T6 Ï T B T N B M P & E x c e l P hT6 Ð T B T N B M P & Q u i t "
Param 3: N 263858
Param 4: O Class: TDIALOG
AR_PARTY_OSBILLS
Param 1: U
Param 2: U
Param 3: U
Param 4: L .T.
Param 5: U
Param 6: L .T.
Param 7: B {|| ... }
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Param 12: L .F.
Param 13: O Class: TDIALOG
Param 14: U
Local 1: N 263858
Local 2: S
Local 3: O Class: TDIALOG
(b)ALLDEBITORSOSBSUMM
Param 1: N 1840
Param 2: C "NEW PARTY A/C "
Local 1: O Class: TDIALOG
Local 2: O Class: FWMARIAROWSET
Local 3: O Class: TXBROWSE
Local 4: A Len: 5
Local 5: A Len: 5
TWINDOW:KEYDOWN
Param 1: N 13
Param 2: N 1835009
Param 3: O Class: TXBROWSE
TCONTROL:KEYDOWN
Param 1: N 13
Param 2: N 1835009
Local 1: U
TXBROWSE:KEYDOWN
Param 1: N 13
Param 2: N 1835009
Local 1: U
TWINDOW:HANDLEEVENT
Param 1: N 13
Param 2: N 1835009
Local 1: O Class: TXBRWCOLUMN
Local 2: U
TCONTROL:HANDLEEVENT
Param 1: N 256
Param 2: N 13
Param 3: N 1835009
TXBROWSE:HANDLEEVENT
Param 1: N 256
Param 2: N 13
Param 3: N 1835009
Local 1: U
_FWH
Param 1: N 256
Param 2: N 13
Param 3: N 1835009
DIALOGBOXINDIRECT
Param 1: N 1835009
Param 2: N 256
Param 3: N 13
Param 4: N 1835009
Param 5: N 42
Local 1: O Class: TXBROWSE
TDIALOG:ACTIVATE
Param 1: N 4194304
Param 2: C "€ € þrÿÈÎ P Ç
¶ S T A T I C < A l l D e b i t o r ' s O u t s t a n d i n g S u m m a r y > P Y
· S T A T I C F r o m P ³
¸ S T A T I C T o €€P w 7
¹ E D I T 0 1 / 0 4 / 2 0 1 8 €€P Â 7
º E D I T 3 1 / 0 3 / 2 0 1 9 !P
7 þÃ » T X B R O W S E "
Param 3: N 132750
Param 4: O Class: TDIALOG
ALLDEBITORSOSBSUMM
Param 1: U
Param 2: U
Param 3: U
Param 4: L .F.
Param 5: U
Param 6: L .T.
Param 7: B {|| ... }
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Param 12: L .F.
Param 13: O Class: TDIALOG
Param 14: U
Local 1: N 132750
Local 2: S
Local 3: O Class: TDIALOG
(b)EVAL
Local 1: O Class: TDIALOG
Local 2: O Class: FWMARIAROWSET
Local 3: O Class: TXBROWSE
Local 4: A Len: 5
(b)POP_SUB_MENU
TXBROWSE:KEYCHAR
Param 1: N 13
Param 2: N 1835009
Param 3: O Class: TXBROWSE
Param 4: O Class: TXBRWCOLUMN
TWINDOW:HANDLEEVENT
Param 1: N 13
Param 2: N 1835009
Local 1: B {|| ... }
Local 2: O Class: TXBRWCOLUMN
Local 3: U
Local 4: U
TCONTROL:HANDLEEVENT
Param 1: N 258
Param 2: N 13
Param 3: N 1835009
TXBROWSE:HANDLEEVENT
Param 1: N 258
Param 2: N 13
Param 3: N 1835009
Local 1: U
_FWH
Param 1: N 258
Param 2: N 13
Param 3: N 1835009
DIALOGBOXINDIRECT
Param 1: N 1835009
Param 2: N 258
Param 3: N 13
Param 4: N 1835009
Param 5: N 32
Local 1: O Class: TXBROWSE
TDIALOG:ACTIVATE
Param 1: N 4194304
Param 2: C "€ € â µ P á
“ S T A T I C O u t s t a n d i n g B i l l s !P
Ø ¡ ” T X B R O W S E "
Param 3: N 460410
Param 4: O Class: TDIALOG
POP_SUB_MENU
Param 1: U
Param 2: U
Param 3: B {|| ... }
Param 4: L .T.
Param 5: U
Param 6: L .T.
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Param 12: L .F.
Param 13: O Class: TDIALOG
Param 14: U
Local 1: N 460410
Local 2: S
Local 3: O Class: TDIALOG
(b)VFA_CTRLPNEL_DOCK_TILEMENU
Param 1: N 3000
Param 2: C "Outstanding Bills"
Local 1: O Class: TDIALOG
Local 2: O Class: TXBROWSE
Local 3: O Class: TLINKLIST
TBTNBMP:CLICK
Param 1: O Class: TBTNBMP
TBTNBMP:LBUTTONUP
TCONTROL:HANDLEEVENT
Param 1: N 67
Param 2: N 36
Param 3: N 0
Local 1: L .T.
Local 2: N 0
Local 3: S
TBTNBMP:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 4390948
Local 1: U
_FWH
Param 1: N 514
Param 2: N 0
Param 3: N 4390948
WINRUN
Param 1: N 4390948
Param 2: N 514
Param 3: N 0
Param 4: N 4390948
Param 5: N 22
Local 1: O Class: TBTNBMP
TWINDOW:ACTIVATE
Param 1: N 460410
VFA_APPWIN
Param 1: C "MAXIMIZED"
Param 2: U
Param 3: U
Param 4: U
Param 5: U
Param 6: B {|| ... }
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Param 12: U
Param 13: U
Param 14: U
Param 15: U
Param 16: U
Param 17: U
Param 18: U
Param 19: U
Param 20: L .F.
Local 1: O Class: TWINDOW
Local 2: U
Local 3: U
MAIN
Local 1: A Len: 5
Local 2: N 1080
Local 3: O Class: TICON
Local 4: A Len: 10
Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFCDX
DBFNTX
DataBases in use
================
Classes in use:
===============
1 ERROR
2 HBCLASS
3 HBOBJECT
4 TAPPLICATION
5 TWINDOW
6 TDIALOG
7 TBRUSH
8 TFONT
9 TREG32
10 FWMARIACONNECTION
11 TCONTROL
12 TGET
13 FWROWSET
14 FWMARIAROWSET
15 TFIELD
16 TFIELDS
17 TBTNBMP
18 TBITMAP
19 TSAY
20 GET
21 TCLIPGET
22 TRECT
23 TXBROWSE
24 TXBRWCOLUMN
25 TSCROLLBAR
26 TCLIPBOARD
27 TLINKLIST
28 TTREEITEM
29 TICON
30 TBUTTON
31 TPREVIEW
32 TPRINTER
33 TPEN
34 TMENU
35 TMENUITEM
36 TCURSOR
37 TIMAGELIST
38 TREBAR
39 TTOOLBAR
40 TSTATUSBAR
41 TLISTVIEW
42 TMETAFILE
43 TCOMBOBOX
44 TSTRUCT
Memory Analysis
===============
824 Static variables
Dynamic memory consume:
Actual Value: 3342336 bytes
Highest Value: 3342336 bytes
SOURCE CODE :
- Code: Select all Expand view RUN
PROCEDURE print_ar_party_osbills(nAcctId, oRsAcctOSBList )
local oAcctDetRs
local oPrn
local nPRow
//oWnd := create_uiwnd("Preview" )
TPreview():bSetup := <|oPreview, oWnd|
WITH OBJECT oWnd:oBar
:aControls[ 10 ]:End()
ADel( :aControls, 10, .t. )
:BtnAdjust()
END
return nil
>
oAcctDetRs := oApp:oDBConn:RowSet( VW_ACCT_INFO_BY_ID( nAcctId ) )
// GoTo First Record of the RowSet
oRsAcctOSBList:GoTop()
PRINT oPrn NAME "Debitor's O/S Bills" PREVIEW
DEFINE FONT oFont NAME "Arial" SIZE 0, -10 BOLD OF oPrn
DEFINE PEN oPen WIDTH 2 OF oPrn
oPrn:SetPage(9) // A4
oPrn:SetPortrait() //Vertical
PAGE
oPrn:CmSay( 01.00, 0.45,"Debitor's O/S Bills", oFont )
oPrn:CmSay( 01.00, 0.45,oApp:oCompRS:CNAME, oFont,19.00,CLR_BLACK,,PAD_RIGHT )
oPrn:CmSay( 01.50, 0.45,"Party A/c "+Alltrim( oAcctDetRs:ACCT_NAME ) +" Mob. #"+alltrim( oAcctDetRs:MOBILE_NO ) , oFont )
oPrn:CmSay( 02.00, 0.45,"Area "+Alltrim( oAcctDetRs:AREA_NAME ) , oFont )
oPrn:CmSay( 02.50, 0.45,"Period "+DTOC(oApp:XREPORT_FROM_DATE)+" to "+DTOC(oApp:XREPORT_TO_DATE) , oFont )
oPrn:CmLine(03.00,0.05, 03.00, 20.15, oPen )
nPRow := 3.50
do while !oRsAcctOSBList:Eof()
oPrn:CmSay( nPRow , 00.10, dtoc(oRsAcctOSBList:BILL_DATE), oFont ,01.81 )
oPrn:CmSay( nPRow , 02.01, oRsAcctOSBList:BILL_NO, oFont ,01.50 )
oPrn:cmSay( nPRow , 03.81, Transform(oRsAcctOSBList:BILL_AMOUNT,"@Z 99,99,99,999.99") , oFont ,02.00,CLR_BLACK,,PAD_RIGHT )
oPrn:cmSay( nPRow , 05.81, Transform(oRsAcctOSBList:REC_AMOUNT ,"@Z 99,99,99,999.99") , oFont ,02.00,CLR_BLACK,,PAD_RIGHT )
oPrn:cmSay( nPRow , 07.81, Transform(oRsAcctOSBList:BAL_AMOUNT ,"@Z 99,99,99,999.99") , oFont ,02.00,CLR_BLACK,,PAD_RIGHT )
//@ nPRow, 07.81 PRINT TO oPrn TEXT Transform(oRsAcctOSBList:BAL_AMOUNT,"@Z 99,99,99,999.99") SIZE 2.00 CM FONT oFont ALIGN "TR"
nPRow := nPRow + 0.50
oRsAcctOSBList:Skip()
enddo
ENDPAGE
ENDPRINT
return