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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a report

Status
Not open for further replies.

LHT

Technical User
Mar 19, 2004
7
0
0
US
Employing the following code to print a single page report always results in 2 pages being printed: the appropriate page plus a blank page. I'm using Paradox 10, Windows SE and XP Pro, a Brother 5040 and 5140 Laser printer. I can't figure out a work-around. Please help! Thank you.
LHT

method pushButton(var eventInfo Event)
var
q Query
strReportName String
r Report
roi ReportOpenInfo
rpi ReportPrintInfo
tv TableView

endVar
q.readFromFile("Daily Appointments.QBE")
q.executeQBE()

rpi.name = "DAILY PATIENT LIST2.rsl"
rpi.masterTable = ":pRIV:ANSWER.DB"
r.print(rpi)

endMethod
 
In the past not having fields large enough in design caused the extra page.

Try expanding the height of fields and see if that makes a difference. (Don't change the location of fields, just extend the height in their current location.

Additionally, grouping some fields and pinning the group has worked in other cases to get rid of that extra page.

Tony McGuire
 
Thank you for the very prompt reply. I'll try your suggestions tomorrow. In the meantime I changed the code so that the report is displayed and does not print until I go through the <file> <print> etc. process.
LHT
 
I had that same problem, but when I added the following code the extra page didn't print anymore.

rpi.panelOptions = PrintClipToWidth

I hope this helps you.

Amy
 
I have a similar problem whereby when I go to print a single a4 report on a Samsung ML4500 laser printer, the printer thinks I am printing something from the manual tray and I have to press a button on the printer for the page to actually print. It never did this until I upgraded the OS to WinXP.

Any suggestions?

Thanks,

Paul
 
Tony,

Thanks for the reply. the printer tray is set for A4 on automatic. As I said this has only happenned since moving to WinxP. I don't get the problem with other programs and it doesn't happen if I print the report directly when opening the report first.The code on the button is as follows:

method pushButton(var eventInfo Event)
var
rHandle Report ;// tmp handle to report
rpiHandle ReportPrintInfo ;// tmp handle to print info structure
tblName String
tblVar Table
rpi ReportPrintInfo ; parameters for the report
rpt Report ; the report itself
tc tCursor ; used to capture the current record
;obj UIObject
endVar
tblName="Cust2.db"
;obj.attach(Cust1)
tblVar.attach(tblName)
tblVar.empty()
dodefault
edit()
unlockrecord()
ExamDate = Today()

Postrecord()
endedit()

tc.attach(customer_No)
tc.setrange(Customer_No.Value, Customer_No.Value)
tc.instantiateView( ":pRIV:ANSWER" )

rpi.Name = "New Record Card.rsl"
rpi.MasterTable = ":pRIV:ANSWER"
rpi.panelOptions = PrintClipToWidth

rpt.print ( rpi )


movetorecno(1)
moveto(Customer_No)

;// Properties of the ReportPrintInfo can be viewed using the following
;// line of code:
;//
;rpiHandle.view()

;// Set name of report.
;//
; rpiHandle.name = "New Record Card.rsl"

;// Print the report
;//
; if NOT rHandle.print(rpiHandle) then
; msgStop("Error printing " + rpiHandle.name,
; "Please make sure the report exists and try again.")
; endIf

endMethod
Hope you can shed some light on the problem.

Many Thanks,

Paul Lewis
 
No light, but possibly a workaround.

Instead of directly printing, how about opening the report in code and then print? (Since you say it doesn't mess up if opened first.)

r.open(rpi)
; r.hide()
r.print()
r.close()

Does this methodology get around the A4 issue?

Tony McGuire
"It's not about having enough time. It's about priorities.
 
Tony,

Thanks, yes it does work, allthough a little inellegant. We have to print off 3 different reports for each clients appointment which are betwen 15 & 30 mins each, all through the day. There must be an easier way?

Thanks,

Paul Lewis
 
The only other thing I've tried that has worked to stop a second page from printing is to set the page to CENTIMETERS instead of INCHES.

You have to save and deliver the report, and when you next go into design the settings revert.

But this HAS stopped that extra page from printing, believe it or not (I didn't when I read it, but tried it from desperation).

Tony McGuire
"It's not about having enough time. It's about priorities.
 
Tony,

I have now cured the problem, I purchased a new printer!!

Works fine now.

Many thanks anyway.

Lewy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top