Avatar of gbeattie
gbeattieFlag for Canada asked on

Conditional Supressing in Crystal XI

I have a client who wants to supress some information that is printed on pay stubs for their employees.

The problem is that when she prints their paystubs, there are 3 columns with amounts. Pay period, Year-To-Date and Balance amounts.. Under the Balance column there are different rows that print. But there is a specific amount that she doesn't want to show up. I can't supress the Balance column as it will supress other useful information. The same goes for supressing a row, I don't want to suppress the entire row, just the amount under the balance column for that row.

I've attached a picture that I just created to help illustrate my issue. If you're looking at the picture, what I want to do is to supress BAmount3. I don't want to supress anything else. So everything else listed under the Balance column should still be visible, and everything else listed in the Earning3 row should be visible.

Is there a way this is possible?
Supressing.bmp
Crystal Reports

Avatar of undefined
Last Comment
Neranel

8/22/2022 - Mon
Neranel

On each field you can add a conditional supression, return 1 or true to supress and 0 or false to show.  I mainly use Crystal 10 so my screenshot wont help you much.
Mike McCracken

Try this idea using conditional suppression

Right click the field
Click FORMAT FIELD
Click the COMMON tab
Click the FORMULA BUTTON to the right of suppress
Enter a formula like this using the value she wants suppressed
CurrentFieldValue = 564.92

mlmcc

ASKER
gbeattie

The problem with that mlmcc is that the value is never the same. This is a paystub that's continuously changing every pay.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Neranel

then set a parameter field, and supress conditionally based on @field = ?param
Mike McCracken

Do you always want to suppress that field or just when it is a certain value?

Does that value change for each record or just for each run of the report?

mlmcc
Neranel

And how do you know what value you want supressed?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
gbeattie

mlmcc: I always want to suppress that field, it doesn't matter what value it is. Since this is a paystub, the value is different every 2 weeks and this report is only ran every 2 weeks. So the value changes every time they run the report as well as for each record.

Neranel: If there is a value under that specific column and that specific row (Earning3, Balance) I always want that value supressed. I don't know what the value is before hand.
petrosyg

If you never want to see the value then right click the field, click on "Format Field".  Go to the Common tab and click the check box next to "Suppress"

or

If you never want to see that value, just remove it from the report.
Mike McCracken

Another way if you need is to set the color to WHITE or the background color.

mlmcc
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ASKER
gbeattie

Alright, it looks like most people on here are trying to be very helpful, and I appreciate that very much. But I guess I did a terrible job explaining my situation. I wanted to avoid this, but here is the crystal screen and the paystub that I want to modify.

Crystal Screen
The BALANCE that's highlighted red is only 1 field, but it may have numerous amounts associated with it.

Paystub screen
On the paystub, I do not want the Balance column suppressed nor the "Other" row. What I want suppressed is the 19.27. It will never be the same, it will always change because this is a balance that keeps increasing every pay.

Looking back at the Crystal screen though, it looks like I can only either suppress the row or the column, which isn't what I'm looking to do.

Please take a look and let me know if I need to do a bit more explaining.

Thanks.
Crystal.JPG
paystub.JPG
Mike McCracken

Can you identify the row when you are in it?

You could conditionally suppress the balance column like

{EarningField} = 'Earning3'

mlmcc
petrosyg

Do you ever want to see a "Balance" in the "Other" category?

In not, right-click, Format Field, Common tab

next to suppress there's a formula button.
try putting

{cmpName} =  "Other"

in the formula box. . .
(can't see the whole field name there)
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Neranel

Next to supress there should be a check box to alwasy supress just that single field, if thats what you want.  If only sometimes. youll need to hit the formula button and devise a bolean formula to tell the system when to supress, return true or 1 to supress, and false or 0 to show.
ASKER
gbeattie

Alright, if we take a look at the paystub screen. I want to see 801.85, but I want to suppress 19.27.

Is that possible?
Neranel

Yes, see my prevous post, open the format for the field you want to supress.
Your help has saved me hundreds of hours of internet surfing.
fblack61
Neranel

could you upload the report file?, What version of crystal is it?
Neranel

You will want to see do a conditional supression based on the earning/ded/tax i would gather.  

if {earning/ded/tax} = '6% Accrual/6% V' then
    formula = 0
else
    formula = 1
end if
ASKER
gbeattie

What does '6% Accrual/6% V' have to do with anything? Either way, here's the report. It's in version XI.

Thanks.
cpcheck1-m.txt
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
Neranel

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
gbeattie

Wow, that's exactly what I was looking for!

Thank you so much.
ASKER
gbeattie

Actually, we ran the report on the company's live data and we have a problem. =(

Vacation Balances are not showing up on the employee pay stubs.  However, anyone earning 6% is showing up, but everyone else's is blank.

Is there any way to fix this?
Neranel

Change my condition supression to be be
if {CPPCKD.SHORTDESC} in ("6% Accrual/6% V", "next to show up", "Next to show up", "etc.") then 
    formula = false
else
    formula = true
end if

Open in new window

Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Neranel

Also if you could check the key for this instead of the text, that would be better practice.
if {CPPCKD.key field} in (3, 5, 6, 7, 8) then 
    formula = false
else
    formula = true
end if

Open in new window

ASKER
gbeattie

Thanks, but where do I go to modify the conditional suppression?

Also, can you elaborate a bit more on the second post? I'm not sure I understand the meaning behind the numbers.

Thanks.
Neranel

Here is some screenshot to get to the code.  The second post is simply if there is a key value you can look at instead of a string of text, while both work, keys are much cleaner and dont break if you rename your description in your system.
EEUpload.pdf
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
gbeattie

Would I be able to flip the formula around? As in:

if {CPPCKD.SHORTDESC} = "SICK ACCRU/SICK" then
    formula = true
else
    formula = false
end if

Would that just supress only the Sick accrual and show everything else?
Neranel

Yes that would work.
ASKER
gbeattie

Haha!
Isn't that a lot easier than the other way around? =)
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Neranel

All you needed to say is I dont want it to show up for the Sick category and the rest to show, and that would be what i did.
Neranel

When dealing with conditional supression or record selection formulas do this.

1. Find the simplest logigial pogression to decide whether or not to show a field (or record, or section, or group)

2.  Most of these will fit into a standard If Then Else statement or a Select Case satement.

3. if that does not work, try linking more than 1 IF or CASE statement together to meet your needs.
Neranel

for instance a more complicated if then statement would look like this.  There are easier ways to do what this one does, but in the context of the report this field is in its required to be done this way.
GLOBAL xperiod as number
GLOBAL xyear as number
IF tonumber ({tglSegmentCode.AcctSegValue}) in array (10, 20, 50) then
    IF xperiod >3 then
        IF month ({tarInvoice.PostDate}) >3 THEN
            if  month ({tarInvoice.PostDate}) <= xperiod then
                IF year ({tarInvoice.PostDate}) = xyear then
                    formula = CCur({tarInvoiceDetl.ExtAmt} - {tarInvoiceDetl.TradeDiscAmt})
                else
                    formula = CCur(0)
                END IF
            ELSE
                Formula = CCur(0)
            END IF    
        ELSE
            formula = CCur(0)
        END IF
    ELSE
        IF month ({tarInvoice.PostDate}) >3 THEN
            IF year ({tarInvoice.PostDate}) = xyear - 1 then
                formula = CCur({tarInvoiceDetl.ExtAmt} - {tarInvoiceDetl.TradeDiscAmt})
            else
                formula = CCur(0)
            END IF
        ELSE
            if  month ({tarInvoice.PostDate}) <= xperiod then
                if year ({tarInvoice.PostDate}) = xyear then
                    formula = CCur({tarInvoiceDetl.ExtAmt} - {tarInvoiceDetl.TradeDiscAmt})
                else
                    formula = CCur(0)
                end if
            ELSE
                Formula = CCur(0)
            END IF    
        END IF
    End If
ELSE
    Formula = CCur(0)
end if

Open in new window

Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Neranel

That formula displays a value but the same logic applies.