cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional Section Supression Not Working

Former Member
0 Kudos

Hi,

I am new to CR and I am working my way through the exercises in the documentation.  I am on page 206 and am trying to conditionally suppress sections in my form letter.  I am using the Xtreme.mdb sample database.  I have the Customer and Credit tables linked in my project.

I have one details section that I am trying to suppress when {Credit.Amount} > 1500.0; and then another section that should be suppressed when {Credit.Amount} <= 1500.0;

Regardless of the amount I am always seeing the first section, when {Credit.Amount} > 1500.0, even when the credit value is < 1500.00?

I am using the section expert and put the statement in the formula section beside Suppress (No Dirll-Down).

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Catherine

You may trying using an if else statement then return a Boolean value when you are suppressing.

If {Credit.Amount} > 1500.0 then

     True

Else

     False

If {Credit.Amount} <= 1500.0then

     True

Else

     False

And make sure also that the {Credit.Amount} is a numeric value.

Hope this helps!

Best Regards,

Marc

Former Member
0 Kudos

Tried that and still no go ... I'm wondering if it's having some problem evaluation the data?  How could I confirm this?

abhilash_kumar
Active Contributor
0 Kudos

Remove the conditional suppression formula.

Create a formula with this code:

If {Credit.Amount} > 1500 then

     "Greater"

Else

     "Less"

Place this on the Details Section. What are the results?

-Abhilash

Former Member
0 Kudos

I get an error "A boolean is required here"


Catherine

abhilash_kumar
Active Contributor
0 Kudos

Strange. The above formula does not output a boolean..it's string.

Could you paste the screenshot of the formula window along with the error message when it pops up?

-Abhilash

Former Member
0 Kudos
abhilash_kumar
Active Contributor
0 Kudos

Don't use the formula I provided in the 'suppress' condition.

Remove everything from the suppress condition.

Create a new formula field with the code I supplied above and drop it on the Details section.

-Abhilash

Former Member
0 Kudos

Whoops, sorry (I'm new to this and working my way through the user manual)

I always get Less

Former Member
0 Kudos

Maybe it is because the values in the database are stored with the () around the value, i.e. ($2,981.20) versus "$2,981.20"

I am not familiar with the syntax but I'm trying to do something clever like this (and it's not working because I am useless at understanding this syntax used for formulas and can't find a good reference)

String str = Credit.Amount

str[0] = """

str[Len(str) - 1] = """

If CCur(str) > CCur(1500.00) Then

     "Greater " + CStr({Credit.Amount});

Else

     "Less " + CStr({Credit.Amount});

abhilash_kumar
Active Contributor
0 Kudos

If you see brackets around a value when you place the {Credit.Amount} field on the Details Section then it could indicate that the value is negative.

So, ($2981.20) is actually -2981.20

-Abhilash

Former Member
0 Kudos

When I look at the values in Access they are all positive.

How do you manipulate a StringVar?

StringVar str := "12345";

str[1] := '6'; //doesn't work  ... I want the string to be 62345?

abhilash_kumar
Active Contributor
0 Kudos

StringVar str := "12345";


There are many ways to do this:


1)

stringvar str := "12345";

replace(str, "1", "6");

2)

stringvar str := "12345";

str := "6" & Mid(str,2)


and a few more.


-Abhilash

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Catherine,

Which is the other section that you've applied the formula to?

Are you sure you've applied the right formula on the right section?

-Abhilash

Former Member
0 Kudos

Positive.