|
-
May 17th, 2008, 06:03 AM
#1
Thread Starter
Junior Member
Aligning text using Printer.print
Good day
I would like to write a code which will aprropriately align text under each heading. For example I have columns Name, Surname and Comments, when the text is long it is not correctly aligned. The program prints a report with user names and their comments. This is the code I have :
Printer.Print "Author"; Spc(30); "Name"; Spc(30); "Notes" - print headings and underline them
Printer.Print "---------"; Spc(30); "--------"; Spc(30); "--------"
For i = 1 To mLngNumOfNotes
' Print Notes
Printer.Print Name(i); Spc(28); Surname(i); Spc(15); Comment(i)
Printer.Print 'Print empty line
Next i
Thank you
-
May 17th, 2008, 08:25 AM
#2
New Member
Re: Aligning text using Printer.print
I have used the following to allign currency
tmpL=len(stringX)
printer.print tab(100-tmpL);stringX
usually works quite well.
Maybe someone will give a better work around.
-
May 17th, 2008, 09:43 AM
#3
Re: Aligning text using Printer.print
If you want real alignment you must print by setting the .CurrentX and .CurrentY.
Then you also have access to Printer.TextWidth() that will tell you how "large" something is so you can do real left and right alignment of your print.
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
|