Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

right align columns in a printout

Posted on 2002-04-23
7
Medium Priority
?
224 Views
Last Modified: 2011-10-03
I have created some printouts for a client of mine and I'd like to right align some of the output in the columns.

How would I do this? With some sort of formatting? Could someone provide a very simple example?

Thanks much in advance.
0
Comment
Question by:samic400
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6962404
Before any answer can be suggested, we MUST know how and what do you print?
CHeers
0
 
LVL 2

Accepted Solution

by:
corvanderlinden earned 200 total points
ID: 6962435
You could use

format("ww", "@@@@@@@@") -> '      ww'
format(123 , "@@@@@@@@") -> '     123'
 
0
 
LVL 2

Expert Comment

by:corvanderlinden
ID: 6962440
Or
right$("       " & "ww", 7)
the number of spaces equals 7
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 13

Author Comment

by:samic400
ID: 6962455
It will be integers,dollars or percentages. I'd like it look like so -

test          7
test2        12
test3       450

or

test        12.35
test2        1.23
test3      332.78
0
 
LVL 13

Author Comment

by:samic400
ID: 6962456
didn't come out the way I typed it, but angelIII I think you get the idea now, right?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6962494
I think corvanderlinden's suggestion are fine, as long as the font has a equal width for all the caracters. If not, you will eventually need an function that determines the width of the text using a particular font, and then you can determine it's absolute position...

What i wanted to know it rather how you are printing (using your own print commands, using form.print, "printing" to a textbox, printing using MSWord etc).
Depending on this, the answer might differ.

CHeers
0
 
LVL 13

Author Comment

by:samic400
ID: 6962510
Thanks for the input too AngelIII. I should have said that I'm using the printer.print command.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question