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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Columns

Status
Not open for further replies.

JKW777

MIS
May 22, 2003
4
US
Crystal v10
SQL2000

I need to create a report in which the data returned is based on up to seven parameters selected. If a specific value for a param is selected, the results for that param should appear in a column on the report, while those params that do not have a specified value selected (default to ALL) do not appear on the report. So, if 3 of the params are selected, the report should look like this:

Header {?param1} {?param2} {?param3} Amount
Details xyz abc fgh $$$

If two params are selected, the results should be:

Header {?param1} {?param2} Amount
Details xyz abc $$$

I don't want gaps between the columns if a param is not used, and I can't use a cross tab because I need drilldown.
Any ideas how this can be done in Crystal?

Thanks.


 
When you say a param should be shown, do ytou mean to say that the data thatis based on the parameter, or the value of the parameter entered?

Technical information is generally better than text descriptions:

Crystal version
Database/connectivity used
Example data
Expected output

To create conditional columns, you have options, but you must convey requirements accurately.

A cross-tab with filtering (Report->Edit Record Selection->Formula) will automatically filter only the rows required and might suit you.

Or you might use conditional formulas to get the desired results, as in the following which displays the parameter per your request:

column1:
If {?parm1} <> "All" then
{?parm1}
else
If {?parm2} <> "All" then
{?parm2}
else
If {?parm3} <> "All" then
{?parm3}
else
{table.amount}

Then you can conditionally check each of the values for the other columns as well.

hopefully this helps, otherwise please post specifics.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top