Solved

Suppressing Criteria On Cross-Tab Fields

Posted on 2001-06-14
3
642 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 200 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

770 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