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!

Trying to conditionally suppress columns and white space.

Status
Not open for further replies.

DelmarDawg

Programmer
Nov 18, 2002
9
US
I am trying to use Crystal to display custom reports. Users can select which columns to display. As a result, I need to conditionally suppress columns and slide the rest of the columns to the left. This is not that big of a deal, however, the white space left behind is killing me. Does anyone know how to lose the white space as well as the suppressed column?
 
There are different approaches that might suit you better, here's one:

You can build multiple detail bands which have different combinations of fields, only one detail band is ever displayed, the others being suppressed as the parameter dictates.

-k kai@informeddatadecisions.com
 
Thank you!
I have a group of twenty reports I am working on. Eleven of the reports will work very well with this solution. The others have too many possible variations for this to be a viable option. I am exploring another solution for these reports. Something along the lines of this:
Column A formula

[if isnull({table.ColumnA}) then
{table.ColumnB}
else
{table.ColumnA}]

Provided "Column A" does not have a value when Column B contains a value
this formula can be used in place of the "ColumnA" database field.

I am trying to make this work for columns A-H (basically sliding columns with data to the left). Other then the data types, can you think of other issues I should be looking into?
 
I think that for that report you should dynamically build formulas and use those in your report.

Sounds like you grasp Crystal well enough, so I'll just annoy you with theory:

@formula1
if ubound({?MyParm}) > 0 then
(
if {?MyParm}[1] = "MyField1" then
{MyTable.MyField1}
else if
{?MyParm}[1] = "MyField2" then
{MyTable.MyField2}
else if
{?MyParm}[1] = "MyField3" then
{MyTable.MyField3}
else if
...
)
else
"NUKEME"

Now you can suppress based on the value being "NUKEME", but you've a whoooole lotta if's to put together.

Pretty annoying, eh?

-k kai@informeddatadecisions.com
 
You said a mouthful with that whole lotta "if's"!
This should give me something to do for awhile. Thanks again for the help. Oh, last thing...if I do have many, many "if's" how badly do you think it will degrade performance?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top