472,096 Members | 2,284 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,096 software developers and data experts.

Print lines on an invoice

lee123
556 512MB
hey ( killer42 ) hi there, im programing in vb 6 and i want to make lines on a invoice i created in vb6 but don't know how i would go about doing that.. i have everything layed out to print (codes) but no lines to separate the orders from one another, it doesn't look good the way it is i would like the lines in there as well

lee123
Jul 28 '07 #1
7 4632
Killer42
8,435 Expert 8TB
hey ( killer42 ) hi there, im programing in vb 6 and i want to make lines on a invoice i created in vb6 but don't know how i would go about doing that.. i have everything layed out to print (codes) but no lines to separate the orders from one another, it doesn't look good the way it is i would like the lines in there as well
How are you printing the invoice? If you're using the Printer object, you should be able to draw the lines using the .Line method.
Jul 29 '07 #2
lee123
556 512MB
hello killer42 im sorry about the anouncement to you but your very smart i like dealing with you, im not saying the others aren't you dealt with me several times in the past. anyway i have a button on the form with alot of code behind it to print because lets face it this is a whole different world then access i guess i don't understand the question is the printer object something you type in the code like (printer.print) or is it in the tools
Jul 29 '07 #3
lee123
556 512MB
well i know there is the "y" and the "x" thing how do you write the code for it.
Jul 29 '07 #4
Killer42
8,435 Expert 8TB
well i know there is the "y" and the "x" thing how do you write the code for it.
I think it might be simpler if you could show me how you're doing the printing now.

The Printer object just provides a relatively simple way to deal with the printer(s) available to your system. I do recommend using it if possible, but don't know whether it will make any major difference until I see what you're already doing. For that matter, I'm no expert in printing anyway - I rarely use it in VB, mostly just working with the screen and files.

Oh, by the way - if you're referring to the change in the title of the thread, it's no problem. I'm required to do that anyway. The site guidelines state that the title is supposed to be a simple statement reflecting what the question is about, and as Moderators we're supposed to enforce that, by changing the title if necessary. Otherwise the forum fills up with threads about subjects like "Plz help!!!!" and "VB". These are not a lot of use for searching purposes.
Jul 30 '07 #5
lee123
556 512MB
well thats no problem i can do that.

the button for print:

Expand|Select|Wrap|Line Numbers
  1. Printer.CurrentY = 1300   'THIS IS FOR THE NAME OF COMPANY
  2.   Printer.Print Spc(35); (Label1)
  3.   Printer.CurrentY = 1700   'THIS IS FOR THE ADDRESS
  4.   Printer.Print Spc(35); (Label2)
  5.   Printer.CurrentY = 2100   'THIS IS FOR THE CITY,STATE,ZIP
  6.   Printer.Print Spc(35); (ADDRESS)
  7.   Printer.CurrentY = 2500   'THIS IS FOR THE PHONE #
  8.   Printer.Print Spc(35); (Label3)
  9.  
  10.   Printer.CurrentY = 1300   'THIS IS FOR THE LABEL "P.O.#"  & "INVOICE #"
  11.   Printer.Print Spc(7); ("P.O #"); Tab(6); (Label5)
  12.  
  13.   Printer.CurrentY = 1300   'THIS IS FOR TH LABELS "PAID BY"  &  "PAYMENT"
  14.   Printer.Print Spc(75); ("PAID BY"); Tab(76); (PAYMENT)
  15.  
  16.   Printer.CurrentY = 3500   'THIS IS THE HEADINGS FOR THE ORDER
  17.   Printer.Print Spc(11); ("QTY"); Spc(7); ("PRODUCT"); Spc(15); ("UNITPRICE"); Spc(6); ("TOTAL")
  18.  
  19.  
  20.  
  21.   Printer.CurrentY = 4000    'THIS IS LINE (1)
  22.   Printer.Print Spc(12); (Text1); Tab(24); (Text2)
  23.   Printer.CurrentY = 4000
  24.   Printer.Print Spc(53); (Text3); Tab(69); (TOTAL1)
  25.  
  26.  
  27.   Printer.CurrentY = 4500    'THIS IS LINE (2)
  28.   Printer.Print Spc(12); (Text4); Tab(24); (Text5)
  29.   Printer.CurrentY = 4500
  30.   Printer.Print Spc(53); (Text6); Tab(69); (TOTAL2)
this is only part of what i got the lines i want is suppose to be under the headings "qty" , "product", "unitprice" ,'total" i don't know if i did this right but it works. thanks i know why you changed the title that was to get your attention(sorry) i understand but see what you can do with this code.

lee123
Jul 30 '07 #6
Killer42
8,435 Expert 8TB
Ah, so you're already using the Printer object. Excellent! Sometimes people open the LPT port and send printer-specific codes, and stuff like that - I think it makes things much harder.

In this case, to draw a line you could just do something like...
Expand|Select|Wrap|Line Numbers
  1. Printer.Line (0, 4000) - (3000, 4000)
Of course, you may need to set some properties first, such as DrawMode, ForeColor, that sort of thing. It works much the same as drawing on a form or picturebox.

Depending on the exact outcome you're looking for, it may help to know that you could just run on the FontUnderline property before printing a label, to get a line under it.
Jul 30 '07 #7
lee123
556 512MB
thanks i'll give that a try, you know instead of using text boxes for all the orders i have just discovered the datagrid but dont know how that works it probably would of made a shorter code mayby you can tell me how to use this for future projects because i tried but can figure out this. is it for already built databases like for (access)? anyway i'll try the print.line and see how it works

lee123
Jul 30 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

10 posts views Thread by PC Datasheet | last post: by
3 posts views Thread by Guoqi Zheng | last post: by
2 posts views Thread by EnjoyNews | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.