Results 1 to 6 of 6

Thread: Print Method

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    31
    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!

  2. #2
    Hyperactive Member
    Join Date
    Mar 2001
    Location
    Calgary, Canada
    Posts
    453
    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!"

  3. #3
    Addicted Member
    Join Date
    Aug 2000
    Location
    Croatia
    Posts
    200
    Try this:

    Code:
    Dim strT As String
    
    strT="Some String"
    
    Printer.CurrentX = (Printer.ScaleWidth - Len(strT)) / 2
    Printer.Print strT
    Printer.EndDoc

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    31
    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!

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    31
    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!

  6. #6
    Addicted Member
    Join Date
    Aug 2000
    Location
    Croatia
    Posts
    200
    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
  •  



Click Here to Expand Forum to Full Width