PDA

Click to See Complete Forum and Search --> : [RESOLVED] Hiding report fields.


tommygrayson
Feb 16th, 2006, 09:45 PM
Hi guys!!!

I have a tough one here. How do you hide report fields?

I have a situation wherein the report should display these fields if the user selected option A.

Okay that's fine but what if the user selected option B and the report should display another set of fields.

Then create another report, that's good but what if the user selected both A and B at the same time and it should only display one report showing both sets of fields.

Did you guys get the problem?

brucevde
Feb 16th, 2006, 11:13 PM
Assuming you are using Crystal. What version do you have?

Every report object can be hidden by setting the Suppress option explicity or by using a Formula.

As long as the options are parameters you could add a formula to suppress the required fields. If the parameter is called OptionA and is a boolean, the formula would be

Not {?OptionA}

tommygrayson
Feb 16th, 2006, 11:44 PM
Assuming you are using Crystal. What version do you have?

Every report object can be hidden by setting the Suppress option explicity or by using a Formula.

As long as the options are parameters you could add a formula to suppress the required fields. If the parameter is called OptionA and is a boolean, the formula would be

Not {?OptionA}

Hey thanks, that hit it.

How do I relocate the field next to it?

Let's say I have Field A | Field B | Field C.

Field A has been hidden. How do I relocate Field B to Field A's position?

brucevde
Feb 17th, 2006, 12:22 AM
I have never tried to change the position of a field at runtime. I won't be able to try anything until tomorrow - I don't have Crystal at home. I don't suppose the Field's position has a formula button beside it like the Suppress option.

You could create duplicate Sections, one for each possible scenario and suppress the entire section instead of the individual fields.

Eg - Assuming you are using the Details Section and always want Field C displayed.

DetailsA Field A | Field B | Field C -> Suppress = Not ({?OptionA} And {?OptionB})
DetailsB Field A | Field C -> Suppress = If {?OptionA} And Not {?OptionB} Then False Else True
DetailsC Field B | Field C -> Suppress = If Not {?OptionA} And {?OptionB} Then False Else True
DetailsD Field C -> Suppress If Not {?OptionA} And Not {?OptionB} Then False Else True