Justify text in a report !! (I try again) 
Author Message
 Justify text in a report !! (I try again)

Hi everybody !

        I want to know any function to justify some text in a report, i mean,
i want to wrte 6 or 7 lines of text in a report justify like newspaper

        I know i can put the text at the right, left or centered, but i want
to justify the text at the both margins.

Thank you ( I am sorry but my english is not as well as i want)

           /|\

  -----oOO-(_)-OOo----------------------------------------------------------
  Jorge garcia



Sat, 20 Mar 1999 03:00:00 GMT  
 Justify text in a report !! (I try again)

Quote:

>Hi everybody !
>    I want to know any function to justify some text in a report, i mean,
>i want to wrte 6 or 7 lines of text in a report justify like newspaper
>    I know i can put the text at the right, left or centered, but i want
>to justify the text at the both margins.
>Thank you ( I am sorry but my english is not as well as i want)
>           /|\

>  -----oOO-(_)-OOo----------------------------------------------------------
>  Jorge garcia


I would suggest embedding a Word document. That is the only (and
easiest) way I can think of doing it.  (The only other way would be if
somebody had an .OCX that would do it.)

- Ben Seymour



Sat, 20 Mar 1999 03:00:00 GMT  
 Justify text in a report !! (I try again)

Quote:

> Hi everybody !

>         I want to know any function to justify some text in a report, i mean,
> i want to wrte 6 or 7 lines of text in a report justify like newspaper

>         I know i can put the text at the right, left or centered, but i want
> to justify the text at the both margins.

> Thank you ( I am sorry but my english is not as well as i want)

>            /|\

>   -----oOO-(_)-OOo----------------------------------------------------------
>   Jorge garcia


Hola Jorge,
                ya es la segunda vez que veo tu mensaje, asi que me decido a
escribirte unas lineas aunque no estoy muy seguro de darte una buena
solucion.

Lo unico que se me ocurre que pueda funcionar es que crees una funcion
en Access Basic a la que le pases como argumento el texto a justificar y
la longitud de linea. De salida te tendr que dar las lineas con
espacios repartidos equitativamente entre los huecos de las palabras.
Despues, necesitaras definir un tipo de letra NO proporcional ( courier,
... ) para que te lo presente correctamente en el campo de salida.

Saludos
--
Jose Femenias Canuelo
CIO. Muebles Hermida
http://www.hermida.com



Tue, 23 Mar 1999 03:00:00 GMT  
 Justify text in a report !! (I try again)

Hi everybody !

        I want to know any function to justify some text in a report, i mean,
i want to wrte 6 or 7 lines of text in a report justify like newspaper

        I know i can put the text at the right, left or centered, but i want
to justify the text at the both margins.

Thank you ( I am sorry but my english is not as well as i want)

           /|\

  -----oOO-(_)-OOo----------------------------------------------------------
  Jorge garcia



Wed, 24 Mar 1999 03:00:00 GMT  
 Justify text in a report !! (I try again)

Quote:

> Hi everybody !

>         I want to know any function to justify some text in a report, i mean,
> i want to wrte 6 or 7 lines of text in a report justify like newspaper

I do not know of any 3rd party control for you, however you can do that yourself,
using a picture box or the printer object.  It wont be fast, but if you have no
other choice....

If you know how wide each line should be, you can use the TextWidth property to
see how many words it will take to fill up the line.  If you have space left to
fill, you can divide it up between the words, based on any rule you choose.  If you
want to add spaces between the words, or between each letter, it is your choice.

1. Find the difference between your line width, and the desired width in Twips.
2. Count the spaces (add between words) or the number of characters (add between
   letters) and divide the Twips value by the count.
3. For each space (add between words) or character (add between letters) move the
   CurrentX postion to the right by the number calculated in step two.

          Add         between         words         SAMPLE         TEXT

          A d d   b e t w e e n   l e t t e r s   S A M P L E   T E X T

Simply print each word, or character, then reposition the cursor, and print the next
word or letter....



Wed, 24 Mar 1999 03:00:00 GMT  
 Justify text in a report !! (I try again)

Quote:

>Hi everybody !

>    I want to know any function to justify some text in a report, i mean,
>i want to wrte 6 or 7 lines of text in a report justify like newspaper

>    I know i can put the text at the right, left or centered, but i want
>to justify the text at the both margins.

This is "kerning". There may be a way to do this in the Windows API, but that
won't help in VB. Here's what you need to do:

 Calculate width of column
 Calculate width of text to write (use TextLength method of form).
 Get difference between widths, and divide that by the number of characters
in the string.
 For each character, set the CurrentX and CurrentY properties and Print each
character.

You need to adjust the CurrentY property by the result of the third step. If
the division produces a remainder, you'll have to use that to complete the
adjustment.

That sounds like a lot of work, but you might find it worth the time.

Hope this helps,



Thu, 25 Mar 1999 03:00:00 GMT  
 Justify text in a report !! (I try again)

Take a look at the drawtext API function....

  >>
  >> Hi everybody !
  >>
  >>         I want to know any function to justify some text in a
report, i mean,
  >> i want to wrte 6 or 7 lines of text in a report justify like
newspaper
  >>

  >I do not know of any 3rd party control for you, however you can do
that yourself,
  >using a picture box or the printer object.  It wont be fast, but if



Tue, 30 Mar 1999 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Justify text in a report !! (I try again)

2. Trying again - Rich Text Box assistance needed ..

3. fully justifying text on a report

4. Need HELP to justify text alignment for a report in access 97

5. How to FULL JUSTIFY TEXT of a MEMO FIELD in access reports

6. Justify text in a report !!

7. Justify text in a report !!

8. Printing justified text without Crystal Reports

9. How to FULL JUSTIFY TEXT of a MEMO Field in Access 97 reports or VBA

10. How to FULL JUSTIFY TEXT in a control of a report ACCESS 97

11. Justify Text in a Rich Text Control

12. Justify text on Rich Text Box

 

 
Powered by phpBB® Forum Software