tomsky
tomsky

Reputation: 545

Hide a column in cross-tab depending on the value of parameter (Crystal Reports XI)

I'm using Crystal Reports XI (R2) and have a cross-tab which displays information about flights. There is the 'Total' column' as well as the Arrivals and Departures columns which are created automatically thanks to the grouping condition. What I'm trying to do is to have the 'flight directions' parameter, where the user can select 'All, departures only or arrivals only' values and according to this selection the cross-tab would have one or two columns. How can this be achieved? I tried using the following formula(and have the suppress empty columns option enabled) :

if {?Pm-@flight_direction_description} = "Departures Only"
then
if ({Command_1.IsArrival} = 1)
then 0
else {Command_1.IsArrival}

which indeed works (only one column is displayed) but then under the Departures column it lists all the flights (so the departures column is the same as the Total column) whereas it should only display information about departing flights.

Upvotes: 0

Views: 3749

Answers (1)

I've had similar situations come up; while certainly not ideal, and if no one has any better suggestions, you could create Detail A, Detail B and Detail C sections, all of them suppressed. From there...

  • You could put your "All" crosstab in Detail A
  • Create a second crosstab for Destinations only, and put that in Detail B
  • Create a third crosstab for Arrivals only, and put that in Detail C

Then, in your Detail A, B and C sections, you can condtionally unsuppress the section you want based on the parameter passed in.

Upvotes: 1

Related Questions