Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wierd Problem with Suppress Section in CR9

Status
Not open for further replies.

wcp

MIS
Aug 7, 2003
12
US
We have just upgraded from Crystal Reports 8.5 to CR 9. I had a report that worked great in CR 8.5, however when I save it in 9, everything seems to work except for the suppress section I had setup. I have a formula setup to determine if the section should be suppressed and it is:

{@EstOptions} = "Yes"

If I create a new variable and run an if/then check on the field EstOptions, placing 1 if it's "Yes", 2 if it's not, it comes back as a 1. If I take another new variable, set it to the number 0 for instance and hide my section based off that, it works fine. However, if I take the variable that evaluates to a 1 and check it in the suppression formula, it will not suppress the section. It's just a really wierd thing, all the syntax is working fine and everything, it's just really really odd.

Thanks for any help you may be able to provide.
 
Another thing I found out is that if I use the same statement to hide one of the headers it works fine. Any help would still be greatly appreciated.

Thanks in advance!!
 
I think I'm starting to answer my own problem....lol, anyways, if I show the variable in any of the group headers, it displays "Yes" and will work with any header, however when I try to display it in any footer is shows up blank and doesn't hide the row. Is there any type of layering of a variable that I need to worry about here or anything???

Thanks again!!!
 
This should be my final reply unless I get it working....for some reason the expression I use to calculate @EstOptions is an if statement which evaluates to true when ran in the header and false if I run it in the footer....is there any reason for this???

Here's the formula:

IF {Sequence} = 2 Then {Free-Field-Char} Else "No"


Thanks again!!!
 
This will be my final post unless I get the answer :) When I check my formula

IF {FreeField.Sequence} = 2 Then {FreeField.Free-Field-Char} Else "No"

there are multiple sequence numbers per record. When I check it in my header, it appears it's checking squence number 2, however when checking the footer it appears it's using sequence number 4. When I clear the information out of the database for sequence number 4, everything works great and the section hides, however once I add it back in, it doesn't work again. Is there a different way to do my formula above so that it will always lookup sequence 2??

Thanks again!!!
 
Why not try something like {@seq2) in your details section:

IF {Sequence} = 2 Then 1 Else 0

Then use the following for your suppression formula:

sum({@seq2),{table.groupfield}) <> 0

This assumes that what you want to do is suppress the group header/footer/or details section if {sequence} = 2 in any record within the group. Not sure that is your intent though...

-LB
 
LBass,

Thanks for the response. What I'm wanting to do is do a hide/show a group footer based on a lookup of a free-field-char field where sequence = 2.

Our system has a goofy way of doing free fields. When you create free fields (we currently have 7), instead of setting up different fields with these properties, it stores them inside 1 table with a field for sequence (which is a number 1 through 7) and connects with free-field-char, free-field-date, and free-field-number. Depending on the type of free field it is, it stores a value in the related field. (i.e. if it's a string, it goes in the free-field-char field). The problem comes in that there may be 4 or 5 of these records for every estimate made in our system. (A free field for customer email and in this case, multiple options). So our table will look something like this:

Sequence free-field-char free-field-date Estimate-Num
2 Yes 26
3 it@abc.com 26
6 8-18-2004 26

What I need to do is tell it to check the free-field-char field for sequence 2 for Est-Num 26. For some reason if I do a if-then statement or a case statement by the time it gets to the footer, it's on the equivilant of it@abc.com. I need to do some type of a sql statement inside the formula to tell it to select free-field-char where sequence = 2, but I can't figure out how to do that. I was able to do a workaround for it, by telling it to only bring in fields where sequence = 2, but if I needed to access another free field, I would not be able to. I'm looking for some way to do a formula select statement, if possible.


Thanks again!!!
 
Does the free field character when sequence = 2 ever equal something other than "yes"? From what you have said so far, I still think my formula will work for you.

The results you are getting is what would be expected. If there are multiple details, the header will always take the value of the first record, and the footer, the value of the last record. That's why you need to get your formula to evaluate correctly at the group level. I think you could also use something like {@seq2}:

if {table.sequence} = 2 then {free-field-char} else ""

Then use the following for your suppression formula:

maximum({@seq2},{table.groupfield}) = "Yes"

This is essentially the same as my first suggestion, so maybe I'm still missing something. Did you try my earlier suggestion?

-LB
 
LBass,

Thanks for the response again.....I tried it and it worked!!! Woo Hoo!!!! I'm very new to Crystal, although I'm experienced with formulas, believe it or not...I believe I understand how it works, but thanks again....I'm familiar with VBA and Excel/Access formulas, but I'm still trying to find my way around crystal....thanks again though for everything!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top