[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 430
  • Last Modified:

VB6 Printing a long form only prints the first page

I have a form which allows the user to add items in a list, thus extending the length of the form. The form prints ok when it fits on the printer page, but when it goes off the first page the printer just doesn't bother with the rest of the form.
I have tried changing the frompage and topage of the Common Dialog control but it still won't print.
I have been using the Form1.PrintForm method. Is there a better way, or something I am missing?
2 Solutions
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
(Potentially overly obvious comment)  
If your intent to print out what appears to the user in a form, then that would best be handled in a report, which is optimized for printing on paper, as opposed to a form which is optimized to be a user interface.
andy_maskellAuthor Commented:
Thanks for the quick response.
The form I want to print out is a stand alone VB application.
There is no report generation done through a database.
Much like jimhorn said, unless there is a need to print the user interface, i.e., if your real need is to print the information contained on the form or in the list box, then I would use the printer object and make a report.  this can be done from the application using the information on the screen; it does not need to be a "database report."
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

I think what Jimhorn is trying to tell you, is if you want to print the information, do that.
Don't print the form, it just takes extra space and does the user no good on paper.  In
other words, copy the data to something which stores text, and print the text.
andy_maskellAuthor Commented:
So I guess I'm going about it the wrong way.
Could anyone please tell me the best way to print the form info to a report, or point me towards a tutorial.
use the printer.print method to print to your default printer.
position on the paper by using the printer.CurrentX and printer.CurrentY properties
write a subroutine for the header (title, page number, column titles, etc) then call it before you print the actual lines of the report and when you are going to go off the end of the page (about 14000 for portrait, 9500 for landscape)
use printer.newpage to start a new page (but not the first page)
user printer.enddoc when done


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now