print formatting & fonts

awf56

New Member
I have been given the task of outputting a client bill from Progress in Times New Roman. Not a problem for the text (using HP contro codes). But each line of data has some test, then two number columns.

I have yet to figure out how to get the numbers to line up properly, without resorting to courier font.

Any suggestions, or code samples?
 

Angie

New Member
Please Help!

Firstly my apologies I know this is a discussion forum but I thought you may be able to help.
I am looking for Programmers for a company in West Yorkshire with at least 6 months working with character version of Progress 4GL. The role is to develop software for high profile Global Clients.
As I mentioned before my apologies for butting in..but I thought if
anyone could help, you guys would be able to.
If anyone is interested please contact me via progresscvs@hotmail.com
Thank you again for your time.
Regards
Angie
:)
 

dkellgren

Member
Angie -

Do you HAVE to use Times New Roman? Can you change just the line items to a fixed width font (like Courier New) and leave the rest in the nicer font?

Are you using code/report builder/Actuate?

-Dan
Aim
 

awf56

New Member
fonts

Here's the deal: the reports used to be in courier. The client hates it. So I made the text Times New Roman, but left the number columns fixed font. They still hate it. They insist the ENTIRE document be Times New Roman.

I'm struggling with making the numbers line up. The last ditch option would be to make it RTF and setup a table, with each column explicitly right or left justified. But this would be a massive effort.

I'm trying to make the right-aligned clause of the AT phrase to work, but can't get a clean compile. I also tried control codes to poition the currsor/printer near the right margin, then print from right to left; still couldn't achieve right justification.

Any ideas?
 

awf56

New Member
fonts

forgot to mention- I'm doing this in the Procedure Editor (I can switch to UIB if necessary). Don't have access to Report Builder or Actuate.
 

dkellgren

Member
Sorry - can't think of a decent solution for that one. We use Report Builder and there are some ways there, but in code.... don't know.

Have you looked at any other "fixed width" fonts? Do a quick web search and you'll find a bunch. Maybe you can find one the client can live with.

Sorry!
Dan
 
This might work, but it could also be very slow. It only works for Graphical Interfaces.

Take the string you want to print.

Keep adding spaces to the end of the string, until it is the desired width for the column it is to appear in.

You can test this using
FONT-TABLE:GET-TEXT-WIDTH-PIXEL(string[,font])

There is also a GET-TEXT-WIDTH-CHARS attribute.

e.g. for 100 char width column -
DO WHILE FONT-TABLE:GET-TEXT-WIDTH-CHARS(cString,ifont) < 100:
cString = cString + " ".
END.

Output this string with the trailing spaces to your printer.

Check your language reference manual for more info.
 
If the above works you could speed it up as follows:

Do this once:-
ASSIGN rSpace = GET-TEXT-WIDTH-CHARS(" ",iFont).

Do this for each string (e.g. to get 100 char width):-
ASSIGN rFillChars = 100 - GET-TEXT-WIDTH-CHARS(cString,iFont)
iFillSpaces = INT(rFillChars / rSpace)
cString = cString + FILL(" ",iFillSpaces).
 
Top