Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Suppressing Criteria On Cross-Tab Fields

Posted on 2001-06-14
3
Medium Priority
?
650 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
ID: 6193221
Why not substitute a formula for the comment along the lines of

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

Author Comment

by:jtrapat1
ID: 6195747
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 800 total points
ID: 6196030
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

972 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