Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Right aligning report labels and fields at run time
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01189824
Message ID:
01190728
Vues:
21
Hi Cathy. Unfortunately labels don't have an alignment property. They are always left aligned, so they extend beyond the expected place because they are longer at runtime than at design time.

In the hope that there was an undocumented behavior, I modified a copy of the frx at runtime for labels with Offset = 1 (right aligned) but unfortunately that doesn't work.

The only thing that I have found to work is to move labels to the left an appropriate amount just before outputing the report. Doug Hennig has provided a class that calculates the exact length of a GDI+ string and you can figure the amount to move left from that, but it is too slow. A fast approximation would be perfect, though, if someone as one.

Alex

>What I am saying is that you have to set the alignment property to "Right" and then also visually align the right sides in the designer. If you do that, it should print out right-aligned on the actual paper. But if you don't set the alignment property to "right", even though they look right aligned in the designer, there's no guarantee you'll get right aligned on paper.
>
>
>
>>Thank you for the response, Cathy. There is no problem right aligning the fields.
>>
>>The problem is getting the labels' right end to appear in the same place as shown in the editor. One way the problem appears is when you want to make labels and fields that appear right aligned in the editor to also appear right aligned at runtime.
>>
>>A similar problem happens when you try to right align at runtime labels of different lengths that appear to be right aligned in the editor.
>>
>>Alex
>>
>>
>>>In the editor, select the fields that you want right-aligned and then select Format from the menu, then Text Alignment, then pick right alignment. That should make sure they really show up right-aligned on the printed output.
>>>
>>>Cathy
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform