Subject |
Re: Printing Image data on specified location of paper. |
From |
Mervyn Bick <invalid@invalid.invalid> |
Date |
Wed, 30 Jul 2014 10:17:48 +0200 |
Newsgroups |
dbase.getting-started |
On Tue, 29 Jul 2014 14:31:03 +0200, Olivari <isellall777@gmail.com> wrote:
> There is a table having Photo (Image field ) , Position_Col ( Numeric
> field) and Position_Row( Numeric field)
> When I print one Image of Reowset at specified location( Position_col,
> Position_row) of it on A4 paper
> I want to know how to do coding
> Is it available to use Report Designer ?
> Or Let me know how to code for this matter Pls....
>
The dBASE report designer does not understand rows and columns in the way
that the @ x,y SAY command did in 16bit dBASE. It can, however, come
close if the report's metric property is set to "character".
The dBASE report designer places a detailband object in the report for
every record in the table. Within the detailband you can place an image
at specific places which can be changed for each record if necessary.
The placing of an object is, however, relative to the top and left of the
detail band rather than the top and left of the sheet of paper.
You can use the image object's canRender event hander to set the top and
left coordinates for the image before it is rendered.
In the example report below the streamframe and detailband sizes are set
so that the values you have provided for rows and columns will work. It
does, of course, mean that only one record can be shown per page.
Mark and copy the code below. In the control panel enter modi comm
prntest01.rep Paste the code into the socurcecode editor, save and run.
Mervyn
********* Start of example code ************
** END HEADER -- do not remove this line
//
// Generated on 2014/07/30
//
local r
r = new prntest01Report()
r.render()
class prntest01Report of REPORT
with (this)
metric = 0 // Chars
autoSort = false
endwith
this.PRNTEST011 = new QUERY()
this.PRNTEST011.parent = this
with (this.PRNTEST011)
left = 2.5
top = 5.65
sql = 'select * from "prntest01.dbf"'
requestLive = false
active = true
endwith
this.STREAMSOURCE1 = new STREAMSOURCE(this)
with (this.STREAMSOURCE1.detailBand)
height = 55.0
endwith
this.STREAMSOURCE1.detailBand.IMAGEFISH1 = new
IMAGE(this.STREAMSOURCE1.detailBand)
with (this.STREAMSOURCE1.detailBand.IMAGEFISH1)
canRender = class::IMAGEFISH1_CANRENDER
height = 5.0
left = 10.0
top = 30.0
width = 24.3333
dataSource = form.form.prntest011.rowset.fields["fish"]
enabled = true
endwith
this.STREAMSOURCE1.detailBand.TEXTNAME1 = new
TEXT(this.STREAMSOURCE1.detailBand)
with (this.STREAMSOURCE1.detailBand.TEXTNAME1)
height = 0.9767
left = 1.0
top = 0.3267
width = 32.0
variableHeight = true
prefixEnable = false
text = {||this.form.prntest011.rowset.fields["name"].value}
endwith
with (this.printer)
duplex = 1 // None
orientation = 1 // Portrait
paperSource = 7
paperSize = 9
resolution = 3 // Medium
color = 2 // Color
trueTypeFonts = 1 // Bitmap
endwith
this.PAGETEMPLATE1 = new PAGETEMPLATE(this)
with (this.PAGETEMPLATE1)
height = 56.1233
width = 132.2778
marginTop = 0.5
marginLeft = 12.0
marginBottom = 1.0
marginRight = 12.0
gridLineWidth = 0
endwith
this.PAGETEMPLATE1.STREAMFRAME1 = new STREAMFRAME(this.PAGETEMPLATE1)
with (this.PAGETEMPLATE1.STREAMFRAME1)
height = 55.0
left = 4.0
top = 1.0
width = 104.0
form.STREAMFRAME1 = form.pagetemplate1.streamframe1
endwith
this.firstPageTemplate = this.form.pagetemplate1
this.form.pagetemplate1.nextPageTemplate = this.form.pagetemplate1
this.form.pagetemplate1.streamframe1.streamSource =
this.form.streamsource1
this.form.streamsource1.rowset = this.form.prntest011.rowset
function IMAGEFISH1_canRender
this.top = form.prntest011.rowset.fields["positionRow"].value
this.left = form.prntest011.rowset.fields["positionCol"].value
return true
endclass
********** End of example code ********
|
|