Solved

Suppressing Criteria On Cross-Tab Fields

Posted on 2001-06-14
3
640 Views
Last Modified: 2007-11-27
I am using CR8 with SQL Server 7.
I have several fields that are coming from cross-tab queries and I need to suppress a certain value.

My report layout looks like this:
(Both the Agent field and Comments field are coming from two separate cross-tabs, both based on Num, the key)

Num      Desc     Agent      Comments
A0010    desc     Jones      There is work...
                  Smith      Still pending...
                  Allen      Job is in...

Now, I have one particular agent, Allen who would like to hide his comments from showing up on the report.

I tried right-clicking on the comments field and adding a formula to the Suppress, Object_Visibility tab:
if {Agent} = "Allen" then false
else true

But this didn't work - when I ran the report, it suppressed all of the comments fields, for just that one record!

How would I get this suppression "in sync" from both cross-tabs, so that I would suppress just the Comments field for the value of one Agent, Allen?

Thanks in advance.
0
Comment
Question by:jtrapat1
  • 2
3 Comments
 
LVL 12

Expert Comment

by:DRRYAN3
Comment Utility
Why not substitute a formula for the comment along the lines of

if {agent}="Allen"
  ""
else
  {comment}
0
 

Author Comment

by:jtrapat1
Comment Utility
Dr.,
Thanks for the response;

I tried this formula (and lots like it) but I'm fairly new to Crystal so I don't know how the Crystal syntax differs from VB syntax or Basic Syntax.

My co-workers say that you have to "trick" Crystal to get the desired data.

I got a little closer when I tried this formula:

If{Agent}="Allen" then
CurrentFieldValue = ""
else
CurrentFieldValue = {Comments}

But this only gave me the desired output for the one particular row that I edited; when the report encountered another record with this "Allen" value, it didn't suppress the comments.

Like I said, both of the fields I'm trying to line up vertically across the report are in cross-tabs;

So, I have to use CurrentFieldValue, don't I?

Also, don't I have to use rtrim or other string functions to make sure I compare to the exact value?

Thanks.
0
 
LVL 12

Accepted Solution

by:
DRRYAN3 earned 200 total points
Comment Utility
Maybe you need to step back in the process a little bit and modify the source of the cross-tab query such that comments for Allen are not included.  Otherwise, you will have to use a formula for each cell in the report where you want the supression to take place.

If you attempt to place the crosstab field directly on the report, then you will have to use the CurrentFieldValue.  If you remove the data field and place a formula on the report instead, the syntax I gave you will work just fine.

Generally speaking, you do not have to trim the text coming into crystal unless you know that you have padded it in the data source.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now