Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FIVEWIN:Printing graphics in preview ???

Status
Not open for further replies.

sharok

Programmer
Jan 2, 2002
22
US
Does anybody know how to use bitmaps and graphic functions
in print preview ?
 
Hi Sharok,

For printout Boxes and lines define PEN, for example:

This is a Complete Report with Fivewin TReport Class and use PEN Object for Draw Lines and Box
#include "FiveWin.ch"
#include "report.ch"


STATIC oReport

Function Rep19()

LOCAL oPen1, oPen2

DEFINE PEN oPen1 WIDTH 5
DEFINE PEN oPen2 WIDTH 2

USE TEST INDEX TEST NEW

REPORT oReport ;
TITLE "*** Fivewin Report ***" ;
PEN oPen1, oPen2 ;
PREVIEW

COLUMN TITLE "St" DATA Test->State

COLUMN TITLE "First Name", "Last Name" ;
DATA Test->First, Test->Last

COLUMN TITLE "Street", "City" ;
DATA Test->Street, Test->City

COLUMN TITLE " Salary" ;
DATA Test->Salary ;
TOTAL

END REPORT

ACTIVATE REPORT oReport ;
ON STARTPAGE LinBox()

CLOSE TEST

RETURN NIL


STATIC Function LinBox()

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)

oReport:Line(0.9 ,; // nTop
0.55 ,; // nLeft
2 ,; // nBottom
0.55 ,; // nRight
2 ,; // second pen created
RPT_INCHES)


RETURN NIL

If you want view Bitmaps check out this sample:

With TReport Class Ok:

#include "FiveWin.ch"
#include "report.ch"


STATIC oReport

Function Rep18()

USE TEST INDEX TEST NEW

REPORT oReport ;
TITLE "*** Fivewin Report ***" ;
PREVIEW

COLUMN TITLE "St" DATA Test->State

COLUMN TITLE "First Name", "Last Name" ;
DATA Test->First, Test->Last

COLUMN TITLE "Street", "City" ;
DATA Test->Street, Test->City

COLUMN TITLE " Salary" ;
DATA Test->Salary ;
TOTAL

END REPORT

ACTIVATE REPORT oReport ;
ON STARTPAGE Bitmaps()

CLOSE TEST

RETURN NIL


STATIC Function Bitmaps()

oReport:SayBitmap(.3,.3, "EXIT",.5,.5)
oReport:SayBitmap(3,2, "CONFIDEN.BMP",4,4)

RETURN NIL


Best Regards

Jesus Tarre
jtarre@cantv.net
 
Thank you jesus for the example you sent me. It worked fine.
Is there a way to make the print-out in color. It only
prints in black/white.


Thanks again.
 
Hi Sharok,

Yeap, Color and much more !!!

Check out this Report sample: Lines, Boxes, Bitmap and Colors, yes color with only use COLOR Clausule in the PEN Objects and SettxtColor() Function for Text Color.

Where're you from Sharok ?
I want work with Clipper+Fivewin out of my country
I've 4 year working with 5win and 13 years with CA-Clipper from summers'87 to 5.3b

Fivewin is a wonderfull library, is the autentic Clipper for Windows, Thank Fivetech Spain :)

I used Visual Basic, Visual Fox, Access and Delphi and Clipper+Fivewin Combo is the very best Programmer Tool, is Powerfull.

Ok, Report Sample: All together and with COLORS!

#include "FiveWin.ch"
#include "report.ch"


STATIC oReport

Function Rep22()

LOCAL oFont1, oFont2, oFont3, oPen1, oPen2

DEFINE FONT oFont1 NAME "ARIAL" SIZE 0,-10
DEFINE FONT oFont2 NAME "ARIAL" SIZE 0,-10 BOLD
DEFINE FONT oFont3 NAME "ARIAL" SIZE 0,-10 BOLD ITALIC

DEFINE PEN oPen1 WIDTH 3 COLOR CLR_HGREEN
DEFINE PEN oPen2 WIDTH 1 COLOR CLR_HMAGENTA

USE TEST INDEX TEST NEW

GO TOP

REPORT oReport ;
TITLE "*** FiveWin Report DEMO ***",;
"",;
OemtoAnsi("by Ignacio Ortiz de Zu¤iga"),;
"" ;
FONT oFont1,;
oFont2,;
oFont3 ;
PEN oPen1,;
oPen2 ;
HEADER "Date: "+dtoc(date()),;
"Time: "+time() ;
RIGHT ;
FOOTER OemtoAnsi("Page: ")+str(oReport:nPage,3) ;
CENTERED ;
PREVIEW

GROUP ON Test->State ;
FOOTER "Total State "+oReport:aGroups[1]:cValue+ ;
" ("+ltrim(str(oReport:aGroups[1]:nCounter))+")" ;
FONT 2

COLUMN TITLE "ST" ;
DATA Test->State ;
FONT 2 ;
GRID 2

COLUMN TITLE "City" ;
DATA Test->City ;
GRID 2

COLUMN TITLE "First Name","Last Name" ;
DATA Test->First , Test->Last ;
GRID 2

COLUMN TITLE " Salary" ;
DATA Test->Salary ;
PICTURE "9,999,999" ;
SIZE 9 ;
TOTAL ;
SHADOW ;
GRID

END REPORT

IF oReport:lCreated

/*
First line of title bold
*/

oReport:eek:Title:aFont[1] := {|| 2 }

/*
Total descriptors
*/

oReport:cGrandTotal := "Grand Total..."
oReport:cPageTotal := "Page Total..."

/*
Italic when salary greater than 100,000
*/

oReport:aColumns[4]:bDataFont := {|| iif(Test->Salary>100000,3 ,1 ) }

/*
Change some colors
*/

oReport:SetTxtColor(CLR_HBLUE,1)
oReport:SetTxtColor(CLR_HRED,2)
oReport:SetTxtColor(CLR_YELLOW,3)
oReport:SetPenColor(CLR_HCYAN)
oReport:SetShdColor(CLR_GREEN)

ENDIF

ACTIVATE REPORT oReport ON STARTGROUP oReport:NewLine() ;
ON STARTPAGE StartPage()

/*
Close and release
*/

oFont1:End()
oFont2:End()
oFont3:End()
oPen1:End()
oPen2:End()

CLOSE TEST

RETURN NIL


STATIC Function StartPage()

oReport:Box(0.1, ;
0.1, ;
oReport:phyHeight()-0.1, ;
oReport:phyWidth() -0.1 )

oReport:Line(0.9, 0.55, 2, 0.55, 2 )
oReport:Line(0.55, 0.9, 0.55, 2, 2 )
oReport:SayBitmap(.3,.3,"ICO.BMP",.5,.5)
oReport:SayBitmap(3,2,"CONFIDEN.BMP",4,4)

RETURN NIL


Best Regards

Jesus Tarre
jtarre@cantv.net
Maracaibo, VENEZUELA
 
Hi jesus;
Thanks again for your help. I managed to print in color.

I am in USA (Illinois). I have worked with Clipper5.2/5.3b for 7.5 years. I have done a lot of graphic programming with
clipper 5.3b building my own browsers, report viewers, windows, etc in graphic mode. I even made my own "say/get/achoice/memoedit/..." routines from basic, all in beautiful graphic mode which resembles Windows design. But now I started FiveWin, and I find it very easy to use. But first I had problems installing it on my computer. I am using version 1.9.2. and unfortunately they don't have an upgrade patch for this version. They have it for versions 2.0 above. But FiveWin is great.


Sincerely,
Sharok
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top