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!

PrintForm method doing odd things

Status
Not open for further replies.

Sypher2

Programmer
Oct 3, 2001
160
US
Hi all. Hope somebody can help me out with this, since it's got me stumped.

I have an application that get data from a database, put the data in various label captions on 2 forms, and the forms are printed with the form.printform method. The 2 forms are only loaded and NOT shown. The forms print nicely here at home. My monitor is set at 1024x768. I'm printing on an HP Deskjet 648c.

Ok, I take the app to work. There the monitors are set at 800x600. We use HP Laserjet 4 Plus. Most of these laser printers have 2 megs of memory. I get a little over half the forms when we try to print. A couple of the printers have 12 megs of memory. On those we get about 3/4 of the total form.

I've read some old posts about this same problem, but there seems to be no solution. Does anyone know why this would be happening? Thanks.
 
Sypher2,
Add the commondialog control to your form(s). I normally add print menu option to my applications and use the below listed code snippet to print forms (hasn't failed me yet).

Private Sub mnuPrint_Click()
On Error GoTo CancelError
Dim iNum As Integer
With CommonDialog1
.CancelError = True
.Flags = &H2 Or &H0 Or &H1
.PrinterDefault = True
.ShowPrinter
For iNum = 1 To .Copies
PrintForm
Next iNum
End With

CancelError:
Exit Sub
End Sub

reidfl
 
It's still cutting off the bottom. It's happening on my home printer as well. The problem seems to be that the form (which is 8.5 x 11 inches in size) is too big for the monitor screen. The window somehow gets resized and the bottom portion is being cut off. Is there any way to reduce the size of the form on screen yet still print on an 8.5 x 11 piece of paper?
 
Sypher2,
I was reviewing solutions for the same problem with printform as yours. I am using a MDI form to display the form which I also print on an 8 1/2 X 11 page. While I was working on the program in visual basic I was able to make the printform work every time, I could scroll the entire page on the screen. I After I compiled to an executable it would drop the bottom 2 1/2 inches of the form. I also noticed that I could not display the same 2 1/2 inches on the screen. For the form I wanted to print, I played with some of the form options for clipcontrols, controlbox, autoredraw, and etc., I use borderstyle zero. I'm not sure what caused it to work when I compiled the code but the entire page prints and I can view the page on the screen.


Loren Moore
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top