Re: Printing Problem HELP?!!
Set the font you want to print in a fixed-width font in which each character is the same width.
Add the bold line into your code and you should be fine:
Code:
.....
y(19) = 647.9225
Printer.FontName = "Lucida Console"
For J = 1 To 2
......
Re: Printing Problem HELP?!!
In addition, if you want the fields to be the same total width as your header fields, add spaces for padding. Add String(n, " ") where n = the number of spaces you need for padding. See code in bold below:
Code:
Printer.FontName = "Lucida Console"
For J = 1 To 2
Printer.Print " HA Load on Lane No."; J
Printer.Print " | Beam No. | Distribution Coeff. | L.L.Moment |"
Printer.Print " ----------- --------------------- -------------"
For I = 1 To 19
Printer.Print " | " & Format$(I, "00" & String(6, " ")) & " | " & Format$(x(I), "000.0000" & String(11, " ") & ";-00.0000" & String(11, " ")) & " | " + Format$(y(I), "000.000" & String(3, " ") & ";-00.000" & String(3, " ")) & " | "
Next I
Next J
Printer.EndDoc
If you want to align the fields right, simply add the spaces in front of the values and if you want it centered, add half front and half after.
They might be a more propper way to align them but the result is looking good too using string(n, " ").
Re: Printing Problem HELP?!!
you can also use printer.currentX to set the position on a line
if you put a ; at the end of a print statement, the next print will be on the same line
vb Code:
printer.print " | " + Format$(I, "00") ;
printer.currentX = 250
printer.print "| " + Format$(x(I), "000.0000;-00.0000") ;
printer.currentx = 550
printer.print " | " + Format$(y(I), "000.000;-00.000") + " | "
the above should all print on the same line with columns set by the value of currentX
i did not test this, so they may overprint , just increase (or decrease) the values for currentX, as required