Cross Tab Report- Suprressing unwanted columns

Printed From: Crystal Reports Book — Forum Name: Technical Questions

I created a cross tab report to summarize laboratory data. Once the data is pulled there are some result columns that are not needed. Is there a formula or some way to suppress only certain columns so they do not print out on the report. Any help would be appreciated. Thanks.
You will have to build this into your record selection formula to filter out the data that you don't want printed. There is no way to disable columns from a cross-tab object.
Brian is quite right in saying there is no way to remove them.  I haven't found a way of suppressing the column as such.  Filtering removes the data which may give you incorrect totals.

However, it is possible to 'suppress' the data for the given column.  The column gap will still be there but the data will not appear. To do this:
1) Open the Cross tab expert.
2) Go to the Custom Styles tab
3) In the Columns box, select the column you are interested in
4) Below the Columns panel is a box labelled 'Alias For Formulas'. You MUST give this a name (not the field name) For example BoardingDate. Anything will do; this is the 'variable' name you will use in the suppression formula later
5) Close the expert
6) Select the Column Header in the cross tab design (or preview). Right Click and select 'Format Field...'
7) In the Common tab, click the Conditional Format button.
8) In the editor select from the Functions Tab 'Formatting Functions' and find CurrentFieldValue. Place this in the editor.  To Suppress for example 'Others' complete the statement with
CurrentFieldValue like 'Other*'
Save and Close
9) For each summary field that you have in that column, and the total,
a) select the summary field, Right Click, select Format Fields and the Suppress conditional editor button
b) Find GridRowColumnValue and place it in the editor.
c) locate the name you used as an alias from RowAndColumnNames and
 put it between the brackets and add the condition:

GridRowColumnValue ("BoardingDate") like 'Other*'
Check and close

And there is no way that I've found of individually setting the column width, change one they all change, but this may help.




The best way I found to handle such scenarios is to create a grouping formula where the viable data would be grouped as one label (like "Display"), while the rest in another (like "Ignore").
You then insert this formula at the top-level column of the crosstab and in the sort order choose "Specified Order" and select your "display" valued group while ignoring the "Other".
This method serves several purposes, mainly does not require adjustments to the selection logic and not having suppressed empty columns which still occupy space in the crosstab.