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
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
>else
>field1.alignment=right
>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.