Solved

Suppressing Criteria On Cross-Tab Fields

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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 …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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