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

User Selected Columns 1

Status
Not open for further replies.

v45

Technical User
Sep 19, 2002
10
US
I'm trying to do a report that will allow the user to select the columns they want to see in the report. For example, out of 20 fields in the table, the user can select 6 to be listed. I've created parameters for each of the fields, but can seem to find a way to get them to display after the first column.

Any ideas would be helpful.

thanks.

 
You have to think backwards. If your paramters are simple boolean parameters, you can do the following:

Place your eight fields in the report. Use the "suppress" property in the format dialog box to suppress if the relevant paramter is true. Of course, the fields will be placed all over the page.

If you want them to appear next to each other, you will have stack the fields on top of each other and then use complex logic to suppress all but the one you want.

It can be done, but it is very messy. You are pushing the Crystal envelope. Howard Hammerman,
Editor and Publisher of Database Reporting Made Easy newsletter
howard@hammerman.com
800-783-2269
 
Another approach is to write 6 formulas that are something like:

If {?param_1} = "Name" than {Cust.Name} else
ir {?param_1} = "City" than {Cust.City} else ...

And place these formulas on the report.
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top