|
Home > Archive > dBASE Knowledge Base > November 2005 > a reprot problem - all i want to do is print fields from a row on different pages ... HELP!
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
a reprot problem - all i want to do is print fields from a row on different pages ... HELP!
|
|
|
| Hi ive been trying to create a report that will let me render fields from one row of a table to different pages (i actually have a table with over 200 fields and need about 5 pages to print them all) ... i found the report example below and it works excep
t the last page of the last record won't print ... i just cant find a way to make it ... can anyone PLEASE show me how to make this report work and i will be eternally grateful.
HELP PLEASE ... its deafeningly silent out there in the newsgroups ive tried
regards
max
// Save to one file and run
set database to
close tables
if file('Ulli_M.dbf')
drop table Ulli_M
endif
create table Ulli_M (id integer,f1 char(10),f2 char(5),f3 char(5),f4 char(5))
insert into Ulli_M values (1,'First', '1a','1b','1c')
insert into Ulli_M values (2,'Second','2a','2b
','2c')
insert into Ulli_M values (3,'Third', '3a','3b','3c')
insert into Ulli_M values (4,'fourth','4a','4b
','4c')
** END HEADER -- do not remove this line
//
// Generated on 08/11/2005
//
local r
r = new MarkosRepREPORT()
r.render()
class MarkosRepREPORT of REPORT
set procedure to :ReportControls:REPO
RT.CC additive
with (this)
metric = 4 // Centimeters
endwith
this.ULLI_M1 = new QUERY()
this.ULLI_M1.parent = this
with (this.ULLI_M1)
left = -0.0265
top = -0.0265
sql = 'select * from "ulli_m.dbf"'
active = true
endwith
with (this.printer)
duplex = 1 // None
orientation = 1 // Portrait
paperSource = 15
paperSize = 9
resolution = 4 // High
color = 1 // Monochrome
trueTypeFonts = 3 // Substitute
endwith
this.PAGETEMPLATE1 = new PAGETEMPLATE(this)
with (this.PAGETEMPLATE1)
height = 10.0
width = 20.9991
marginTop = 1.905
marginLeft = 1.905
marginBottom = 1.905
marginRight = 1.905
gridLineWidth = 0
endwith
this.PAGETEMPLATE1.STREAMFRAME1 = new STREAMFRAME(this.PAGETEMPLATE1)
with (this.PAGETEMPLATE1.STREAMFRAME1)
height = 5.0
left = 0.0
top = 0.0
width = 10.0
form.STREAMFRAME1 = form.pagetemplate1.streamframe1
endwith
this.PAGETEMPLATE1.PAGENUMBER1 = new PAGENUMBER(this.PAGETEMPLATE1)
with (this.PAGETEMPLATE1.PAGENUMBER1)
left = 6.0
top = 6.0
form.PAGENUMBER1 = form.pagetemplate1.pagenumber1
endwith
this.STREAMSOURCE1 = new STREAMSOURCE(this)
with (this.STREAMSOURCE1.detailBand)
height = 6.5334
endwith
this.STREAMSOURCE1.detailBand.TEXT3 = new TEXT(this.STREAMSOURCE1.detailBand)
with (this.STREAMSOURCE1.detailBand.TEXT3)
canRender = class::TEXT_1_CANREN
DER
height = 0.5292
left = 0.0
top = 0.0
width = 6.0
prefixEnable = false
text = {||"Begin text - Page " + form.reportPage + " - " + form.ulli_M1.rowset.fields["f1"].value.rightTrim() + " f1"}
endwith
this.STREAMSOURCE1.detailBand.TEXT4 = new TEXT(this.STREAMSOURCE1.detailBand)
with (this.STREAMSOURCE1.detailBand.TEXT4)
canRender = class::TEXT_1_CANREN
DER
height = 0.5292
left = 0.0
top = 3.9952
width = 5.0
prefixEnable = false
text = {||"End text - Page " + form.reportPage + " - " + form.ulli_M1.rowset.fields["f1"].value.rightTrim() + " f1"}
endwith
this.STREAMSOURCE1.detailBand.TEXT6 = new TEXT(this.STREAMSOURCE1.detailBand)
with (this.STREAMSOURCE1.detailBand.TEXT6)
canRender = class::TEXT_2_CANREN
DER
height = 0.5292
left = 0.0
top = 0.0
width = 5.0
prefixEnable = false
text = "Begin text continuation page..."
endwith
this.STREAMSOURCE1.detailBand.TEXT7 = new TEXT(this.STREAMSOURCE1.detailBand)
with (this.STREAMSOURCE1.detailBand.TEXT7)
canRender = class::PAGE2_CANREND
ER
height = 0.5292
left = 0.0
top = 3.006
width = 5.0
prefixEnable = false
text = {||"Page " + form.reportPage + ' '+ form.ulli_M1.rowset.fields["f2"].value}
endwith
with (this.reportGroup.headerBand)
height = 0.0
endwith
with (this.reportGroup.footerBand)
height = 0.0
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.ulli_m1.rowset
function TEXT_1_CANRENDER
//msgbox("text1-canrender")
if form.reportPage % 2 = 1
return true
else
return false
endif
return
function TEXT_2_CANRENDER
if form.reportPage % 2 = 1
this.parent.parent.beginNewFrame()
return false
else
//if form.ulli_M1.rowset.fields["f1"].value # 'fourth'
form.streamsource1.rowset.next(-1)
//endif
return true
endif
return true
function page2_CANRENDER
if form.reportPage % 2 = 0
return true
else
return false
endif
return
endclass
| |
| Eric Logan 2005-11-18, 11:23 am |
| Hi Max;
Your report seems very clever and taught me a lot. Perhaps something you are
doing needs to be undone afterward. You are doing several things in your
canrender methods.
1) conditionally enabling canrender for different objects based on even/odd
report page numbering.
2) conditionally beginning new frames based on even/odd report page
numbering
3) conditionally moving the row cursor based on field values
Surely there is some unforeseen interaction going on.
For example, in TEXT_2_CANRENDER, couldn't the line:
"form.streamsource1.rowset.next(-1)"
cause the last row of data to be inaccessible?
When I make all your canrender events return only true I can navigate
through all 4 rows and even to a blank fifth page.
That's all I can say now. Good luck.
Eric Logan
"max" wrote ...
> Hi ive been trying to create a report that will let me render fields from
one row of a table to different pages (i actually have a table with over 200
fields and need about 5 pages to print them all) ... i found the report
example below and it works except the last page of the last record won't
print ... i just cant find a way to make it ... can anyone PLEASE show me
how to make this report work and i will be eternally grateful.
>
|
|
|
|
|