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

How to move a group of columns dynamically?

Status
Not open for further replies.

Videla

Programmer
Jul 28, 2005
98
US
GParker,
Thanks for quick turn around. I have a crystal report showing 20 columns. My requirement is: Based on my Input parameter, Column1 would be suppressed or displayed. if it is suppressed then "there should not be any blank space in that column1" instead of that column2 to column 20 should be repositioned ie move towards left position. Also if column is visible then also the other columns should be repositioned. I hope this would be clear for you.

 
I would likelhy approach this on the database side using an SP due to Crystal's nature (it doesn't handle this very elegantly), but it can be done within Crystal a few different ways.

Now if you're only saying that ONLY column 1 might be suppressed, then right click the details and select insert section below, lassoo all of the objects in details Aand hit Ctrl-C (copy), Then select Ctrl-V (paste) and place the fields in Details B.

Delete column 1 in details B and shift the data over to the left.

Right click Details A and select format section->X 2 next to suppress and place code akin to:

not({?MyParm} = "No column 1")

then go into the same formula for Details B and place:

{?MyParm} = "No column 1"

Another means would be to create 20 formulas, and then based on the users selections, fill an array with the data and then each formula would be something like:

This would require converting all data types to string.

-k
 
Hi Everyone,

I've created similar reports and have had great luck using crystal's cross tab functionality. Cross tabs allow you to create dynamic columns within your report, based on any field or formula within the report. The columns will adjust accordingly.

Simply go to insert-> cross tab ->the cross tab expert will open, where you can define:

row definitions,
column definitions,
summary fields.

It's almost like creating a report with an x and y axis.

Best of luck!

-sb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top