Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field Justfication 1

Status
Not open for further replies.

tickko

Programmer
Dec 12, 2002
25
0
0
US
hi...i'm looking for a way to justify a field according to another fields value.

if a field {justification field} = LJ then another field will be "left justified".

is there anyway to write a formula to set a field justification according to that justification field? i'm fairly new to the crystal syntax...thanks for any help!

j
 
Bummer. CR 9 has a conditional formula for this item in the format menu.

One approach, although there may be a simpler approach, is to place the same object multiple times on the report in the same location, once of each justification option you want (this is really annoying for report maintenance, by the way). Then under the format menu for the object (right-click on the object and choose Format) look on the common tab and click on the X+2 button to the right of the Suppress checkbox. In the formula editor, enter a formula similar to:

{justification field} <> &quot;LJ&quot;

Save the formula and click ok.

This will cause the field to be suppressed whenever the field value of {justification field} is not &quot;LJ&quot;. Write a similar formula in the conditional suppression formula for the other object(s) that have different justifications. For example, if you only want two different justifications, you'd have two fields on the report, one formatted with the above conditional formula and the other with it's opposite:

{justification field} = &quot;LJ&quot;

You can accomplish the same thing with multiple sections and conditionally suppressing sections, but depending on the layout of your report, using multiple sections may require as much or more extra maintenance work down the road.
 
CR 8.5 does this, Right click the field->Common->X 2 next to Horizontal Alignment:

Values for Crystal Syntax

//crLeftAligned
//crDefaultHorAligned
//crCenteredHorizontally
//crRightAligned
//crJustified

So:

if {table.field} = &quot;LJ&quot; then
crLeftAligned
else
crRightAligned

is an example.

-k
 
thats exactly what i was looking for...thank you for your help!

is there some type of points system (awarded) within this forum?

j
 
You can mark the someones post as helpful and that awards that user a star. There is a link within each individual post that says &quot;Mark this post as a helpful/expert post!&quot;. It is helpful other users as well, as they can identify posts that other users marked as helpful.

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top