#include <FiveWin.ch>
#include <Report.ch>
//test to draw lines margins
request DBFCDX
Function Test()
Local oReport
LOCAL oPen1, oPen2
DEFINE PEN oPen1 WIDTH 1
DEFINE PEN oPen2 WIDTH 2
USE TEST NEW VIA "DBFCDX"
REPORT oReport TITLE "*** My First Report ***" PREVIEW ;
PEN oPen1, oPen2
COLUMN TITLE "St" DATA Test->State
COLUMN TITLE "First Name" DATA Test->First
COLUMN TITLE " Salary" DATA Test->Salary
END REPORT
oReport:CellView()
ACTIVATE REPORT oReport ;
ON STARTPAGE LinBox(oReport)
CLOSE TEST
return nil
//------------------------------------------------------//
STATIC Function LinBox(oReport)
LOCAL nInchWidth, nInchHeight
nInchWidth := oReport:PhyWidth(RPT_INCHES)
nInchHeight := oReport:PhyHeight(RPT_INCHES)
oReport:Box(.1 ,; // nRow
.1 ,; // nCol
nInchHeight-.1 ,; // nBottom
nInchWidth-.1 ,; // nRight
1 ,; // first pen created
RPT_INCHES)
RETURN NIL
FUNCTION MAIN()
LOCAL oReport, oPen[2]
DEFINE PEN oPen[1] WIDTH 3
DEFINE PEN oPen[2] WIDTH 2
USE TEST NEW VIA "DBFCDX"
REPORT oReport TITLE "*** My First Report ***" PREVIEW PEN oPen[1], oPen[2]
COLUMN TITLE "St" DATA Test->State
COLUMN TITLE "First Name" DATA Test->First
COLUMN TITLE " Salary" DATA Test->Salary
END REPORT
oReport:CellView()
ACTIVATE REPORT oReport ;
ON STARTPAGE LINBOX(oReport)
CLOSE TEST
RETURN NIL
// -------------
STATIC FUNCTION LINBOX(oReport)
LOCAL nInchWidth, nInchHeight
nInchWidth := oReport:PhyWidth(RPT_INCHES)
nInchHeight := oReport:PhyHeight(RPT_INCHES)
oReport:Box( 0.3 ,; // top
1.0 ,; // left
nInchHeight -.3 ,; // Bottom
nInchWidth -.3 ,; // Right
1 ,; // first pen created
RPT_INCHES )
// vertical line
oReport:Line( 0.3 ,; // nTop
0.9 ,; // nLeft
nInchHeight -.2 ,; // nBottom
0.9 ,; // nRight
2 ,; // second pen created
RPT_INCHES )
// horizontal line
// horizontal line
oReport:Line( nInchHeight -.2 ,; // nTop
0.9 ,; // nLeft
nInchHeight -.2 ,; // nBottom
nInchWidth -.3 ,; // nRight
2 ,; // second pen created
RPT_INCHES )
RETURN NIL
ukoenig wrote:Using pen 2 for lines I got a error, using pen 1 works.
REPORT oReport TITLE "*** My First Report ***" PREVIEW PEN oPen[1], oPen[2]
oReport:Margin( nNewValue, RPT_LEFT, RPT_CMETERS )
Silvio.Falconi wrote:and on printer class ?
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 57 guests