WillatSA
asked on
Printing Problem using VB
Hi, guys,
What I need to do is like a check printing job, i want to pull out information from database, then fill those information into some type of format, then print it with specified check papers, which is 3 checks per page.
I try to use the scanned check as the background image of the VB Form to make those line aligning and formating issues much easier. The problem is, the largest height of a Form is 12288, which is smaller than a letter size paper.
when i use the Form1.PrintForm method, it can't fit the letter size paper.
Can i increase the height of a Form, or is there other way to print a well-organized page from a Form?
I tried some other ways also:
1. I tried to output all infomation into a plain text file, then print it. The problem is then i can't insert a picture of company logo in the text file, and the formating is really a pain.
2. I tried to use the Printer object, which is like:
Printer.Font = "Arial"
Printer.FontSize = 10
Printer.Print Tab(10); "a"; Tab(30); "b"; Tab(50); "c"
Printer.EndDoc
This allows me not worry about the height of a form, nor the picture printing issue. However, it gave me a real hard time to align the info to the pre-specified column, it might print on the lines, not above it.
Anyway to have better control on Printer object? For example, specify the line spacing?
3. I saw there is an example in MSDN network called "Tip 100: Printing a Form Multiple Times on One Page"
the link is as follows
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvbtips/html/msdn_msdn100.asp
I feel like it's the solution for me, cause i need to print 3 checks a page. Unfortunately, even I copied the code and followed the instructions, the program ended up with "Run-time Error '6': Overflow" at the line of
"X = SetStretchBltMode(Form2.hD C, 3)", which i have no idea what is that all about.
Sorry for this long question. Hope this beginner question won't take too much of your time. I just tried any possible way to get my work done. Any help, any approach will be a big help to me.
Thanks!!
Will
What I need to do is like a check printing job, i want to pull out information from database, then fill those information into some type of format, then print it with specified check papers, which is 3 checks per page.
I try to use the scanned check as the background image of the VB Form to make those line aligning and formating issues much easier. The problem is, the largest height of a Form is 12288, which is smaller than a letter size paper.
when i use the Form1.PrintForm method, it can't fit the letter size paper.
Can i increase the height of a Form, or is there other way to print a well-organized page from a Form?
I tried some other ways also:
1. I tried to output all infomation into a plain text file, then print it. The problem is then i can't insert a picture of company logo in the text file, and the formating is really a pain.
2. I tried to use the Printer object, which is like:
Printer.Font = "Arial"
Printer.FontSize = 10
Printer.Print Tab(10); "a"; Tab(30); "b"; Tab(50); "c"
Printer.EndDoc
This allows me not worry about the height of a form, nor the picture printing issue. However, it gave me a real hard time to align the info to the pre-specified column, it might print on the lines, not above it.
Anyway to have better control on Printer object? For example, specify the line spacing?
3. I saw there is an example in MSDN network called "Tip 100: Printing a Form Multiple Times on One Page"
the link is as follows
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvbtips/html/msdn_msdn100.asp
I feel like it's the solution for me, cause i need to print 3 checks a page. Unfortunately, even I copied the code and followed the instructions, the program ended up with "Run-time Error '6': Overflow" at the line of
"X = SetStretchBltMode(Form2.hD
Sorry for this long question. Hope this beginner question won't take too much of your time. I just tried any possible way to get my work done. Any help, any approach will be a big help to me.
Thanks!!
Will
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It should be a simple matter to layout the check on the page using VB's printer object (i.e. Printer.CurrentX, Printer.CurrentY, Printer.Print, etc.).
ASKER
thanks, i am now working with the printer object... though it's really a print-and-error process.
WillatSA:
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
Experts: Post your closing recommendations! Who deserves points here?
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
Experts: Post your closing recommendations! Who deserves points here?