|
-
Mar 20th, 2001, 05:58 PM
#1
Thread Starter
Junior Member
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?
Last edited by ezbie; Mar 20th, 2001 at 06:07 PM.
I am, because it's expected!
-
Mar 20th, 2001, 06:12 PM
#2
Hyperactive Member
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
"I'd rather have a full bottle in front of me than a full frontal lobotomy!"
-
Mar 20th, 2001, 06:20 PM
#3
Addicted Member
Try this:
Code:
Dim strT As String
strT="Some String"
Printer.CurrentX = (Printer.ScaleWidth - Len(strT)) / 2
Printer.Print strT
Printer.EndDoc
-
Mar 21st, 2001, 10:55 AM
#4
Thread Starter
Junior Member
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.
Last edited by ezbie; Mar 21st, 2001 at 10:59 AM.
I am, because it's expected!
-
Mar 21st, 2001, 11:19 AM
#5
Thread Starter
Junior Member
I set a text field = Len(strT) and it is returning 0
If strT = "Some String" shouldnt it return a value greater than 0?
I am, because it's expected!
-
Mar 21st, 2001, 07:19 PM
#6
Addicted Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|