problem with report
Posted: Thu Jan 22, 2015 11:56 am
The problem with reports for. When printing multiple pages every second, third page is blank. Does anyone encountered a similar problem.
Thank you.
Thank you.
www.FiveTechSoft.com
http://forums.fivetechsoft.com/
Code: Select all
#include "FiveWin.ch"
#Include "Report.Ch"
STATIC oWnd, lPreview := .F.
function Main()
local oBar, oCursorHand
DEFINE CURSOR oCursorHand HAND
DEFINE WINDOW oWnd ;
TITLE "Testing FiveWin Report-Engine and Print-Preview" ;
MENU BuildMenu()
DEFINE BUTTONBAR oBar _3D SIZE 26, 27 OF oWnd
AEval( oBar:aControls, { | o | o:oCursor := oCursorHand } )
DEFINE BUTTON OF oBar FLAT TOOLTIP "Generate report" ;
ACTION DoReport() RESOURCE "Report"
DEFINE BUTTON OF oBar FLAT GROUP TOOLTIP "Exit" ;
ACTION oWnd:End() RESOURCE "Exit"
DEFINE MESSAGE BAR OF oWnd TITLE FWCOPYRIGHT ;
NOINSET DATE CLOCK KEYBOARD
WndCenter( oWnd:hWnd )
ACTIVATE WINDOW oWnd ;
VALID ! lPreview .and. MsgYesNo( "Want to exit ?" )
return nil
function BuildMenu()
local oMenu
MENU oMenu
MENUITEM "&Generate Report" ACTION DoReport() ;
MESSAGE "Open customers database and generate a report"
MENUITEM "&Exit" ACTION oWnd:End() ;
MESSAGE "Terminate the application and exit"
ENDMENU
return oMenu
function DoReport()
LOCAL oPen1, oPen2, oFont1, oFont2, oFont3, oRpt
lPreview = .T. //??
USE Customer
GO TOP
DEFINE PEN oPen1 WIDTH 2
DEFINE PEN oPen2 WIDTH 1
DEFINE FONT oFont1 NAME "Arial" SIZE 0, -11
DEFINE FONT oFont2 NAME "Arial" SIZE 0, -11
DEFINE FONT oFont3 NAME "Courier New" SIZE 0, 09 BOLD
REPORT oRpt TITLE "Print - Report Name" ;
CAPTION "Report Text Caption" ;
HEADER "Preview Header - Name Company" , ;
"Date: " + DTOC( DATE() ) , ;
"Page: " + STR( oRpt:nPage, 3 ) ;
FOOTER "- Report Text Footer - " CENTER ;
FONT oFont1, oFont2, oFont3 ;
PEN oPen1, oPen2 ;
PREVIEW
oRpt:oDevice:lPrvModal := .T.
oRpt:oDevice:SetPage(9)
COLUMN TITLE "First" DATA Customer->First
COLUMN TITLE "Last" DATA Customer->Last
COLUMN TITLE "State" DATA Customer->State
END REPORT
IF !oRpt:lCreated
RETURN NIL
ENDIF
oRpt:CellView()
ACTIVATE REPORT oRpt ON INIT oRpt:oTitle:aFont[1] := { || 3 }
oPen1:End()
oPen2:End()
oFont1:End()
oFont2:End()
oFont3:End()
USE
lPreview = .F.
return nil
// END