General information
Category:
Reports & Report designer
Environment versions
Network:
Windows 2008 Server
>I have a customer that just made a request that tickled me a little bit, but
>a customer is always right, lol. She wants the verbage that is printed on
>a report to start each line at the same position. That's no problem at all
>obviously. But she wants the right side to end on the same position too.
>
>If there is anyway to do this, I would appreciate the help. I'm hoping its
>as easy as changing the font I'm using. I know Courier New would
>probably do it if every line had the exact same number of characters, but
>that is not the case.
>
This is one of those things I remember having an exercise in a programming class a million years ago. With a fixed-width font, you can write the code to justify. The algorithm is something like:
- determine # of chars you want per line
- break your string up into substrings of no more than that width, that is, lines
- for each line, find the word breaks and add spaces to them until the line is exactly the right width
The third step is the challenging one because you want to distribute the extra blanks in a way that's pleasing to the eye.
Tamar
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only