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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check if condition occurs anywhere in report 1

Status
Not open for further replies.

glyrocks

Technical User
Nov 16, 2006
57
US
I'm trying to work out some footnote automation. I thought I was further ahead than I am though. I need to be able to check if any record returned on a page meets a certain condition. Meaning, if any record in the report has mapxsln.bw = "Yes" I want to change a variable value. I thought whileprintingrecords would do that, but it's not working out. Any suggestions? Thanks,

dylan
 
I have a column with a footnote that changes depending on the records returned. If any of the records in the report meet the condition (mapxsln.bw = "Yes") then that footnote number needs to change. In this particular case, it's only either a '1' or it's blank. I'm using a string variable to describe what should be displayed.

So, if CR sees that for, say, the fifth record returned, mapxsln.bw = "Yes" it will know that the BW column superscript (in the page header) should not be displayed.

Once I have that worked out, I need to do something similar with each record. Instead of there not being a footnote indicated (which is what should happen if no record returned meets mapxsln.bw = "Yes"), if any record returned meets the if condition, each record that does not meet that condition needs a '1' and each record that does needs a '2'.

I didn't include that level of explanation because I think I can figure out the rest if I can get some direction on how to change the variable (that my formulas use to determine the footnote number) based on whether any record meets the mapsxln.bw = "Yes" condition.

What I have that I thought was working is more or less this:
Code:
whileprintingrecords
Shared x As String
If {mapxsln.BW} = "Yes" Then
    formula = ""
    x = ""
Else
    formula = "1"
    x = "1"
end if

Did that clarify or confuse the problem?

dylan
 
Create a detail-level formula of:

IF Condition is true THEN 1 ELSE 0

If the SUM of that formula is greater the 0, you know that at least one record answered the condition.

- Ido


view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Thanks Ido, that got me moving in the right direction!

dylan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top