Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programaticaly alignment of report field
Message
De
24/12/2004 05:48:45
 
 
À
24/12/2004 05:16:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
00972003
Message ID:
00972008
Vues:
19
Tariq

Don't know how to do that but I have an idea. If you're using an SQL cursor for your report source you could have 2 target fields in the cursor for your "field1". You could use IIF( LEN( Field1,,) to decide which to populate in your select statement. So different recs in your cursor would have one or the other field filled, depending on its length.

On the report you could have both target fields, superimposed in the same position, one left- and the other centre-justified. Only one of them will be filled for each of your rows. The SQL below works as I have tried it.

e.g.
Select x, y, z, IIF( LEN( ALLTRIM( field1)) < 30, Field1, SPACE(29) as ThinField, ;
                IIF( LEN( ALLTRIM( field1)) >= 30, Field1, SPACE(100) as FatField ;
into cursor csrPrintCsr
* NOTE the SPACE(100) should be SPACE( < max width of your field1 >)
Ta-Da!

Terry

>Dear Experts
>
>There is a character type field on report.
>I want to alignment that field with following conditions
>
>assume that "field1" is report field
>
>
>IF LEN(ALLTRIM(field1))<30
>field1.alignment=center && center justify
>else
>field1.alignment=right && right justify
>endif
>
>
>Is it possible, if yes then please help me.
>
>Thanks in advance
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform