-
Is there a way to truly center text using the print method. The only way I know to do it woul be to use
Printer.CurrentX =
But this only indents it it does not center it.
Also, Some lines are printing off the page. How can I have the text wrap?
Anyone have any reconmendations on getting output to a printer. What I am doing is pulling infomation from a database and sending it to a printer. I would prefer to have everything nicely formatted. I realize this is probally going to be kinda difficult for my skill level but how else am I gonna learn?
Anyone have any sugestions?
-
Did you get a copy of Crystal Reports with your version of VB?
If so, have a look at it. It allows you to format print-out pages, and then populate them from a database.
I'm not sure if it only ships with the Professional and Enterprise version though.
Apart from that, trying to format a print out from with VB is a pain in the butt.
I hope that is of some help,
SD
-
Try this:
Code:
Dim strT As String
strT="Some String"
Printer.CurrentX = (Printer.ScaleWidth - Len(strT)) / 2
Printer.Print strT
Printer.EndDoc
-
That starts text in the center of the page. I need the center of the text string to be at the center of the page.
It doesnt act like it is adjusting for the Len(strT)
I have tried playing around with just Len(strT) and I dont get any kind of change in orentation.
-
I set a text field = Len(strT) and it is returning 0
If strT = "Some String" shouldnt it return a value greater than 0?
-
My mistake :)
Here's the correct code:
Code:
Dim strT As String
strT="Some String"
Printer.CurrentX = (Printer.ScaleWidth - Printer.TextWidth(strT)) / 2
Printer.Print strT
Printer.EndDoc